Bug 1514995 [wpt PR 14582] - [LayoutNG] Remove NGLayoutResult::PositionedFloats., a=testonly
authorIan Kilpatrick <ikilpatrick@chromium.org>
Thu, 31 Jan 2019 15:17:04 +0000
changeset 457686 a3d59dd2a9a8d1cd80b4213c9dc81284a88e1112
parent 457685 e07322780d2bc09cf0b0ae38e35c65d3266752de
child 457687 5043e31d83cf86d162192cb165e5469a00686c73
push id111763
push userjames@hoppipolla.co.uk
push dateThu, 07 Feb 2019 22:12:57 +0000
treeherdermozilla-inbound@c983e907bbfd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1514995, 14582, 1365984, 619070
milestone67.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 1514995 [wpt PR 14582] - [LayoutNG] Remove NGLayoutResult::PositionedFloats., a=testonly Automatic update from web-platform-tests [LayoutNG] Remove NGLayoutResult::PositionedFloats. This patch does a few (related) things: 1) Makes floats children of their appropriate inline-level container. Previously we weren't doing this, which was making OOF positioned children skip their correct containing block. Now they'll correctly get captured, during NGContainerFragmentBuilder::AddChild. 2) Now that float children are in the "correct" position within the fragment tree, we can now paint them. This changes the ng_box_fragment_painter.cc to paint inline-level floats and makes sure we set the NGPaintFragment correctly. 3) Lots of subtle painting layer changes. As floats are now in the "correct" fragment tree position, self-painting layers of inline-level elements (spans, etc) need to know that they are able to paint floats, determine position correctly, etc. The major behaviour changes are: <div> text <span style="position: relative;">abc <div style="float: left;"> <div style="position: absolute;"></div> </div> def</span> </div> The OOF positioned child will be contained within the <span> <div> <span style="position: relative; top: 100px;"> <div style="float: left;"></div></span> </div> The float will also shift by 100px, which previously wasn't the case. Additionally filter: blur(2px); etc, will be applied to the float. Change-Id: I61a2638cb1472f1a22f5994688d69fb6fffb8b88 Reviewed-on: https://chromium-review.googlesource.com/c/1365984 Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org> Reviewed-by: Chris Harrelson <chrishtr@chromium.org> Reviewed-by: Morten Stenshorne <mstensho@chromium.org> Reviewed-by: Koji Ishii <kojii@chromium.org> Reviewed-by: Emil A Eklund <eae@chromium.org> Cr-Commit-Position: refs/heads/master@{#619070} -- wpt-commits: a1cc8c0bda2dc784ab07a34473c8f27d4bad7518 wpt-pr: 14582
testing/web-platform/tests/css/CSS2/positioning/abspos-float-with-inline-container-ref.html
testing/web-platform/tests/css/CSS2/positioning/abspos-float-with-inline-container.html
testing/web-platform/tests/css/filter-effects/filtered-inline-applies-to-float-ref.html
testing/web-platform/tests/css/filter-effects/filtered-inline-applies-to-float.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/positioning/abspos-float-with-inline-container-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<style>
+div {
+  width: 100px;
+  height: 100px;
+  background: green;
+}
+</style>
+<p>Test passes if there is green square.</p>
+<div></div>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/positioning/abspos-float-with-inline-container.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<link rel="help" href="https://drafts.csswg.org/css2/visudet.html" />
+<link rel="match" href="abspos-float-with-inline-container-ref.html" />
+<meta name="assert" content="A inline-level element can contain a absolute-positioned child within a float." />
+<style>
+#abs {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  height: 100px;
+  background: green;
+}
+#float { float: left; }
+span {
+  position: relative;
+  padding-left: 100px;
+}
+</style>
+<p>Test passes if there is green square.</p>
+<div>
+  <span>
+    <div id="float">
+      <div id="abs"></div>
+    </div>
+  </span>
+</div>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/filter-effects/filtered-inline-applies-to-float-ref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<style>
+#float {
+    float: left;
+    width: 100px;
+    height: 100px;
+    background: green;
+    filter: blur(2px);
+}
+</style>
+<p>There should be a blurred green square.</p>
+<div id="float"></div>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/filter-effects/filtered-inline-applies-to-float.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#FilterProperty" />
+<link rel="match" href="filtered-inline-applies-to-float-ref.html" />
+<meta name="assert" content="A filter on an inline element applies to floats." />
+<style>
+span { filter: blur(2px); }
+#float {
+    float: left;
+    width: 100px;
+    height: 100px;
+    background: green;
+}
+</style>
+<p>There should be a blurred green square.</p>
+<div>
+  <span><div id="float"></div></span>
+</div>