Title: [203751] trunk/Source/WebCore
Revision
203751
Author
[email protected]
Date
2016-07-26 16:33:58 -0700 (Tue, 26 Jul 2016)

Log Message

Move RenderView::shouldDisableLayoutStateForSubtree to SubtreeLayoutStateMaintainer.
https://bugs.webkit.org/show_bug.cgi?id=160215

Reviewed by Darin Adler and Simon Fraser.

No change in functionality.

* page/FrameView.cpp:
(WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
* rendering/RenderView.cpp:
(WebCore::RenderView::shouldDisableLayoutStateForSubtree):
* rendering/RenderView.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (203750 => 203751)


--- trunk/Source/WebCore/ChangeLog	2016-07-26 23:31:43 UTC (rev 203750)
+++ trunk/Source/WebCore/ChangeLog	2016-07-26 23:33:58 UTC (rev 203751)
@@ -1,3 +1,18 @@
+2016-07-26  Zalan Bujtas  <[email protected]>
+
+        Move RenderView::shouldDisableLayoutStateForSubtree to SubtreeLayoutStateMaintainer.
+        https://bugs.webkit.org/show_bug.cgi?id=160215
+
+        Reviewed by Darin Adler and Simon Fraser.
+
+        No change in functionality.
+
+        * page/FrameView.cpp:
+        (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::shouldDisableLayoutStateForSubtree):
+        * rendering/RenderView.h:
+
 2016-07-26  Simon Fraser  <[email protected]>
 
         Allow LOG macros to be used outside the namespace, and other logging cleanup

Modified: trunk/Source/WebCore/page/FrameView.cpp (203750 => 203751)


--- trunk/Source/WebCore/page/FrameView.cpp	2016-07-26 23:31:43 UTC (rev 203750)
+++ trunk/Source/WebCore/page/FrameView.cpp	2016-07-26 23:33:58 UTC (rev 203751)
@@ -174,9 +174,10 @@
         if (m_layoutRoot) {
             RenderView& view = m_layoutRoot->view();
             view.pushLayoutState(*m_layoutRoot);
-            m_disableLayoutState = view.shouldDisableLayoutStateForSubtree(m_layoutRoot);
-            if (m_disableLayoutState)
+            if (shouldDisableLayoutStateForSubtree()) {
                 view.disableLayoutState();
+                m_didDisableLayoutState = true;
+            }
         }
     }
 
@@ -185,14 +186,23 @@
         if (m_layoutRoot) {
             RenderView& view = m_layoutRoot->view();
             view.popLayoutState(*m_layoutRoot);
-            if (m_disableLayoutState)
+            if (m_didDisableLayoutState)
                 view.enableLayoutState();
         }
     }
 
+    bool shouldDisableLayoutStateForSubtree()
+    {
+        for (auto* renderer = m_layoutRoot; renderer; renderer = renderer->container()) {
+            if (renderer->hasTransform() || renderer->hasReflection())
+                return true;
+        }
+        return false;
+    }
+    
 private:
     RenderElement* m_layoutRoot { nullptr };
-    bool m_disableLayoutState { false };
+    bool m_didDisableLayoutState { false };
 };
 
 FrameView::FrameView(Frame& frame)

Modified: trunk/Source/WebCore/rendering/RenderView.cpp (203750 => 203751)


--- trunk/Source/WebCore/rendering/RenderView.cpp	2016-07-26 23:31:43 UTC (rev 203750)
+++ trunk/Source/WebCore/rendering/RenderView.cpp	2016-07-26 23:33:58 UTC (rev 203751)
@@ -1201,17 +1201,6 @@
     pushLayoutStateForCurrentFlowThread(root);
 }
 
-bool RenderView::shouldDisableLayoutStateForSubtree(RenderObject* renderer) const
-{
-    RenderObject* o = renderer;
-    while (o) {
-        if (o->hasTransform() || o->hasReflection())
-            return true;
-        o = o->container();
-    }
-    return false;
-}
-
 IntSize RenderView::viewportSizeForCSSViewportUnits() const
 {
     return frameView().viewportSizeForCSSViewportUnits();

Modified: trunk/Source/WebCore/rendering/RenderView.h (203750 => 203751)


--- trunk/Source/WebCore/rendering/RenderView.h	2016-07-26 23:31:43 UTC (rev 203750)
+++ trunk/Source/WebCore/rendering/RenderView.h	2016-07-26 23:33:58 UTC (rev 203751)
@@ -133,8 +133,6 @@
     void pushLayoutState(RenderObject&);
     void popLayoutState(RenderObject&) { return popLayoutState(); } // Just doing this to keep popLayoutState() private and to make the subtree calls symmetrical.
 
-    bool shouldDisableLayoutStateForSubtree(RenderObject*) const;
-
     // Returns true if layoutState should be used for its cached offset and clip.
     bool layoutStateEnabled() const { return m_layoutStateDisableCount == 0 && m_layoutState; }
     LayoutState* layoutState() const { return m_layoutState.get(); }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to