Bug 596765, patch 1: Don't skip initial reflow for zero-sized svg foreignObject frames. r+a=roc

This commit is contained in:
Daniel Holbert 2011-02-17 16:33:30 -08:00
parent 1df70dc742
commit 644a076704

View File

@ -559,7 +559,9 @@ nsSVGForeignObjectFrame::DoReflow()
GetStateBits() & NS_FRAME_FIRST_REFLOW),
"Calling InitialUpdate too early - must not call DoReflow!!!");
if (IsDisabled())
// Skip reflow if we're zero-sized, unless this is our first reflow.
if (IsDisabled() &&
!(GetStateBits() & NS_FRAME_FIRST_REFLOW))
return;
if (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)
@ -587,6 +589,10 @@ nsSVGForeignObjectFrame::DoReflow()
float height =
fO->mLengthAttributes[nsSVGForeignObjectElement::HEIGHT].GetAnimValue(fO);
// Clamp height & width to be non-negative (to match UpdateCoveredRegion).
width = NS_MAX(width, 0.0f);
height = NS_MAX(height, 0.0f);
nsSize size(nsPresContext::CSSPixelsToAppUnits(width),
nsPresContext::CSSPixelsToAppUnits(height));