Title: [284107] trunk/Source/WebCore
Revision
284107
Author
[email protected]
Date
2021-10-13 10:56:59 -0700 (Wed, 13 Oct 2021)

Log Message

[LFC][Integration] Add concept of integration root and stop using InitialContainingBlock
https://bugs.webkit.org/show_bug.cgi?id=231662

Reviewed by Alan Bujtas.

Stop using InitialContainingBlock in integration as it makes no logical sense.

(WebCore::LayoutIntegration::BoxTree::BoxTree):

Set the IntegrationBlockContainer flag.

(WebCore::LayoutIntegration::BoxTree::updateStyle):
(WebCore::LayoutIntegration::rootBoxStyle): Deleted.
* layout/integration/LayoutIntegrationBoxTree.h:
(WebCore::LayoutIntegration::BoxTree::rootLayoutBox const):
(WebCore::LayoutIntegration::BoxTree::rootLayoutBox):
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::establishesBlockFormattingContext const):

An integration block container without a parent establishes a block formatting context.

(WebCore::Layout::Box::isBlockContainer const):
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::setIsIntegrationBlockContainer):

Add a flag.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (284106 => 284107)


--- trunk/Source/WebCore/ChangeLog	2021-10-13 17:55:52 UTC (rev 284106)
+++ trunk/Source/WebCore/ChangeLog	2021-10-13 17:56:59 UTC (rev 284107)
@@ -1,3 +1,32 @@
+2021-10-13  Antti Koivisto  <[email protected]>
+
+        [LFC][Integration] Add concept of integration root and stop using InitialContainingBlock
+        https://bugs.webkit.org/show_bug.cgi?id=231662
+
+        Reviewed by Alan Bujtas.
+
+        Stop using InitialContainingBlock in integration as it makes no logical sense.
+
+        (WebCore::LayoutIntegration::BoxTree::BoxTree):
+
+        Set the IntegrationBlockContainer flag.
+
+        (WebCore::LayoutIntegration::BoxTree::updateStyle):
+        (WebCore::LayoutIntegration::rootBoxStyle): Deleted.
+        * layout/integration/LayoutIntegrationBoxTree.h:
+        (WebCore::LayoutIntegration::BoxTree::rootLayoutBox const):
+        (WebCore::LayoutIntegration::BoxTree::rootLayoutBox):
+        * layout/layouttree/LayoutBox.cpp:
+        (WebCore::Layout::Box::establishesBlockFormattingContext const):
+
+        An integration block container without a parent establishes a block formatting context.
+
+        (WebCore::Layout::Box::isBlockContainer const):
+        * layout/layouttree/LayoutBox.h:
+        (WebCore::Layout::Box::setIsIntegrationBlockContainer):
+
+        Add a flag.
+
 2021-10-13  Chris Dumez  <[email protected]>
 
         MessagePort messages sent in iframe unload event not received

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp (284106 => 284107)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp	2021-10-13 17:55:52 UTC (rev 284106)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp	2021-10-13 17:56:59 UTC (rev 284107)
@@ -71,8 +71,10 @@
 
 BoxTree::BoxTree(RenderBlockFlow& flow)
     : m_flow(flow)
-    , m_root(rootBoxStyle(flow.style()), rootBoxFirstLineStyle(flow))
+    , m_root(Layout::Box::ElementAttributes { }, rootBoxStyle(flow.style()), rootBoxFirstLineStyle(flow))
 {
+    m_root.setIsIntegrationBlockContainer();
+
     if (flow.isAnonymous())
         m_root.setIsAnonymous();
 

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.h (284106 => 284107)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.h	2021-10-13 17:55:52 UTC (rev 284106)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.h	2021-10-13 17:56:59 UTC (rev 284107)
@@ -48,8 +48,8 @@
     const RenderBlockFlow& flow() const { return m_flow; }
     RenderBlockFlow& flow() { return m_flow; }
 
-    const Layout::InitialContainingBlock& rootLayoutBox() const { return m_root; }
-    Layout::InitialContainingBlock& rootLayoutBox() { return m_root; }
+    const Layout::ContainerBox& rootLayoutBox() const { return m_root; }
+    Layout::ContainerBox& rootLayoutBox() { return m_root; }
 
     const Layout::Box& layoutBoxForRenderer(const RenderObject&) const;
     Layout::Box& layoutBoxForRenderer(const RenderObject&);
@@ -70,7 +70,7 @@
     void appendChild(UniqueRef<Layout::Box>, RenderObject&);
 
     RenderBlockFlow& m_flow;
-    Layout::InitialContainingBlock m_root;
+    Layout::ContainerBox m_root;
     Vector<BoxAndRenderer, 1> m_boxes;
 
     HashMap<const RenderObject*, CheckedRef<Layout::Box>> m_rendererToBoxMap;

Modified: trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp (284106 => 284107)


--- trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp	2021-10-13 17:55:52 UTC (rev 284106)
+++ trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp	2021-10-13 17:56:59 UTC (rev 284107)
@@ -48,6 +48,7 @@
     , m_baseTypeFlags(baseTypeFlags.toRaw())
     , m_hasRareData(false)
     , m_isAnonymous(false)
+    , m_isIntegrationBlockContainer(false)
 {
     if (firstLineStyle)
         ensureRareData().firstLineStyle = WTFMove(firstLineStyle);
@@ -94,6 +95,9 @@
 
 bool Box::establishesBlockFormattingContext() const
 {
+    if (isIntegrationRoot())
+        return true;
+
     // ICB always creates a new (inital) block formatting context.
     if (is<InitialContainingBlock>(*this))
         return true;

Modified: trunk/Source/WebCore/layout/layouttree/LayoutBox.h (284106 => 284107)


--- trunk/Source/WebCore/layout/layouttree/LayoutBox.h	2021-10-13 17:55:52 UTC (rev 284106)
+++ trunk/Source/WebCore/layout/layouttree/LayoutBox.h	2021-10-13 17:56:59 UTC (rev 284107)
@@ -138,6 +138,8 @@
     bool isIFrame() const { return m_elementAttributes && m_elementAttributes.value().elementType == ElementType::IFrame; }
     bool isImage() const { return m_elementAttributes && m_elementAttributes.value().elementType == ElementType::Image; }
     bool isInternalRubyBox() const { return false; }
+    bool isIntegrationBlockContainer() const { return m_isIntegrationBlockContainer; }
+    bool isIntegrationRoot() const { return isIntegrationBlockContainer() && !m_parent; }
 
     const ContainerBox& parent() const { return *m_parent; }
     const Box* nextSibling() const { return m_nextSibling.get(); }
@@ -174,6 +176,7 @@
     std::optional<LayoutUnit> columnWidth() const;
 
     void setIsAnonymous() { m_isAnonymous = true; }
+    void setIsIntegrationBlockContainer() { m_isIntegrationBlockContainer = true; }
 
     bool canCacheForLayoutState(const LayoutState&) const;
     BoxGeometry* cachedGeometryForLayoutState(const LayoutState&) const;
@@ -225,6 +228,7 @@
     unsigned m_baseTypeFlags : 6; // OptionSet<BaseTypeFlag>
     bool m_hasRareData : 1;
     bool m_isAnonymous : 1;
+    bool m_isIntegrationBlockContainer : 1;
 };
 
 inline bool Box::isContainingBlockForInFlow() const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to