Index: Source/core/rendering/RenderView.cpp |
diff --git a/Source/core/rendering/RenderView.cpp b/Source/core/rendering/RenderView.cpp |
index ae31849c2c74f0b99c8c306b3669f0fb906cabab..1265abd2453e8a8a916055fe400d308fc8b78fcb 100644 |
--- a/Source/core/rendering/RenderView.cpp |
+++ b/Source/core/rendering/RenderView.cpp |
@@ -162,7 +162,7 @@ void RenderView::positionDialogs() |
} |
} |
-void RenderView::layoutContent(const LayoutState& state) |
+void RenderView::layoutContent() |
{ |
ASSERT(needsLayout()); |
@@ -176,27 +176,27 @@ void RenderView::layoutContent(const LayoutState& state) |
return; |
#ifndef NDEBUG |
- checkLayoutState(state); |
+ checkLayoutState(); |
#endif |
} |
#ifndef NDEBUG |
-void RenderView::checkLayoutState(const LayoutState& state) |
+void RenderView::checkLayoutState() |
{ |
if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) { |
ASSERT(layoutDeltaMatches(LayoutSize())); |
} |
ASSERT(!m_layoutStateDisableCount); |
- ASSERT(m_layoutState == &state); |
+ ASSERT(!m_layoutState->m_next); |
} |
#endif |
-void RenderView::initializeLayoutState(LayoutState& state) |
+void RootLayoutStateScope::initializeLayoutState() |
{ |
- state.m_clipped = false; |
- state.m_pageLogicalHeight = m_pageLogicalHeight; |
- state.m_pageLogicalHeightChanged = m_pageLogicalHeightChanged; |
- state.m_isPaginated = state.m_pageLogicalHeight; |
+ m_rootLayoutState.m_clipped = false; |
+ m_rootLayoutState.m_pageLogicalHeight = m_view.m_pageLogicalHeight; |
+ m_rootLayoutState.m_pageLogicalHeightChanged = m_view.m_pageLogicalHeightChanged; |
+ m_rootLayoutState.m_isPaginated = m_rootLayoutState.m_pageLogicalHeight; |
} |
void RenderView::layout() |
@@ -232,23 +232,19 @@ void RenderView::layout() |
if (!needsLayout()) |
return; |
- LayoutState state; |
- initializeLayoutState(state); |
+ RootLayoutStateScope rootLayoutStateScope(*this); |
m_pageLogicalHeightChanged = false; |
- m_layoutState = &state; |
- layoutContent(state); |
+ layoutContent(); |
if (m_frameView->partialLayout().isStopping()) { |
- m_layoutState = 0; |
return; |
} |
#ifndef NDEBUG |
- checkLayoutState(state); |
+ checkLayoutState(); |
#endif |
- m_layoutState = 0; |
clearNeedsLayout(); |
} |