Title: [257970] trunk/Source/WebCore
Revision
257970
Author
za...@apple.com
Date
2020-03-05 22:32:40 -0800 (Thu, 05 Mar 2020)

Log Message

[LFC][TFC] An absolute positioned <table> should establish a table formatting context
https://bugs.webkit.org/show_bug.cgi?id=208695
<rdar://problem/60122473>

Reviewed by Antti Koivisto.

Not all type of content gets blockified when out-of-flow positioned or floated.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (257969 => 257970)


--- trunk/Source/WebCore/ChangeLog	2020-03-06 06:16:48 UTC (rev 257969)
+++ trunk/Source/WebCore/ChangeLog	2020-03-06 06:32:40 UTC (rev 257970)
@@ -1,3 +1,16 @@
+2020-03-05  Zalan Bujtas  <za...@apple.com>
+
+        [LFC][TFC] An absolute positioned <table> should establish a table formatting context
+        https://bugs.webkit.org/show_bug.cgi?id=208695
+        <rdar://problem/60122473>
+
+        Reviewed by Antti Koivisto.
+
+        Not all type of content gets blockified when out-of-flow positioned or floated.
+
+        * layout/layouttree/LayoutBox.cpp:
+        (WebCore::Layout::Box::establishesBlockFormattingContext const):
+
 2020-02-29  Darin Adler  <da...@apple.com>
 
         Simplify gradient parsing

Modified: trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp (257969 => 257970)


--- trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp	2020-03-06 06:16:48 UTC (rev 257969)
+++ trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp	2020-03-06 06:32:40 UTC (rev 257970)
@@ -73,12 +73,18 @@
     if (!parent())
         return true;
 
+    if (isTableWrapperBox())
+        return true;
+
     // 9.4.1 Block formatting contexts
     // Floats, absolutely positioned elements, block containers (such as inline-blocks, table-cells, and table-captions)
     // that are not block boxes, and block boxes with 'overflow' other than 'visible' (except when that value has been propagated to the viewport)
     // establish new block formatting contexts for their contents.
-    if (isFloatingPositioned() || isAbsolutelyPositioned())
-        return true;
+    if (isFloatingPositioned() || isAbsolutelyPositioned()) {
+        // Not all floating or out-of-positioned block level boxes establish BFC.
+        // See [9.7 Relationships between 'display', 'position', and 'float'] for details.
+        return style().display() == DisplayType::Block;
+    }
 
     if (isBlockContainerBox() && !isBlockLevelBox())
         return true;
@@ -86,9 +92,6 @@
     if (isBlockLevelBox() && !isOverflowVisible())
         return true;
 
-    if (isTableWrapperBox())
-        return true;
-
     return false;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to