Bug 410860. Get the prescontext before 'frame' is set to null. r+sr=mats, a=schrep

git-svn-id: svn://10.0.0.236/trunk@244065 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
roc+%cs.cmu.edu
2008-01-26 22:45:42 +00:00
parent c443f95bda
commit eecbba2fa3
3 changed files with 12 additions and 2 deletions

View File

@@ -782,11 +782,12 @@ nsNSElementTearoff::GetBoundingClientRect(nsIDOMTextRectangle** aResult)
NS_ADDREF(*aResult = rect);
nsIFrame* frame = mContent->GetPrimaryFrame(Flush_Layout);
nsIFrame* frame = mContent->GetPrimaryFrame(Flush_Layout);
if (!frame) {
// display:none, perhaps? Return the empty rect
return NS_OK;
}
nsPresContext* presContext = frame->PresContext();
nsRect r;
if (TryGetSVGBoundingRect(frame, &r)) {
@@ -805,7 +806,7 @@ nsNSElementTearoff::GetBoundingClientRect(nsIDOMTextRectangle** aResult)
r = nsLayoutUtils::GetAllInFlowBoundingRect(frame) +
GetOffsetFromInitialContainingBlock(frame);
}
SetTextRectangle(r, frame->PresContext(), rect);
SetTextRectangle(r, presContext, rect);
return NS_OK;
}