Bug 1041512 - Mark intrinsic widths dirty on a style change even if the frame hasn't had its first reflow yet. r=dbaron

This commit is contained in:
Cameron McCormack
2014-09-17 10:40:11 +10:00
parent 21b8c0bd79
commit 72c8556198
3 changed files with 26 additions and 16 deletions

View File

@@ -2775,10 +2775,11 @@ PresShell::FrameNeedsReflow(nsIFrame *aFrame, IntrinsicDirty aIntrinsicDirty,
nsFrameState aBitToAdd)
{
NS_PRECONDITION(aBitToAdd == NS_FRAME_IS_DIRTY ||
aBitToAdd == NS_FRAME_HAS_DIRTY_CHILDREN,
aBitToAdd == NS_FRAME_HAS_DIRTY_CHILDREN ||
!aBitToAdd,
"Unexpected bits being added");
NS_PRECONDITION(aIntrinsicDirty != eStyleChange ||
aBitToAdd == NS_FRAME_IS_DIRTY,
NS_PRECONDITION(!(aIntrinsicDirty == eStyleChange &&
aBitToAdd == NS_FRAME_HAS_DIRTY_CHILDREN),
"bits don't correspond to style change reason");
NS_ASSERTION(!mIsReflowing, "can't mark frame dirty during reflow");
@@ -2876,6 +2877,11 @@ PresShell::FrameNeedsReflow(nsIFrame *aFrame, IntrinsicDirty aIntrinsicDirty,
} while (stack.Length() != 0);
}
// Skip setting dirty bits up the tree if we weren't given a bit to add.
if (!aBitToAdd) {
continue;
}
// Set NS_FRAME_HAS_DIRTY_CHILDREN bits (via nsIFrame::ChildIsDirty)
// up the tree until we reach either a frame that's already dirty or
// a reflow root.