Title: [187493] trunk/Source/WebCore
Revision
187493
Author
[email protected]
Date
2015-07-28 11:22:53 -0700 (Tue, 28 Jul 2015)

Log Message

Change markContainingBlocksForLayout() to take an enum, rather than a bool
https://bugs.webkit.org/show_bug.cgi?id=147345

Reviewed by Daniel Bates.

Change markContainingBlocksForLayout to take an enum class for the scheduleRelayout
argument, for better code readability.

* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::scheduleRelayout):
(WebCore::FrameView::scheduleRelayoutOfSubtree):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::markContainingBlocksForLayout):
* rendering/RenderObject.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (187492 => 187493)


--- trunk/Source/WebCore/ChangeLog	2015-07-28 18:22:00 UTC (rev 187492)
+++ trunk/Source/WebCore/ChangeLog	2015-07-28 18:22:53 UTC (rev 187493)
@@ -1,3 +1,21 @@
+2015-07-28  Simon Fraser  <[email protected]>
+
+        Change markContainingBlocksForLayout() to take an enum, rather than a bool
+        https://bugs.webkit.org/show_bug.cgi?id=147345
+
+        Reviewed by Daniel Bates.
+        
+        Change markContainingBlocksForLayout to take an enum class for the scheduleRelayout
+        argument, for better code readability.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::layout):
+        (WebCore::FrameView::scheduleRelayout):
+        (WebCore::FrameView::scheduleRelayoutOfSubtree):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::markContainingBlocksForLayout):
+        * rendering/RenderObject.h:
+
 2015-07-27  Simon Fraser  <[email protected]>
 
         PathApplierFunction should take a reference to a PathElement

Modified: trunk/Source/WebCore/page/FrameView.cpp (187492 => 187493)


--- trunk/Source/WebCore/page/FrameView.cpp	2015-07-28 18:22:00 UTC (rev 187492)
+++ trunk/Source/WebCore/page/FrameView.cpp	2015-07-28 18:22:53 UTC (rev 187493)
@@ -1213,7 +1213,7 @@
     AnimationUpdateBlock animationUpdateBlock(&frame().animation());
     
     if (!allowSubtree && m_layoutRoot) {
-        m_layoutRoot->markContainingBlocksForLayout(false);
+        m_layoutRoot->markContainingBlocksForLayout(ScheduleRelayout::No);
         m_layoutRoot = nullptr;
     }
 
@@ -2550,7 +2550,7 @@
     ASSERT(frame().view() == this);
 
     if (m_layoutRoot) {
-        m_layoutRoot->markContainingBlocksForLayout(false);
+        m_layoutRoot->markContainingBlocksForLayout(ScheduleRelayout::No);
         m_layoutRoot = nullptr;
     }
     if (!m_layoutSchedulingEnabled)
@@ -2600,7 +2600,7 @@
     ASSERT(frame().view() == this);
 
     if (renderView.needsLayout()) {
-        newRelayoutRoot.markContainingBlocksForLayout(false);
+        newRelayoutRoot.markContainingBlocksForLayout(ScheduleRelayout::No);
         return;
     }
 
@@ -2619,21 +2619,21 @@
 
     if (!m_layoutRoot) {
         // Just relayout the subtree.
-        newRelayoutRoot.markContainingBlocksForLayout(false);
+        newRelayoutRoot.markContainingBlocksForLayout(ScheduleRelayout::No);
         InspectorInstrumentation::didInvalidateLayout(frame());
         return;
     }
 
     if (isObjectAncestorContainerOf(m_layoutRoot, &newRelayoutRoot)) {
         // Keep the current root.
-        newRelayoutRoot.markContainingBlocksForLayout(false, m_layoutRoot);
+        newRelayoutRoot.markContainingBlocksForLayout(ScheduleRelayout::No, m_layoutRoot);
         ASSERT(!m_layoutRoot->container() || !m_layoutRoot->container()->needsLayout());
         return;
     }
 
     if (isObjectAncestorContainerOf(&newRelayoutRoot, m_layoutRoot)) {
         // Re-root at newRelayoutRoot.
-        m_layoutRoot->markContainingBlocksForLayout(false, &newRelayoutRoot);
+        m_layoutRoot->markContainingBlocksForLayout(ScheduleRelayout::No, &newRelayoutRoot);
         m_layoutRoot = &newRelayoutRoot;
         ASSERT(!m_layoutRoot->container() || !m_layoutRoot->container()->needsLayout());
         InspectorInstrumentation::didInvalidateLayout(frame());
@@ -2641,9 +2641,9 @@
     }
 
     // Just do a full relayout.
-    m_layoutRoot->markContainingBlocksForLayout(false);
+    m_layoutRoot->markContainingBlocksForLayout(ScheduleRelayout::No);
     m_layoutRoot = nullptr;
-    newRelayoutRoot.markContainingBlocksForLayout(false);
+    newRelayoutRoot.markContainingBlocksForLayout(ScheduleRelayout::No);
     InspectorInstrumentation::didInvalidateLayout(frame());
 }
 

Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (187492 => 187493)


--- trunk/Source/WebCore/rendering/RenderObject.cpp	2015-07-28 18:22:00 UTC (rev 187492)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp	2015-07-28 18:22:53 UTC (rev 187493)
@@ -580,9 +580,9 @@
     downcast<RenderView>(renderer).frameView().scheduleRelayout();
 }
 
-void RenderObject::markContainingBlocksForLayout(bool scheduleRelayout, RenderElement* newRoot)
+void RenderObject::markContainingBlocksForLayout(ScheduleRelayout scheduleRelayout, RenderElement* newRoot)
 {
-    ASSERT(!scheduleRelayout || !newRoot);
+    ASSERT(scheduleRelayout == ScheduleRelayout::No || !newRoot);
     ASSERT(!isSetNeedsLayoutForbidden());
 
     auto ancestor = container();
@@ -626,14 +626,14 @@
         if (ancestor == newRoot)
             return;
 
-        if (scheduleRelayout && objectIsRelayoutBoundary(ancestor))
+        if (scheduleRelayout == ScheduleRelayout::Yes && objectIsRelayoutBoundary(ancestor))
             break;
 
         hasOutOfFlowPosition = ancestor->style().hasOutOfFlowPosition();
         ancestor = container;
     }
 
-    if (scheduleRelayout && ancestor)
+    if (scheduleRelayout == ScheduleRelayout::Yes && ancestor)
         scheduleRelayoutForSubtree(*ancestor);
 }
 

Modified: trunk/Source/WebCore/rendering/RenderObject.h (187492 => 187493)


--- trunk/Source/WebCore/rendering/RenderObject.h	2015-07-28 18:22:00 UTC (rev 187492)
+++ trunk/Source/WebCore/rendering/RenderObject.h	2015-07-28 18:22:53 UTC (rev 187493)
@@ -105,6 +105,8 @@
     MarkContainingBlockChain,
 };
 
+enum class ScheduleRelayout { No, Yes };
+
 enum MapCoordinatesMode {
     IsFixed             = 1 << 0,
     UseTransforms       = 1 << 1,
@@ -590,7 +592,7 @@
 
     RenderBoxModelObject* offsetParent() const;
 
-    void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderElement* newRoot = nullptr);
+    void markContainingBlocksForLayout(ScheduleRelayout = ScheduleRelayout::Yes, RenderElement* newRoot = nullptr);
     void setNeedsLayout(MarkingBehavior = MarkContainingBlockChain);
     void clearNeedsLayout();
     void setPreferredLogicalWidthsDirty(bool, MarkingBehavior = MarkContainingBlockChain);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to