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:
parent
c443f95bda
commit
eecbba2fa3
8
mozilla/content/base/crashtests/410860-1.xml
Normal file
8
mozilla/content/base/crashtests/410860-1.xml
Normal 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 |
@ -21,3 +21,4 @@ load 386000-1.html
|
||||
load 386794-1.html
|
||||
load 399712-1.html
|
||||
load 407818.html
|
||||
load 410860-1.xml
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user