Title: [240894] trunk
Revision
240894
Author
[email protected]
Date
2019-02-02 08:26:42 -0800 (Sat, 02 Feb 2019)

Log Message

[LFC] Add missing case to out-of-flow non-replaced horizontal used margin value computation
https://bugs.webkit.org/show_bug.cgi?id=194185

Reviewed by Antti Koivisto.

Source/WebCore:

If none of horizontal values (left, right, width, margin-left/right) are auto, then usedHorizontalMarginValues = computedHorizontalMarginValues.

Test: fast/block/block-only/absolute-position-left-right-margin.html

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):

Tools:

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

LayoutTests:

* fast/block/block-only/absolute-position-left-right-margin-expected.html: Added.
* fast/block/block-only/absolute-position-left-right-margin.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (240893 => 240894)


--- trunk/LayoutTests/ChangeLog	2019-02-02 07:15:47 UTC (rev 240893)
+++ trunk/LayoutTests/ChangeLog	2019-02-02 16:26:42 UTC (rev 240894)
@@ -1,3 +1,13 @@
+2019-02-02  Zalan Bujtas  <[email protected]>
+
+        [LFC] Add missing case to out-of-flow non-replaced horizontal used margin value computation
+        https://bugs.webkit.org/show_bug.cgi?id=194185
+
+        Reviewed by Antti Koivisto.
+
+        * fast/block/block-only/absolute-position-left-right-margin-expected.html: Added.
+        * fast/block/block-only/absolute-position-left-right-margin.html: Added.
+
 2019-02-01  Megan Gardner  <[email protected]>
 
         Rewrite and rebaseline smart copy paste tests to work on iOS and MacOS

Added: trunk/LayoutTests/fast/block/block-only/absolute-position-left-right-margin-expected.html (0 => 240894)


--- trunk/LayoutTests/fast/block/block-only/absolute-position-left-right-margin-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/block/block-only/absolute-position-left-right-margin-expected.html	2019-02-02 16:26:42 UTC (rev 240894)
@@ -0,0 +1,15 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<style>
+div {
+  width: 100px;
+  height: 100px;
+  background-color: green;
+}
+</style>
+</head>
+<body>
+<div></div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/block/block-only/absolute-position-left-right-margin.html (0 => 240894)


--- trunk/LayoutTests/fast/block/block-only/absolute-position-left-right-margin.html	                        (rev 0)
+++ trunk/LayoutTests/fast/block/block-only/absolute-position-left-right-margin.html	2019-02-02 16:26:42 UTC (rev 240894)
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<style>
+div {
+  position: absolute;
+  left: 0px;
+  right: 8px;
+  margin-left: 8px;
+  width: 100px;
+  height: 100px;
+  background-color: green;
+}
+</style>
+</head>
+<body>
+<div></div>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (240893 => 240894)


--- trunk/Source/WebCore/ChangeLog	2019-02-02 07:15:47 UTC (rev 240893)
+++ trunk/Source/WebCore/ChangeLog	2019-02-02 16:26:42 UTC (rev 240894)
@@ -1,3 +1,17 @@
+2019-02-02  Zalan Bujtas  <[email protected]>
+
+        [LFC] Add missing case to out-of-flow non-replaced horizontal used margin value computation
+        https://bugs.webkit.org/show_bug.cgi?id=194185
+
+        Reviewed by Antti Koivisto.
+
+        If none of horizontal values (left, right, width, margin-left/right) are auto, then usedHorizontalMarginValues = computedHorizontalMarginValues.
+
+        Test: fast/block/block-only/absolute-position-left-right-margin.html
+
+        * layout/FormattingContextGeometry.cpp:
+        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
+
 2018-12-16  Darin Adler  <[email protected]>
 
         Convert additional String::format clients to alternative approaches

Modified: trunk/Source/WebCore/layout/FormattingContextGeometry.cpp (240893 => 240894)


--- trunk/Source/WebCore/layout/FormattingContextGeometry.cpp	2019-02-02 07:15:47 UTC (rev 240893)
+++ trunk/Source/WebCore/layout/FormattingContextGeometry.cpp	2019-02-02 16:26:42 UTC (rev 240894)
@@ -478,7 +478,8 @@
                 else
                     usedHorizontalMargin.end = containingBlockWidth - (usedHorizontalMargin.start + borderLeft + paddingLeft + contentWidth() + paddingRight + borderRight + *right);
             }
-        }
+        } else
+            usedHorizontalMargin = { *computedHorizontalMargin.start, *computedHorizontalMargin.end };
     } else {
         // Otherwise, set 'auto' values for 'margin-left' and 'margin-right' to 0, and pick the one of the following six rules that applies.
         usedHorizontalMargin = { computedHorizontalMargin.start.valueOr(0), computedHorizontalMargin.end.valueOr(0) };

Modified: trunk/Tools/ChangeLog (240893 => 240894)


--- trunk/Tools/ChangeLog	2019-02-02 07:15:47 UTC (rev 240893)
+++ trunk/Tools/ChangeLog	2019-02-02 16:26:42 UTC (rev 240894)
@@ -1,3 +1,12 @@
+2019-02-02  Zalan Bujtas  <[email protected]>
+
+        [LFC] Add missing case to out-of-flow non-replaced horizontal used margin value computation
+        https://bugs.webkit.org/show_bug.cgi?id=194185
+
+        Reviewed by Antti Koivisto.
+
+        * LayoutReloaded/misc/LFC-passing-tests.txt:
+
 2018-12-16  Darin Adler  <[email protected]>
 
         Convert additional String::format clients to alternative approaches

Modified: trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt (240893 => 240894)


--- trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt	2019-02-02 07:15:47 UTC (rev 240893)
+++ trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt	2019-02-02 16:26:42 UTC (rev 240894)
@@ -7,6 +7,7 @@
 fast/block/block-only/absolute-left-right-top-bottom-auto.html
 fast/block/block-only/absolute-nested2.html
 fast/block/block-only/absolute-nested.html
+fast/block/block-only/absolute-position-left-right-margin.html
 fast/block/block-only/absolute-position-min-max-height.html
 fast/block/block-only/absolute-position-min-max-width.html
 fast/block/block-only/absolute-position-when-containing-block-is-not-in-the-formatting-context2.html
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to