Title: [250769] trunk/Source/WebCore
Revision
250769
Author
za...@apple.com
Date
2019-10-06 06:58:25 -0700 (Sun, 06 Oct 2019)

Log Message

[LFC][Painting] Introduce Display::Painter
https://bugs.webkit.org/show_bug.cgi?id=202614
<rdar://problem/56010347>

Reviewed by Antti Koivisto.

Display::Painter is responsible for rendering the nodes in the display tree. Testing purposes/WK1 only at this point.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/LayoutContext.cpp:
(WebCore::Layout::initializeLayoutState):
(WebCore::Layout::LayoutContext::runLayout):
(WebCore::Layout::LayoutContext::runLayoutAndVerify):
(WebCore::Layout::LayoutContext::runLayoutAndPaint):
(WebCore::Layout::LayoutContext::run): Deleted.
* layout/LayoutContext.h:
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::LayoutState):
* layout/LayoutState.h:
(WebCore::Layout::LayoutState::root const):
* layout/Verification.cpp:
(WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree):
* layout/displaytree/DisplayPainter.cpp: Added.
(WebCore::Display::Painter::paint):
* layout/displaytree/DisplayPainter.h: Added.
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::printLayoutTreeForLiveDocuments):
* page/FrameView.cpp:
(WebCore::FrameView::paintContents):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (250768 => 250769)


--- trunk/Source/WebCore/ChangeLog	2019-10-06 09:57:42 UTC (rev 250768)
+++ trunk/Source/WebCore/ChangeLog	2019-10-06 13:58:25 UTC (rev 250769)
@@ -1,3 +1,38 @@
+2019-10-06  Zalan Bujtas  <za...@apple.com>
+
+        [LFC][Painting] Introduce Display::Painter
+        https://bugs.webkit.org/show_bug.cgi?id=202614
+        <rdar://problem/56010347>
+
+        Reviewed by Antti Koivisto.
+
+        Display::Painter is responsible for rendering the nodes in the display tree. Testing purposes/WK1 only at this point.
+
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * layout/LayoutContext.cpp:
+        (WebCore::Layout::initializeLayoutState):
+        (WebCore::Layout::LayoutContext::runLayout):
+        (WebCore::Layout::LayoutContext::runLayoutAndVerify):
+        (WebCore::Layout::LayoutContext::runLayoutAndPaint):
+        (WebCore::Layout::LayoutContext::run): Deleted.
+        * layout/LayoutContext.h:
+        * layout/LayoutState.cpp:
+        (WebCore::Layout::LayoutState::LayoutState):
+        * layout/LayoutState.h:
+        (WebCore::Layout::LayoutState::root const):
+        * layout/Verification.cpp:
+        (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree):
+        * layout/displaytree/DisplayPainter.cpp: Added.
+        (WebCore::Display::Painter::paint):
+        * layout/displaytree/DisplayPainter.h: Added.
+        * layout/layouttree/LayoutTreeBuilder.cpp:
+        (WebCore::Layout::printLayoutTreeForLiveDocuments):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::paintContents):
+        * page/FrameViewLayoutContext.cpp:
+        (WebCore::layoutUsingFormattingContext):
+
 2019-10-06  Antti Koivisto  <an...@apple.com>
 
         Node::ref/deref should be const

Modified: trunk/Source/WebCore/Sources.txt (250768 => 250769)


--- trunk/Source/WebCore/Sources.txt	2019-10-06 09:57:42 UTC (rev 250768)
+++ trunk/Source/WebCore/Sources.txt	2019-10-06 13:58:25 UTC (rev 250769)
@@ -1415,6 +1415,7 @@
 layout/blockformatting/BlockMarginCollapse.cpp
 layout/blockformatting/BlockInvalidation.cpp
 layout/displaytree/DisplayBox.cpp
+layout/displaytree/DisplayPainter.cpp
 layout/floats/FloatAvoider.cpp
 layout/floats/FloatBox.cpp
 layout/floats/FloatingContext.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (250768 => 250769)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2019-10-06 09:57:42 UTC (rev 250768)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2019-10-06 13:58:25 UTC (rev 250769)
@@ -2007,6 +2007,7 @@
 		6F26BB6C23343E6F002F2BEA /* LayoutContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F26BB6B23343E5B002F2BEA /* LayoutContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		6F26EB48234004A5006906E2 /* InlineLineLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F26EB46234004A5006906E2 /* InlineLineLayout.h */; };
 		6F3E1F622136142000A65A08 /* FloatBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F3E1F612136141700A65A08 /* FloatBox.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		6F77868823491AD8004D9636 /* DisplayPainter.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F77868723491AD7004D9636 /* DisplayPainter.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		6F7CA3C6208C2957002F29AB /* LayoutState.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F7CA3C4208C2956002F29AB /* LayoutState.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		6F7CA3CA208C2B2E002F29AB /* InlineFormattingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F7CA3C8208C2B2E002F29AB /* InlineFormattingContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		6F995A161A70756200A735F4 /* WebGLSync.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F995A141A70756200A735F4 /* WebGLSync.h */; };
@@ -9177,6 +9178,8 @@
 		6F4A5BD522F9F16B00A80F25 /* LayoutPhase.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutPhase.cpp; sourceTree = "<group>"; };
 		6F5B7EAA2300A79E0067D9C3 /* TableGrid.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TableGrid.cpp; sourceTree = "<group>"; };
 		6F73918C2106CEDD006AF262 /* LayoutUnits.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutUnits.h; sourceTree = "<group>"; };
+		6F77868523491AC6004D9636 /* DisplayPainter.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DisplayPainter.cpp; sourceTree = "<group>"; };
+		6F77868723491AD7004D9636 /* DisplayPainter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DisplayPainter.h; sourceTree = "<group>"; };
 		6F7CA3C4208C2956002F29AB /* LayoutState.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutState.h; sourceTree = "<group>"; };
 		6F7CA3C5208C2956002F29AB /* LayoutState.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutState.cpp; sourceTree = "<group>"; };
 		6F7CA3C8208C2B2E002F29AB /* InlineFormattingContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InlineFormattingContext.h; sourceTree = "<group>"; };
@@ -16513,6 +16516,8 @@
 			children = (
 				1199FA5A208E3C7F002358CC /* DisplayBox.cpp */,
 				1199FA59208E3C7F002358CC /* DisplayBox.h */,
+				6F77868523491AC6004D9636 /* DisplayPainter.cpp */,
+				6F77868723491AD7004D9636 /* DisplayPainter.h */,
 				6FD9CD52227E21C800E53957 /* DisplayRect.h */,
 				6FCE1A1822618AB3004F0343 /* DisplayRun.h */,
 			);
@@ -29113,6 +29118,7 @@
 				0FE5FBD51C3DD51E0007A2CA /* DisplayListItems.h in Headers */,
 				0FE5FBD71C3DD51E0007A2CA /* DisplayListRecorder.h in Headers */,
 				0FE5FBD91C3DD51E0007A2CA /* DisplayListReplayer.h in Headers */,
+				6F77868823491AD8004D9636 /* DisplayPainter.h in Headers */,
 				6FD9CD54227E21C800E53957 /* DisplayRect.h in Headers */,
 				49AF2D6914435D050016A784 /* DisplayRefreshMonitor.h in Headers */,
 				2D29ECC6192ECC8300984B78 /* DisplayRefreshMonitorClient.h in Headers */,

Modified: trunk/Source/WebCore/layout/LayoutContext.cpp (250768 => 250769)


--- trunk/Source/WebCore/layout/LayoutContext.cpp	2019-10-06 09:57:42 UTC (rev 250768)
+++ trunk/Source/WebCore/layout/LayoutContext.cpp	2019-10-06 13:58:25 UTC (rev 250769)
@@ -32,6 +32,7 @@
 #include "BlockFormattingState.h"
 #include "BlockInvalidation.h"
 #include "DisplayBox.h"
+#include "DisplayPainter.h"
 #include "InlineFormattingContext.h"
 #include "InlineFormattingState.h"
 #include "InlineInvalidation.h"
@@ -117,7 +118,7 @@
     CRASH();
 }
 
-void LayoutContext::run(const RenderView& renderView)
+static void initializeLayoutState(LayoutState& layoutState, const RenderView& renderView)
 {
     auto quirksMode = [&] {
         auto& document = renderView.document();
@@ -128,15 +129,24 @@
         return LayoutState::QuirksMode::No;
     };
 
-    auto initialContainingBlock = TreeBuilder::createLayoutTree(renderView);
-
-    auto layoutState = LayoutState { };
     layoutState.setQuirksMode(quirksMode());
-    layoutState.createFormattingStateForFormattingRootIfNeeded(*initialContainingBlock);
 
-    auto layoutContext = LayoutContext(layoutState);
+    auto& layoutRoot = layoutState.root();
+    layoutState.createFormattingStateForFormattingRootIfNeeded(layoutRoot);
+    // Not efficient, but this is temporary anyway.
+    // Collect the out-of-flow descendants at the formatting root level (as opposed to at the containing block level, though they might be the same).
+    for (auto& descendant : descendantsOfType<Box>(layoutRoot)) {
+        if (!descendant.isOutOfFlowPositioned())
+            continue;
+        auto& formattingState = layoutState.createFormattingStateForFormattingRootIfNeeded(descendant.formattingContextRoot());
+        formattingState.addOutOfFlowBox(descendant);
+    }
+}
 
-    auto& displayBox = layoutState.displayBoxForLayoutBox(*initialContainingBlock);
+void LayoutContext::runLayout(LayoutState& layoutState)
+{
+    auto& layoutRoot = layoutState.root();
+    auto& displayBox = layoutState.displayBoxForLayoutBox(layoutRoot);
     displayBox.setHorizontalMargin({ });
     displayBox.setHorizontalComputedMargin({ });
     displayBox.setVerticalMargin({ });
@@ -143,23 +153,33 @@
     displayBox.setBorder({ });
     displayBox.setPadding({ });
     displayBox.setTopLeft({ });
-    displayBox.setContentBoxHeight(LayoutUnit(initialContainingBlock->style().logicalHeight().value()));
-    displayBox.setContentBoxWidth(LayoutUnit(initialContainingBlock->style().logicalWidth().value()));
+    displayBox.setContentBoxHeight(LayoutUnit(layoutRoot.style().logicalHeight().value()));
+    displayBox.setContentBoxWidth(LayoutUnit(layoutRoot.style().logicalWidth().value()));
 
-    // Not efficient, but this is temporary anyway.
-    // Collect the out-of-flow descendants at the formatting root level (as opposed to at the containing block level, though they might be the same).
-    for (auto& descendant : descendantsOfType<Box>(*initialContainingBlock)) {
-        if (!descendant.isOutOfFlowPositioned())
-            continue;
-        auto& formattingState = layoutState.createFormattingStateForFormattingRootIfNeeded(descendant.formattingContextRoot());
-        formattingState.addOutOfFlowBox(descendant);
-    }
-    layoutContext.markNeedsUpdate(*initialContainingBlock);
+    auto layoutContext = LayoutContext(layoutState);
+    layoutContext.markNeedsUpdate(layoutRoot);
     layoutContext.layout();
-    LayoutContext::verifyAndOutputMismatchingLayoutTree(layoutState, renderView, *initialContainingBlock);
 }
 
+void LayoutContext::runLayoutAndVerify(const RenderView& renderView)
+{
+    auto initialContainingBlock = TreeBuilder::createLayoutTree(renderView);
+    auto layoutState = LayoutState { *initialContainingBlock };
+    initializeLayoutState(layoutState, renderView);
+    runLayout(layoutState);
+    LayoutContext::verifyAndOutputMismatchingLayoutTree(layoutState, renderView);
 }
+
+void LayoutContext::runLayoutAndPaint(const RenderView& renderView, GraphicsContext& context)
+{
+    auto initialContainingBlock = TreeBuilder::createLayoutTree(renderView);
+    auto layoutState = LayoutState { *initialContainingBlock };
+    initializeLayoutState(layoutState, renderView);
+    runLayout(layoutState);
+    Display::Painter::paint(layoutState, context);
 }
 
+}
+}
+
 #endif

Modified: trunk/Source/WebCore/layout/LayoutContext.h (250768 => 250769)


--- trunk/Source/WebCore/layout/LayoutContext.h	2019-10-06 09:57:42 UTC (rev 250768)
+++ trunk/Source/WebCore/layout/LayoutContext.h	2019-10-06 13:58:25 UTC (rev 250769)
@@ -52,8 +52,9 @@
 class LayoutContext {
     WTF_MAKE_ISO_ALLOCATED(LayoutContext);
 public:
-    // FIXME: This is a temporary entry point for LFC layout.
-    static void run(const RenderView&);
+    // FIXME: These are temporary entry points for LFC layout.
+    static void runLayoutAndVerify(const RenderView&);
+    static void runLayoutAndPaint(const RenderView&, GraphicsContext&);
 
     LayoutContext(LayoutState&);
     void layout();
@@ -71,13 +72,14 @@
 
     static std::unique_ptr<FormattingContext> createFormattingContext(const Container& formattingContextRoot, LayoutState&);
 
-    // For testing purposes only
-    static void verifyAndOutputMismatchingLayoutTree(const LayoutState&, const RenderView&, const Container& initialContainingBlock);
-
 private:
     void layoutFormattingContextSubtree(const Container&);
     LayoutState& layoutState() { return m_layoutState; }
 
+    // For testing purposes only
+    static void verifyAndOutputMismatchingLayoutTree(const LayoutState&, const RenderView&);
+    static void runLayout(LayoutState&);
+
     LayoutState& m_layoutState;
     WeakHashSet<const Container> m_formattingContextRootListForLayout;
 };

Modified: trunk/Source/WebCore/layout/LayoutState.cpp (250768 => 250769)


--- trunk/Source/WebCore/layout/LayoutState.cpp	2019-10-06 09:57:42 UTC (rev 250768)
+++ trunk/Source/WebCore/layout/LayoutState.cpp	2019-10-06 13:58:25 UTC (rev 250769)
@@ -38,6 +38,13 @@
 
 WTF_MAKE_ISO_ALLOCATED_IMPL(LayoutState);
 
+LayoutState::LayoutState(const Container& root)
+    : m_root(makeWeakPtr(root))
+{
+    // It makes absolutely no sense to construct a dedicated layout state for a non-formatting context root (it would be a no-op).
+    ASSERT(root.establishesFormattingContext());
+}
+
 Display::Box& LayoutState::displayBoxForLayoutBox(const Box& layoutBox) const
 {
     return *m_layoutToDisplayBox.ensure(&layoutBox, [&layoutBox] {

Modified: trunk/Source/WebCore/layout/LayoutState.h (250768 => 250769)


--- trunk/Source/WebCore/layout/LayoutState.h	2019-10-06 09:57:42 UTC (rev 250768)
+++ trunk/Source/WebCore/layout/LayoutState.h	2019-10-06 13:58:25 UTC (rev 250769)
@@ -30,6 +30,7 @@
 #include <wtf/HashMap.h>
 #include <wtf/HashSet.h>
 #include <wtf/IsoMalloc.h>
+#include <wtf/WeakPtr.h>
 
 namespace WebCore {
 
@@ -47,6 +48,7 @@
 class LayoutState {
     WTF_MAKE_ISO_ALLOCATED(LayoutState);
 public:
+    LayoutState(const Container& root);
 
     FormattingState& createFormattingStateForFormattingRootIfNeeded(const Container& formattingContextRoot);
     FormattingState& establishedFormattingState(const Container& formattingRoot) const;
@@ -67,7 +69,10 @@
     bool inLimitedQuirksMode() const { return m_quirksMode == QuirksMode::Limited; }
     bool inNoQuirksMode() const { return m_quirksMode == QuirksMode::No; }
 
+    const Container& root() const { return *m_root; }
+
 private:
+    WeakPtr<const Container> m_root;
     HashMap<const Container*, std::unique_ptr<FormattingState>> m_formattingStates;
 #ifndef NDEBUG
     HashSet<const FormattingContext*> m_formattingContextList;

Modified: trunk/Source/WebCore/layout/Verification.cpp (250768 => 250769)


--- trunk/Source/WebCore/layout/Verification.cpp	2019-10-06 09:57:42 UTC (rev 250768)
+++ trunk/Source/WebCore/layout/Verification.cpp	2019-10-06 13:58:25 UTC (rev 250769)
@@ -324,15 +324,16 @@
     return mismtachingGeometry;
 }
 
-void LayoutContext::verifyAndOutputMismatchingLayoutTree(const LayoutState& layoutState, const RenderView& renderView, const Container& initialContainingBlock)
+void LayoutContext::verifyAndOutputMismatchingLayoutTree(const LayoutState& layoutState, const RenderView& renderView)
 {
     TextStream stream;
-    auto mismatchingGeometry = verifyAndOutputSubtree(stream, layoutState, renderView, initialContainingBlock);
+    auto& layoutRoot = layoutState.root();
+    auto mismatchingGeometry = verifyAndOutputSubtree(stream, layoutState, renderView, layoutRoot);
     if (!mismatchingGeometry)
         return;
 #if ENABLE(TREE_DEBUGGING)
     showRenderTree(&renderView);
-    showLayoutTree(initialContainingBlock, &layoutState);
+    showLayoutTree(layoutRoot, &layoutState);
 #endif
     WTFLogAlways("%s", stream.release().utf8().data());
     ASSERT_NOT_REACHED();

Added: trunk/Source/WebCore/layout/displaytree/DisplayPainter.cpp (0 => 250769)


--- trunk/Source/WebCore/layout/displaytree/DisplayPainter.cpp	                        (rev 0)
+++ trunk/Source/WebCore/layout/displaytree/DisplayPainter.cpp	2019-10-06 13:58:25 UTC (rev 250769)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "DisplayPainter.h"
+
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+
+#include "GraphicsContext.h"
+#include "LayoutState.h"
+
+namespace WebCore {
+namespace Display {
+
+void Painter::paint(const Layout::LayoutState&, GraphicsContext&)
+{
+}
+
+}
+}
+
+#endif

Added: trunk/Source/WebCore/layout/displaytree/DisplayPainter.h (0 => 250769)


--- trunk/Source/WebCore/layout/displaytree/DisplayPainter.h	                        (rev 0)
+++ trunk/Source/WebCore/layout/displaytree/DisplayPainter.h	2019-10-06 13:58:25 UTC (rev 250769)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+
+namespace WebCore {
+
+class GraphicsContext;
+
+namespace Layout {
+class LayoutState;
+}
+
+namespace Display {
+
+class Painter {
+public:
+    static void paint(const Layout::LayoutState&, GraphicsContext&);
+};
+
+}
+}
+#endif

Modified: trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp (250768 => 250769)


--- trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp	2019-10-06 09:57:42 UTC (rev 250768)
+++ trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp	2019-10-06 13:58:25 UTC (rev 250769)
@@ -366,7 +366,7 @@
         // FIXME: Need to find a way to output geometry without layout context.
         auto& renderView = *document->renderView();
         auto initialContainingBlock = TreeBuilder::createLayoutTree(renderView);
-        auto layoutState = LayoutState { };
+        auto layoutState = LayoutState { *initialContainingBlock };
         layoutState.setQuirksMode(renderView.document().inLimitedQuirksMode() ? LayoutState::QuirksMode::Limited : (renderView.document().inQuirksMode() ? LayoutState::QuirksMode::Yes : LayoutState::QuirksMode::No));
         LayoutContext(layoutState).layout();
         showLayoutTree(*initialContainingBlock, &layoutState);

Modified: trunk/Source/WebCore/page/FrameView.cpp (250768 => 250769)


--- trunk/Source/WebCore/page/FrameView.cpp	2019-10-06 09:57:42 UTC (rev 250768)
+++ trunk/Source/WebCore/page/FrameView.cpp	2019-10-06 13:58:25 UTC (rev 250769)
@@ -128,6 +128,10 @@
 #include "LocalDefaultSystemAppearance.h"
 #endif
 
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+#include "LayoutContext.h"
+#endif
+
 #define RELEASE_LOG_IF_ALLOWED(fmt, ...) RELEASE_LOG_IF(frame().page() && frame().page()->isAlwaysOnLoggingAllowed(), Layout, "%p - FrameView::" fmt, this, ##__VA_ARGS__)
 
 namespace WebCore {
@@ -4127,6 +4131,13 @@
         return;
     }
 
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+    if (RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextEnabled()) {
+        Layout::LayoutContext::runLayoutAndPaint(*renderView, context);
+        return;
+    }
+#endif
+
     if (!layoutContext().inPaintableState())
         return;
 

Modified: trunk/Source/WebCore/page/FrameViewLayoutContext.cpp (250768 => 250769)


--- trunk/Source/WebCore/page/FrameViewLayoutContext.cpp	2019-10-06 09:57:42 UTC (rev 250768)
+++ trunk/Source/WebCore/page/FrameViewLayoutContext.cpp	2019-10-06 13:58:25 UTC (rev 250769)
@@ -54,7 +54,7 @@
 {
     if (!RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextEnabled())
         return;
-    Layout::LayoutContext::run(renderView);
+    Layout::LayoutContext::runLayoutAndVerify(renderView);
 } 
 #endif
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to