Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(982)

Unified Diff: Source/core/frame/FrameView.cpp

Issue 335963002: Change LayoutState to be stack-allocated (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix push function to match old behavior... Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/rendering/LayoutState.h » ('j') | Source/core/rendering/LayoutState.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/FrameView.cpp
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index e0214c1d30dfd7bd0035d2713f0f65bef932d115..d87e872ca1479264537582a81e487d2a8f4d309e 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -104,33 +104,6 @@ static RenderLayer::UpdateLayerPositionsFlags updateLayerPositionFlags(RenderLay
return flags;
}
-class FrameViewLayoutStateMaintainer {
- WTF_MAKE_NONCOPYABLE(FrameViewLayoutStateMaintainer);
-public:
- FrameViewLayoutStateMaintainer(RenderObject& root, bool inSubtreeLayout)
- : m_view(*root.view())
- , m_inSubtreeLayout(inSubtreeLayout)
- , m_disabled(inSubtreeLayout && m_view.shouldDisableLayoutStateForSubtree(root))
- {
- if (m_inSubtreeLayout)
- m_view.pushLayoutState(root);
- if (m_disabled)
- m_view.disableLayoutState();
- }
-
- ~FrameViewLayoutStateMaintainer()
- {
- if (m_disabled)
- m_view.enableLayoutState();
- if (m_inSubtreeLayout)
- m_view.popLayoutState();
- }
-private:
- RenderView& m_view;
- bool m_inSubtreeLayout;
- bool m_disabled;
-};
-
FrameView::FrameView(LocalFrame* frame)
: m_frame(frame)
, m_canHaveScrollbars(true)
@@ -809,7 +782,8 @@ void FrameView::performLayout(RenderObject* rootForThisLayout, bool inSubtreeLay
// 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.
- FrameViewLayoutStateMaintainer statePusher(*rootForThisLayout, inSubtreeLayout);
+ LayoutState layoutState(*rootForThisLayout);
+
forceLayoutParentViewIfNeeded();
// FIXME (crbug.com/256657): Do not do two layouts for text autosizing.
@@ -1059,7 +1033,7 @@ void FrameView::invalidateTree(RenderObject* root)
// Until those states are fully fledged, I'll just disable the ASSERTS.
DisableCompositingQueryAsserts compositingQueryAssertsDisabler;
- RootLayoutStateScope rootLayoutStateScope(*root);
+ LayoutState rootLayoutState(*root);
root->invalidateTreeAfterLayout(*root->containerForPaintInvalidation());
« no previous file with comments | « no previous file | Source/core/rendering/LayoutState.h » ('j') | Source/core/rendering/LayoutState.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698