Bug 722923. Part 3: Rename UpdateViewsForFrame and document it properly. r=matspal

--HG--
extra : rebase_source : cc54527bec2d7d049b1abfb079587c183d35899d
This commit is contained in:
Robert O'Callahan 2013-07-06 23:53:40 +12:00
parent ef72daf8b1
commit e818748789

View File

@ -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.