Chromium Code Reviews| Index: Source/core/page/FrameView.cpp |
| diff --git a/Source/core/page/FrameView.cpp b/Source/core/page/FrameView.cpp |
| index 12878f0d64e4bea40a8ce983784d398a3e652e10..cf45b9a8968e4c973ee4162aec897fc6e8d7956e 100644 |
| --- a/Source/core/page/FrameView.cpp |
| +++ b/Source/core/page/FrameView.cpp |
| @@ -55,6 +55,7 @@ |
| #include "core/page/animation/AnimationController.h" |
| #include "core/page/scrolling/ScrollingCoordinator.h" |
| #include "core/platform/ScrollAnimator.h" |
| +#include "core/platform/ScrollbarTheme.h" |
| #include "core/platform/graphics/FloatRect.h" |
| #include "core/platform/graphics/FontCache.h" |
| #include "core/platform/graphics/GraphicsContext.h" |
| @@ -179,6 +180,7 @@ FrameView::FrameView(Frame* frame) |
| , m_didRunAutosize(false) |
| , m_hasSoftwareFilters(false) |
| , m_visibleContentScaleFactor(1) |
| + , m_partialLayout(PartialLayoutState()) |
|
eseidel
2013/09/03 19:14:27
This isn't needed.
pdr.
2013/09/03 21:37:35
how do i c++?
Fixed.
|
| { |
| init(); |
| @@ -279,6 +281,7 @@ void FrameView::reset() |
| m_firstVisuallyNonEmptyLayoutCallbackPending = true; |
| m_maintainScrollPositionAnchor = 0; |
| m_disableRepaints = 0; |
| + m_partialLayout.reset(); |
|
eseidel
2013/09/03 19:14:27
Or m_partialLayout = PartialLayoutState(). I susp
|
| } |
| void FrameView::removeFromAXObjectCache() |
| @@ -876,20 +879,25 @@ void FrameView::performLayout(RenderObject* rootForThisLayout, bool inSubtreeLay |
| // performLayout is the actual guts of layout(). |
| // FIXME: The 300 other lines in layout() probably belong in other helper functions |
| // so that a single human could understand what layout() is actually doing. |
| + { |
| + bool disableLayoutState = false; |
| + if (inSubtreeLayout) { |
| + RenderView* view = rootForThisLayout->view(); |
| + disableLayoutState = view->shouldDisableLayoutStateForSubtree(rootForThisLayout); |
| + view->pushLayoutState(rootForThisLayout); |
| + } |
| + LayoutStateDisabler layoutStateDisabler(disableLayoutState ? rootForThisLayout->view() : 0); |
| - bool disableLayoutState = false; |
| - if (inSubtreeLayout) { |
| - RenderView* view = rootForThisLayout->view(); |
| - disableLayoutState = view->shouldDisableLayoutStateForSubtree(rootForThisLayout); |
| - view->pushLayoutState(rootForThisLayout); |
| - } |
| - LayoutStateDisabler layoutStateDisabler(disableLayoutState ? rootForThisLayout->view() : 0); |
| - |
| - m_inLayout = true; |
| - beginDeferredRepaints(); |
| - forceLayoutParentViewIfNeeded(); |
| + m_inLayout = true; |
| + beginDeferredRepaints(); |
| + forceLayoutParentViewIfNeeded(); |
| - rootForThisLayout->layout(); // THIS IS WHERE LAYOUT ACTUALLY HAPPENS. |
| + // Text Autosizing requires two-pass layout which is incompatible with partial layout. If |
| + // enabled, only do partial layout for the second layout. |
| + // FIXME (crbug.com/256657): Do not do two layouts for text autosizing. |
| + PartialLayoutDisabler partialLayoutDisabler(partialLayout(), m_frame->settings() && m_frame->settings()->textAutosizingEnabled()); |
| + rootForThisLayout->layout(); // THIS IS WHERE LAYOUT ACTUALLY HAPPENS. |
|
eseidel
2013/09/03 18:16:08
Do you mean to keep this comment?
eseidel
2013/09/03 19:14:27
nm. I now see it predates your patch.
pdr.
2013/09/03 21:37:35
While you were on vacation I complained about this
|
| + } |
| bool autosized = frame()->document()->textAutosizer()->processSubtree(rootForThisLayout); |
| if (autosized && rootForThisLayout->needsLayout()) { |
| @@ -946,6 +954,8 @@ void FrameView::layout(bool allowSubtree) |
| if (m_inLayout) |
| return; |
| + ASSERT(!m_partialLayout.shouldStop()); |
| + |
| TRACE_EVENT0("webkit", "FrameView::layout"); |
| TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "Layout"); |
| @@ -1049,15 +1059,24 @@ void FrameView::layout(bool allowSubtree) |
| layer = rootForThisLayout->enclosingLayer(); |
| m_actionScheduler->pause(); |
| + // Non-overlay scrollbars can cause a second layout; disable partial layout for the first of these layouts. |
| + PartialLayoutDisabler partialLayoutDisabler(partialLayout(), !ScrollbarTheme::theme()->usesOverlayScrollbars()); |
| performLayout(rootForThisLayout, inSubtreeLayout); |
| m_layoutRoot = 0; |
| } // Reset m_layoutSchedulingEnabled to its previous value. |
| + if (partialLayout().shouldStop()) |
| + return; |
| + |
| bool neededFullRepaint = m_doFullRepaint; |
| if (!inSubtreeLayout && !toRenderView(rootForThisLayout)->printing()) |
| adjustViewSize(); |
| + // adjustViewSize() can cause a layout due to scrollbars so a second shouldStop() check is required. |
| + if (partialLayout().shouldStop()) |
| + return; |
| + |
| m_doFullRepaint = neededFullRepaint; |
| // Now update the positions of all layers. |