Bug 1582661 [wpt PR 19179] - [LayoutNG] Ignore margins when determining if a new-fc will fit in a layout opportunity., a=testonly
authorIan Kilpatrick <ikilpatrick@chromium.org>
Wed, 25 Sep 2019 16:54:46 +0000
changeset 495060 12761dc5f613245a2e6c2fb2535dd1869e32b333
parent 495059 da591e341d118a825d6441a28987f0a640fb8fe7
child 495061 95a7ee29ecb2b374c4cc207de60b7752c2c4379f
push id114132
push userwptsync@mozilla.com
push dateThu, 26 Sep 2019 20:29:30 +0000
treeherdermozilla-inbound@637c32be2b54 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1582661, 19179, 1003193, 1808661, 698954
milestone71.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1582661 [wpt PR 19179] - [LayoutNG] Ignore margins when determining if a new-fc will fit in a layout opportunity., a=testonly Automatic update from web-platform-tests [LayoutNG] Ignore margins when determining if a new-fc will fit in a layout opportunity. Previously we calculated layout opportunities by shrinking the available child space by the child's margins. This resulted in layout opportunities which were too small, and would push the new formatting context down to the next opportunity. This logic now allows margins to "overhang" a layout opportunity. At the same time I refactored a lot of the code, as we were adding/subtracting margins for different calculations. Hopefully this is more readable! Bug: 1003193 Change-Id: I6c05b050332afe9880ca7d9a5b426b4b94fde3f5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1808661 Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org> Reviewed-by: Morten Stenshorne <mstensho@chromium.org> Cr-Commit-Position: refs/heads/master@{#698954} -- wpt-commits: 3a5b1d12606ad979bc063ad1902fd44046cb7f10 wpt-pr: 19179
testing/web-platform/tests/css/CSS2/floats/new-fc-beside-float-with-margin-rtl.html
testing/web-platform/tests/css/CSS2/floats/new-fc-beside-float-with-margin.html
testing/web-platform/tests/css/CSS2/floats/zero-width-floats-positioning.html
testing/web-platform/tests/css/CSS2/floats/zero-width-floats-positioning.tentative.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/floats/new-fc-beside-float-with-margin-rtl.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<link rel="help" href="https://www.w3.org/TR/CSS22/visuren.html#bfc-next-to-float" title="9.5 Floats">
+<meta name="assert" content="The new formatting context's margin-right does not push it down to the next area.">
+<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
+<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+<div style="width: 100px; height: 100px; background: red; direction: rtl;">
+  <div style="float: left; width: 50px; height: 100px; background: green;"></div>
+  <div style="overflow: hidden; height: 100px; margin-left: -20px; background: green;"></div>
+</div>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/floats/new-fc-beside-float-with-margin.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<link rel="help" href="https://www.w3.org/TR/CSS22/visuren.html#bfc-next-to-float" title="9.5 Floats">
+<meta name="assert" content="The new formatting context's margin-right does not push it down to the next area.">
+<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
+<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+<div style="width: 100px; height: 100px; background: red;">
+  <div style="float:left; width:50px; height:100px; background:green;"></div>
+  <div style="overflow: hidden; margin-right: 1px; width:50px; height:100px; background:green;"></div>
+</div>
deleted file mode 100644
--- a/testing/web-platform/tests/css/CSS2/floats/zero-width-floats-positioning.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE html>
-<title>Zero width floats, and positioning with negative margins</title>
-<link rel="author" title="Ian Kilpatrick" href="ikilpatrick@chromium.org">
-<link rel="help" href="https://www.w3.org/TR/CSS22/visudet.html#float-width" title="10.3.5 Floating, non-replaced elements">
-<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
-<p>Test passes if there is a filled green square.</p>
-<div style="margin-left: 50px; width: 125px;">
-  <div style="float: left; width: 0px; height: 50px;"></div>
-  <div style="float: right; clear: left; width: 25px; height: 50px;"></div>
-  <div style="overflow: hidden; margin-left: -50px; height: 100px; background: green;"></div>
-</div>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/floats/zero-width-floats-positioning.tentative.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<title>Zero width floats, and positioning with negative margins</title>
+<link rel="author" title="Ian Kilpatrick" href="ikilpatrick@chromium.org">
+<link rel="help" href="https://www.w3.org/TR/CSS22/visudet.html#float-width" title="10.3.5 Floating, non-replaced elements">
+<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
+<p>Test passes if there is a filled green square.</p>
+<div style="width: 125px;">
+  <div style="float: left; width: 0px; height: 50px;"></div>
+  <div style="float: right; clear: left; width: 25px; height: 50px;"></div>
+  <div style="overflow: hidden; margin-left: -50px; height: 100px; background: green;"></div>
+</div>