[LFC] Out-of-flow box is never a float box
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Feb 2019 18:04:48 +0000 (18:04 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Feb 2019 18:04:48 +0000 (18:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194704

Reviewed by Antti Koivisto.

Source/WebCore:

We can't have it both ways. Absolute positioning wins.

Test: fast/block/block-only/out-of-flow-is-never-float-box.html

* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isFloatingPositioned const):
(WebCore::Layout::Box::isLeftFloatingPositioned const):
(WebCore::Layout::Box::isRightFloatingPositioned const):

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

LayoutTests:

* fast/block/block-only/out-of-flow-is-never-float-box-expected.html: Added.
* fast/block/block-only/out-of-flow-is-never-float-box.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/block/block-only/out-of-flow-is-never-float-box-expected.html [new file with mode: 0644]
LayoutTests/fast/block/block-only/out-of-flow-is-never-float-box.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/layout/layouttree/LayoutBox.cpp
Tools/ChangeLog
Tools/LayoutReloaded/misc/LFC-passing-tests.txt

index 1af7989..616dc8f 100644 (file)
@@ -1,3 +1,13 @@
+2019-02-15  Zalan Bujtas  <zalan@apple.com>
+
+        [LFC] Out-of-flow box is never a float box
+        https://bugs.webkit.org/show_bug.cgi?id=194704
+
+        Reviewed by Antti Koivisto.
+
+        * fast/block/block-only/out-of-flow-is-never-float-box-expected.html: Added.
+        * fast/block/block-only/out-of-flow-is-never-float-box.html: Added.
+
 2019-02-14  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r241497.
diff --git a/LayoutTests/fast/block/block-only/out-of-flow-is-never-float-box-expected.html b/LayoutTests/fast/block/block-only/out-of-flow-is-never-float-box-expected.html
new file mode 100644 (file)
index 0000000..b527fa7
--- /dev/null
@@ -0,0 +1,8 @@
+<style>
+div {
+    width: 100px;
+    height: 100px;
+    background-color: green;
+}
+</style>
+<div></div>
\ No newline at end of file
diff --git a/LayoutTests/fast/block/block-only/out-of-flow-is-never-float-box.html b/LayoutTests/fast/block/block-only/out-of-flow-is-never-float-box.html
new file mode 100644 (file)
index 0000000..3123f22
--- /dev/null
@@ -0,0 +1,10 @@
+<style>
+div {
+    float: left;
+    position: absolute;
+    width: 100px;
+    height: 100px;
+    background-color: green;
+}
+</style>
+<div></div><div><div>
\ No newline at end of file
index 576e704..07fc22a 100644 (file)
@@ -1,3 +1,19 @@
+2019-02-15  Zalan Bujtas  <zalan@apple.com>
+
+        [LFC] Out-of-flow box is never a float box
+        https://bugs.webkit.org/show_bug.cgi?id=194704
+
+        Reviewed by Antti Koivisto.
+
+        We can't have it both ways. Absolute positioning wins.
+
+        Test: fast/block/block-only/out-of-flow-is-never-float-box.html
+
+        * layout/layouttree/LayoutBox.cpp:
+        (WebCore::Layout::Box::isFloatingPositioned const):
+        (WebCore::Layout::Box::isLeftFloatingPositioned const):
+        (WebCore::Layout::Box::isRightFloatingPositioned const):
+
 2019-02-15  Philippe Normand  <pnormand@igalia.com>
 
         [GStreamer] Simplify GObject class name check
index f5872a0..15a11d9 100644 (file)
@@ -109,16 +109,23 @@ bool Box::isFixedPositioned() const
 
 bool Box::isFloatingPositioned() const
 {
+    // FIXME: Rendering code caches values like this. (style="position: absolute; float: left")
+    if (isOutOfFlowPositioned())
+        return false;
     return m_style.floating() != Float::No;
 }
 
 bool Box::isLeftFloatingPositioned() const
 {
+    if (!isFloatingPositioned())
+        return false;
     return m_style.floating() == Float::Left;
 }
 
 bool Box::isRightFloatingPositioned() const
 {
+    if (!isFloatingPositioned())
+        return false;
     return m_style.floating() == Float::Right;
 }
 
index 66115ab..ffe05ff 100644 (file)
@@ -1,3 +1,12 @@
+2019-02-15  Zalan Bujtas  <zalan@apple.com>
+
+        [LFC] Out-of-flow box is never a float box
+        https://bugs.webkit.org/show_bug.cgi?id=194704
+
+        Reviewed by Antti Koivisto.
+
+        * LayoutReloaded/misc/LFC-passing-tests.txt:
+
 2019-02-10  Darin Adler  <darin@apple.com>
 
         Replace more uses of String::format with StringConcatenate (mostly non-Apple platform-specific cases)
index 996dd33..d2ef4fe 100644 (file)
@@ -102,6 +102,7 @@ fast/block/block-only/negative-margin-simple.html
 fast/block/block-only/non-auto-top-bottom-height-with-auto-margins.html
 fast/block/block-only/non-auto-top-bottom-height-with-margins.html
 fast/block/block-only/non-auto-top-bottom-left-right-widht-height-out-of-flow.html
+fast/block/block-only/out-of-flow-is-never-float-box.html
 fast/block/block-only/out-of-flow-with-containing-block-border-padding.html
 fast/block/block-only/padding-nested.html
 fast/block/block-only/padding-simple.html