Title: [223821] trunk/Source/WebCore
Revision
223821
Author
[email protected]
Date
2017-10-21 19:05:17 -0700 (Sat, 21 Oct 2017)

Log Message

[FrameView::layout cleanup] Drop allowSubtree parameter
https://bugs.webkit.org/show_bug.cgi?id=178623
<rdar://problem/35111012>

Reviewed by Sam Weinig.

This flag is only set through ::forceLayout(). Let's just convert the subtree layout
to full layout right before calling ::layout().

No change in functionality.

* page/FrameView.cpp:
(WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded):
(WebCore::FrameView::layout):
(WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded):
(WebCore::FrameView::forceLayout):
* page/FrameView.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (223820 => 223821)


--- trunk/Source/WebCore/ChangeLog	2017-10-21 22:23:00 UTC (rev 223820)
+++ trunk/Source/WebCore/ChangeLog	2017-10-22 02:05:17 UTC (rev 223821)
@@ -1,3 +1,23 @@
+2017-10-21  Zalan Bujtas  <[email protected]>
+
+        [FrameView::layout cleanup] Drop allowSubtree parameter
+        https://bugs.webkit.org/show_bug.cgi?id=178623
+        <rdar://problem/35111012>
+
+        Reviewed by Sam Weinig.
+
+        This flag is only set through ::forceLayout(). Let's just convert the subtree layout
+        to full layout right before calling ::layout().
+
+        No change in functionality.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded):
+        (WebCore::FrameView::layout):
+        (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded):
+        (WebCore::FrameView::forceLayout):
+        * page/FrameView.h:
+
 2017-10-21  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: Remove unused Console.setMonitoringXHREnabled

Modified: trunk/Source/WebCore/page/FrameView.cpp (223820 => 223821)


--- trunk/Source/WebCore/page/FrameView.cpp	2017-10-21 22:23:00 UTC (rev 223820)
+++ trunk/Source/WebCore/page/FrameView.cpp	2017-10-22 02:05:17 UTC (rev 223821)
@@ -1314,7 +1314,7 @@
 }
 #endif
 
-bool FrameView::handleLayoutWithFrameFlatteningIfNeeded(bool allowSubtreeLayout)
+bool FrameView::handleLayoutWithFrameFlatteningIfNeeded()
 {
     if (!isInChildFrameWithFrameFlattening())
         return false;
@@ -1323,7 +1323,7 @@
         LOG_WITH_STREAM(MediaQueries, stream << "FrameView " << this << " snapshotting size " <<  ScrollView::layoutSize() << " for media queries");
         m_frameFlatteningViewSizeForMediaQuery = ScrollView::layoutSize();
     }
-    startLayoutAtMainFrameViewIfNeeded(allowSubtreeLayout);
+    startLayoutAtMainFrameViewIfNeeded();
     auto* layoutRoot = m_subtreeLayoutRoot ? m_subtreeLayoutRoot : frame().document()->renderView();
     return !layoutRoot || !layoutRoot->needsLayout();
 }
@@ -1399,7 +1399,7 @@
     return true;
 }
 
-void FrameView::layout(bool allowSubtreeLayout)
+void FrameView::layout()
 {
     RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(!frame().document()->inRenderTreeUpdate());
     ASSERT(!isPainting());
@@ -1425,14 +1425,12 @@
     m_layoutTimer.stop();
     m_delayedLayout = false;
     m_setNeedsLayoutWasDeferred = false;
-    if (!allowSubtreeLayout && m_subtreeLayoutRoot)
+#if PLATFORM(IOS)
+    if (updateFixedPositionLayoutRect() && subtreeLayoutRoot())
         convertSubtreeLayoutToFullLayout();
-#if PLATFORM(IOS)
-    if (updateFixedPositionLayoutRect())
-        allowSubtreeLayout = false;
 #endif
 
-    if (handleLayoutWithFrameFlatteningIfNeeded(allowSubtreeLayout))
+    if (handleLayoutWithFrameFlatteningIfNeeded())
         return;
 
     Document& document = *frame().document();
@@ -1484,7 +1482,6 @@
             m_firstLayout = false;
         }
 
-        ASSERT(allowSubtreeLayout || !isSubtreeLayout);
         ASSERT(m_layoutPhase == InPreLayout);
         forceLayoutParentViewIfNeeded();
     }
@@ -4285,7 +4282,7 @@
     return false;
 }
 
-void FrameView::startLayoutAtMainFrameViewIfNeeded(bool allowSubtreeLayout)
+void FrameView::startLayoutAtMainFrameViewIfNeeded()
 {
     // When we start a layout at the child level as opposed to the topmost frame view and this child
     // frame requires flattening, we need to re-initiate the layout at the topmost view. Layout
@@ -4306,7 +4303,7 @@
         parentView = parentView->parentFrameView();
 
     LOG(Layout, "  frame flattening, starting from root");
-    parentView->layout(allowSubtreeLayout);
+    parentView->layout();
 }
 
 void FrameView::updateControlTints()
@@ -4705,9 +4702,11 @@
     setScrollbarModes(ScrollbarAuto, ScrollbarAuto);
 }
 
-void FrameView::forceLayout(bool allowSubtree)
+void FrameView::forceLayout(bool allowSubtreeLayout)
 {
-    layout(allowSubtree);
+    if (!allowSubtreeLayout && subtreeLayoutRoot())
+        convertSubtreeLayoutToFullLayout();
+    layout();
 }
 
 void FrameView::forceLayoutForPagination(const FloatSize& pageSize, const FloatSize& originalPageSize, float maximumShrinkFactor, AdjustViewSizeOrNot shouldAdjustViewSize)

Modified: trunk/Source/WebCore/page/FrameView.h (223820 => 223821)


--- trunk/Source/WebCore/page/FrameView.h	2017-10-21 22:23:00 UTC (rev 223820)
+++ trunk/Source/WebCore/page/FrameView.h	2017-10-22 02:05:17 UTC (rev 223821)
@@ -104,7 +104,7 @@
     void setContentsSize(const IntSize&) final;
     void updateContentsSize() final;
 
-    void layout(bool allowSubtree = true);
+    void layout();
     WEBCORE_EXPORT bool didFirstLayout() const;
     void layoutTimerFired();
     void scheduleRelayout();
@@ -402,7 +402,7 @@
     WEBCORE_EXPORT void setAutoSizeFixedMinimumHeight(int);
     IntSize autoSizingIntrinsicContentSize() const { return m_autoSizeContentSize; }
 
-    WEBCORE_EXPORT void forceLayout(bool allowSubtree = false);
+    WEBCORE_EXPORT void forceLayout(bool allowSubtreeLayout = false);
     WEBCORE_EXPORT void forceLayoutForPagination(const FloatSize& pageSize, const FloatSize& originalPageSize, float maximumShrinkFactor, AdjustViewSizeOrNot);
 
     // FIXME: This method is retained because of embedded WebViews in AppKit.  When a WebView is embedded inside
@@ -762,8 +762,8 @@
 
     FrameView* parentFrameView() const;
 
-    bool handleLayoutWithFrameFlatteningIfNeeded(bool allowSubtreeLayout);
-    void startLayoutAtMainFrameViewIfNeeded(bool allowSubtreeLayout);
+    bool handleLayoutWithFrameFlatteningIfNeeded();
+    void startLayoutAtMainFrameViewIfNeeded();
     bool frameFlatteningEnabled() const;
     bool isFrameFlatteningValidForThisFrame() const;
     
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to