Title: [263007] trunk
Revision
263007
Author
[email protected]
Date
2020-06-13 17:39:13 -0700 (Sat, 13 Jun 2020)

Log Message

[LFC][Floats] Floating positioned box is always a float avoider.
https://bugs.webkit.org/show_bug.cgi?id=213162

Reviewed by Darin Adler.

Source/WebCore:

Test: fast/layoutformattingcontext/inline-float-simple.html

* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isFloatAvoider const): also fix the independent formatting context case.

LayoutTests:

* fast/layoutformattingcontext/inline-float-simple-expected.html: Added.
* fast/layoutformattingcontext/inline-float-simple.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (263006 => 263007)


--- trunk/LayoutTests/ChangeLog	2020-06-13 20:40:10 UTC (rev 263006)
+++ trunk/LayoutTests/ChangeLog	2020-06-14 00:39:13 UTC (rev 263007)
@@ -1,3 +1,13 @@
+2020-06-13  Zalan Bujtas  <[email protected]>
+
+        [LFC][Floats] Floating positioned box is always a float avoider.
+        https://bugs.webkit.org/show_bug.cgi?id=213162
+
+        Reviewed by Darin Adler.
+
+        * fast/layoutformattingcontext/inline-float-simple-expected.html: Added.
+        * fast/layoutformattingcontext/inline-float-simple.html: Added.
+
 2020-06-13  Sam Weinig  <[email protected]>
 
         [WPT] dom/nodes/Document-createCDATASection-xhtml.xhtml fails due to missing exception in Document.createCDATASection()

Added: trunk/LayoutTests/fast/layoutformattingcontext/inline-float-simple-expected.html (0 => 263007)


--- trunk/LayoutTests/fast/layoutformattingcontext/inline-float-simple-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/layoutformattingcontext/inline-float-simple-expected.html	2020-06-14 00:39:13 UTC (rev 263007)
@@ -0,0 +1,10 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:LayoutFormattingContextEnabled=true internal:LayoutFormattingContextIntegrationEnabled=false ] -->
+<style>
+  div {
+    float: right;
+    width : 420px;
+    height: 20px; 
+    border: 1px solid green;
+  }
+</style>
+<div></div>

Added: trunk/LayoutTests/fast/layoutformattingcontext/inline-float-simple.html (0 => 263007)


--- trunk/LayoutTests/fast/layoutformattingcontext/inline-float-simple.html	                        (rev 0)
+++ trunk/LayoutTests/fast/layoutformattingcontext/inline-float-simple.html	2020-06-14 00:39:13 UTC (rev 263007)
@@ -0,0 +1,11 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:LayoutFormattingContextEnabled=true internal:LayoutFormattingContextIntegrationEnabled=false ] -->
+<style>
+  div {
+    float: right;
+    font-family: Ahem;
+    font-size: 20px;
+    color: white;
+    border: 1px solid green;
+  }
+</style>
+<div>floating text content</div>

Modified: trunk/Source/WebCore/ChangeLog (263006 => 263007)


--- trunk/Source/WebCore/ChangeLog	2020-06-13 20:40:10 UTC (rev 263006)
+++ trunk/Source/WebCore/ChangeLog	2020-06-14 00:39:13 UTC (rev 263007)
@@ -1,3 +1,15 @@
+2020-06-13  Zalan Bujtas  <[email protected]>
+
+        [LFC][Floats] Floating positioned box is always a float avoider.
+        https://bugs.webkit.org/show_bug.cgi?id=213162
+
+        Reviewed by Darin Adler.
+
+        Test: fast/layoutformattingcontext/inline-float-simple.html
+
+        * layout/layouttree/LayoutBox.cpp:
+        (WebCore::Layout::Box::isFloatAvoider const): also fix the independent formatting context case.
+
 2020-06-13  Sam Weinig  <[email protected]>
 
         [WPT] dom/nodes/Document-createCDATASection-xhtml.xhtml fails due to missing exception in Document.createCDATASection()

Modified: trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp (263006 => 263007)


--- trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp	2020-06-13 20:40:10 UTC (rev 263006)
+++ trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp	2020-06-14 00:39:13 UTC (rev 263007)
@@ -174,9 +174,10 @@
 
 bool Box::isFloatAvoider() const
 {
-    if (establishesIndependentFormattingContext())
-        return false;
-    return (establishesBlockFormattingContext() && !establishesInlineFormattingContext()) || establishesTableFormattingContext() || hasFloatClear();
+    if (isFloatingPositioned() || hasFloatClear())
+        return true;
+
+    return establishesTableFormattingContext() || establishesIndependentFormattingContext() || (establishesBlockFormattingContext() && !establishesInlineFormattingContext());
 }
 
 const ContainerBox& Box::containingBlock() const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to