DescriptionSeparate repaint and layout requirements of StyleDifference (Step 4)
In this step RenderStyle::visualInvalidationDiff() sets both
needsFullLayout and needsRepaintObject if diffNeedsFullLayoutAndRepaint.
For now, all previous diffNeedsFullLayout cases become
diffNeedsFullLayoutRepaint.
In RenderObject, if both needsFullLayout and needsRepaint[Object] are
set, we set shouldDoFullRepaintAfterLayout(), and removed the condition
that needsSelfLayout always triggering shouldDoFullRepaintAfterLayout.
Previous RenderObject::setNeedsLayoutAndFullRepaint() still triggers
full repaint. Added back setNeedsLayout() to allow scheduling layout
without triggering full repaint.
With this change, we can do the following optimizations in next steps:
1. Repaint on RenderView resize (crbug.com/258219):
- set FrameView::m_doFullRepaint only when needed;
- use the flag to trigger full repaint of RenderView;
- change renderView->setNeedsLayoutAndFullRepaint() in FrameView to
renderView->setNeedsLayout() if no full repaint of RenderView is
needed;
2. Repaint on style change needing full layout (e.g. crbug.com/339940):
- move conditions not always needing repaint from
RenderStyle::diffNeedsFullLayoutAndRepaint() into
RenderStyle::diffNeedsFullLayout();
- for above conditions that still may need repaint in some cases,
correctly handle repaints of them during renderer layout.
3. Repaint on other RenderObject::setNeedsLayoutAndFullRepaint():
- examine each caller of RenderObject::setNeedsLayoutAndFullRepaint()
whether full repaint is actually always needed;
- if not, change the call to RenderObject::setNeedsLayout() and
correctly handle repaints during renderer layout if needed.
BUG=358460
TEST=existing layout tests
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=174401
Patch Set 1 #
Total comments: 19
Patch Set 2 : opt-in style #Patch Set 3 : Rebase #
Total comments: 2
Patch Set 4 : Rebase #Messages
Total messages: 23 (0 generated)
|