[LFC][Out-of-flow] Use the containing block's padding width when computing min/max...
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Feb 2019 16:45:38 +0000 (16:45 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Feb 2019 16:45:38 +0000 (16:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194391

Reviewed by Antti Koivisto.

Source/WebCore:

The spec is not clear about this but that's what matches the current behaviour.

Test: fast/block/block-only/absolute-positioned-min-max-percentage-with-parent-padding.html

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):

Tools:

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

LayoutTests:

* fast/block/block-only/absolute-positioned-min-max-percentage-with-parent-padding-expected.html: Added.
* fast/block/block-only/absolute-positioned-min-max-percentage-with-parent-padding.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/block/block-only/absolute-positioned-min-max-percentage-with-parent-padding-expected.html [new file with mode: 0644]
LayoutTests/fast/block/block-only/absolute-positioned-min-max-percentage-with-parent-padding.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/layout/FormattingContext.cpp
Tools/ChangeLog
Tools/LayoutReloaded/misc/LFC-passing-tests.txt

index 3ce0bfd..92df95a 100644 (file)
@@ -1,3 +1,13 @@
+2019-02-07  Zalan Bujtas  <zalan@apple.com>
+
+        [LFC][Out-of-flow] Use the containing block's padding width when computing min/max width.
+        https://bugs.webkit.org/show_bug.cgi?id=194391
+
+        Reviewed by Antti Koivisto.
+
+        * fast/block/block-only/absolute-positioned-min-max-percentage-with-parent-padding-expected.html: Added.
+        * fast/block/block-only/absolute-positioned-min-max-percentage-with-parent-padding.html: Added.
+
 2019-02-07  Miguel Gomez  <magomez@igalia.com>
 
         Unreviewed GTK+ gardening after r241117.
diff --git a/LayoutTests/fast/block/block-only/absolute-positioned-min-max-percentage-with-parent-padding-expected.html b/LayoutTests/fast/block/block-only/absolute-positioned-min-max-percentage-with-parent-padding-expected.html
new file mode 100644 (file)
index 0000000..dd4f685
--- /dev/null
@@ -0,0 +1,17 @@
+<style>
+.container {
+    height: 120px;
+    width: 120px;
+    position: relative;
+    background-color: green;
+}
+
+div div {
+       background: blue;
+    height: 10px;
+}
+</style>
+<div class=container>
+    <div style="width: 12px;"></div>
+    <div style="width: 120px;"></div>
+</div>
diff --git a/LayoutTests/fast/block/block-only/absolute-positioned-min-max-percentage-with-parent-padding.html b/LayoutTests/fast/block/block-only/absolute-positioned-min-max-percentage-with-parent-padding.html
new file mode 100644 (file)
index 0000000..c1d934c
--- /dev/null
@@ -0,0 +1,21 @@
+<style>
+.container {
+       padding: 10px;
+    height: 100px;
+    width: 100px;
+    position: relative;
+    background-color: green;
+}
+
+div div {
+       background: blue;
+    position: absolute;
+    top: 0px;
+    left: 0px;
+    height: 10px;
+}
+</style>
+<div class=container>
+    <div style="max-width: 10%; width: 100%;"></div>
+    <div style="top: 10px; min-width: 100%; width: 10%;"></div>
+</div>
index d178e1d..c2a1672 100644 (file)
@@ -1,5 +1,19 @@
 2019-02-07  Zalan Bujtas  <zalan@apple.com>
 
+        [LFC][Out-of-flow] Use the containing block's padding width when computing min/max width.
+        https://bugs.webkit.org/show_bug.cgi?id=194391
+
+        Reviewed by Antti Koivisto.
+
+        The spec is not clear about this but that's what matches the current behaviour.
+
+        Test: fast/block/block-only/absolute-positioned-min-max-percentage-with-parent-padding.html
+
+        * layout/FormattingContext.cpp:
+        (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
+
+2019-02-07  Zalan Bujtas  <zalan@apple.com>
+
         [LFC] Use dedicated data structures for optional used values (input to geometry functions)
         https://bugs.webkit.org/show_bug.cgi?id=194376
 
index 82a799a..dc18697 100644 (file)
@@ -73,7 +73,7 @@ void FormattingContext::computeOutOfFlowHorizontalGeometry(const Box& layoutBox)
     };
 
     auto horizontalGeometry = compute({ });
-    auto containingBlockWidth = layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth();
+    auto containingBlockWidth = layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).paddingBoxWidth();
 
     if (auto maxWidth = Geometry::computedValueIfNotAuto(layoutBox.style().logicalMaxWidth(), containingBlockWidth)) {
         auto maxHorizontalGeometry = compute({ *maxWidth, { } });
index 11351c4..91d324d 100644 (file)
@@ -1,3 +1,12 @@
+2019-02-07  Zalan Bujtas  <zalan@apple.com>
+
+        [LFC][Out-of-flow] Use the containing block's padding width when computing min/max width.
+        https://bugs.webkit.org/show_bug.cgi?id=194391
+
+        Reviewed by Antti Koivisto.
+
+        * LayoutReloaded/misc/LFC-passing-tests.txt:
+
 2019-02-06  Keith Rollin  <krollin@apple.com>
 
         Remove Info.plist from MobileMiniBrowser.framework's Copy Bundle Resources phase
index 71a47a6..ee63e0b 100644 (file)
@@ -96,6 +96,7 @@ fast/block/block-only/relative-position-when-containing-block-is-not-in-the-form
 fast/block/block-only/relative-right.html
 fast/block/block-only/relative-siblings.html
 fast/block/block-only/relative-simple.html
+fast/block/block-only/absolute-positioned-min-max-percentage-with-parent-padding.html
 fast/block/basic/012.html
 fast/block/inside-inlines/crash-on-first-line-change.html
 fast/block/float/007.html