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

@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
onload="document.getElementById('x').getBoundingClientRect();">
<rect id="x"/>
</svg>

After

Width:  |  Height:  |  Size: 184 B

View File

@ -21,3 +21,4 @@ load 386000-1.html
load 386794-1.html
load 399712-1.html
load 407818.html
load 410860-1.xml

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;
}