diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 81e1844a12f..56818d12832 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -7615,15 +7615,24 @@ DoApplyRenderingChangeToTree(nsIFrame* aFrame, nsChangeHint aChange); /** - * This rect is relative to aFrame's parent - */ + * Sync views on aFrame and all of aFrame's descendants (following placeholders), + * if aChange has nsChangeHint_SyncFrameView. + * Calls DoApplyRenderingChangeToTree on all aFrame's out-of-flow descendants + * (following placeholders), if aChange has nsChangeHint_RepaintFrame. + * aFrame should be some combination of nsChangeHint_SyncFrameView and + * nsChangeHint_RepaintFrame and nsChangeHint_UpdateOpacityLayer, nothing else. +*/ static void -UpdateViewsForTree(nsIFrame* aFrame, - nsFrameManager* aFrameManager, - nsChangeHint aChange) +SyncViewsAndInvalidateDescendants(nsIFrame* aFrame, + nsFrameManager* aFrameManager, + nsChangeHint aChange) { NS_PRECONDITION(gInApplyRenderingChangeToTree, "should only be called within ApplyRenderingChangeToTree"); + NS_ASSERTION(aChange == (aChange & (nsChangeHint_RepaintFrame | + nsChangeHint_SyncFrameView | + nsChangeHint_UpdateOpacityLayer)), + "Invalid change flag"); nsView* view = aFrame->GetView(); if (view) { @@ -7652,7 +7661,7 @@ UpdateViewsForTree(nsIFrame* aFrame, DoApplyRenderingChangeToTree(child, aFrameManager, aChange); } else { // regular frame - UpdateViewsForTree(child, aFrameManager, aChange); + SyncViewsAndInvalidateDescendants(child, aFrameManager, aChange); } } } @@ -7709,18 +7718,15 @@ DoApplyRenderingChangeToTree(nsIFrame* aFrame, "should only be called within ApplyRenderingChangeToTree"); for ( ; aFrame; aFrame = nsLayoutUtils::GetNextContinuationOrSpecialSibling(aFrame)) { - // Get view if this frame has one and trigger an update. If the - // frame doesn't have a view, find the nearest containing view - // (adjusting r's coordinate system to reflect the nesting) and - // update there. - // We don't need to update transforms in UpdateViewsForTree, because + // Invalidate and sync views on all descendant frames, following placeholders. + // We don't need to update transforms in SyncViewsAndInvalidateDescendants, because // there can't be any out-of-flows or popups that need to be transformed; // all out-of-flow descendants of the transformed element must also be // descendants of the transformed frame. - UpdateViewsForTree(aFrame, aFrameManager, - nsChangeHint(aChange & (nsChangeHint_RepaintFrame | - nsChangeHint_SyncFrameView | - nsChangeHint_UpdateOpacityLayer))); + SyncViewsAndInvalidateDescendants(aFrame, aFrameManager, + nsChangeHint(aChange & (nsChangeHint_RepaintFrame | + nsChangeHint_SyncFrameView | + nsChangeHint_UpdateOpacityLayer))); // This must be set to true if the rendering change needs to // invalidate content. If it's false, a composite-only paint // (empty transaction) will be scheduled.