[LFC] Update the block box/container list
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Feb 2021 12:05:12 +0000 (12:05 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Feb 2021 12:05:12 +0000 (12:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=221800
<rdar://problem/74178203>

Reviewed by Antti Koivisto.

Add DisplayType::FlowRoot to isBlockContainer/isBlockLevelBox and DisplayType::Grid to isBlockLevelBox.

* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isBlockLevelBox const):
(WebCore::Layout::Box::isBlockContainer const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272781 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/layout/layouttree/LayoutBox.cpp

index d963d17c4cfb8b4f37456a37fea1b01140ee12e4..c4e5f7bfcdc07925d2f2dd07e2e8342446e26982 100644 (file)
@@ -1,3 +1,17 @@
+2021-02-12  Zalan Bujtas  <zalan@apple.com>
+
+        [LFC] Update the block box/container list
+        https://bugs.webkit.org/show_bug.cgi?id=221800
+        <rdar://problem/74178203>
+
+        Reviewed by Antti Koivisto.
+
+        Add DisplayType::FlowRoot to isBlockContainer/isBlockLevelBox and DisplayType::Grid to isBlockLevelBox. 
+
+        * layout/layouttree/LayoutBox.cpp:
+        (WebCore::Layout::Box::isBlockLevelBox const):
+        (WebCore::Layout::Box::isBlockContainer const):
+
 2021-02-12  Zalan Bujtas  <zalan@apple.com>
 
         [LFC][IFC] LineLayout::enclosingBorderBoxRectFor reports content box size
index f0bf1ee9636e0d0541b50d3cdb50785b85581868..3064d3cf15243629a2405de5215aba781629cfef 100644 (file)
@@ -295,7 +295,12 @@ bool Box::isBlockLevelBox() const
 {
     // Block level elements generate block level boxes.
     auto display = m_style.display();
-    return display == DisplayType::Block || display == DisplayType::ListItem || display == DisplayType::Table || display == DisplayType::Flex;
+    return display == DisplayType::Block
+        || display == DisplayType::ListItem
+        || display == DisplayType::Table
+        || display == DisplayType::Flex
+        || display == DisplayType::Grid
+        || display == DisplayType::FlowRoot;
 }
 
 bool Box::isBlockBox() const
@@ -340,7 +345,12 @@ bool Box::isFlexItem() const
 bool Box::isBlockContainer() const
 {
     auto display = m_style.display();
-    return display == DisplayType::Block || display == DisplayType::ListItem || isInlineBlockBox() || isTableCell() || isTableCaption(); // TODO && !replaced element
+    return display == DisplayType::Block
+        || display == DisplayType::FlowRoot
+        || display == DisplayType::ListItem
+        || isInlineBlockBox()
+        || isTableCell()
+        || isTableCaption(); // TODO && !replaced element
 }
 
 const Box* Box::nextInFlowSibling() const