Bug 1634622 [wpt PR 23358] - [FlexNG] Make ComputeMinMaxSizes cache more precise., a=testonly
authorIan Kilpatrick <ikilpatrick@chromium.org>
Wed, 13 May 2020 09:42:30 +0000
changeset 531089 5256c0243c5190f2eae7d8ed816e63b94631a6c6
parent 531088 1224006b0542d1571943252f4f5758e836e5af40
child 531090 51c041f58f8c3482f1a1fd2e1e025c53b9acc2d8
push id37435
push userapavel@mozilla.com
push dateWed, 20 May 2020 15:28:23 +0000
treeherdermozilla-central@5415da14ec9a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1634622, 23358, 845235, 2165676, 765797
milestone78.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 1634622 [wpt PR 23358] - [FlexNG] Make ComputeMinMaxSizes cache more precise., a=testonly Automatic update from web-platform-tests [FlexNG] Make ComputeMinMaxSizes cache more precise. Previously our cache was imprecise, we recalculate our min/max sizes when we didn't strictly need to, as we didn't know if we'd have a %-block-size replaced element beneath us. This patch changes ComputeMinMaxSizes to return a MinMaxSizesResult (instead of just MinMaxSizes). This contains an additional bit of information to indicate if this sub-tree depended on the %-block-size given to it. For most things, this will return false. For legacy layout roots we always assume that they have children which depend on the %-block-size (and why we initialize: intrinsic_logical_widths_depends_on_percentage_block_size_ to true). Along with this change, the cache changes in the following way: - We store an addition bit of information on LayoutBox to store the bit of information from ComputeMinMaxSizes. - We calculate the %-block-size for our children up-front, this means each of the algorithms don't have to do this. - With these changes, the cache can now hit, when the %-block-size given to us changes. \o/ Bug: 845235 Change-Id: I93504721dbdd13bef58917b1fab2cabbcd1ce51e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2165676 Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org> Reviewed-by: Christian Biesinger <cbiesinger@chromium.org> Reviewed-by: Morten Stenshorne <mstensho@chromium.org> Reviewed-by: Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/master@{#765797} -- wpt-commits: 76e181c868d50d7f9a3901af03249102451d5de7 wpt-pr: 23358
testing/web-platform/tests/css/css-sizing/intrinsic-percent-replaced-dynamic-009.html
testing/web-platform/tests/css/css-sizing/intrinsic-percent-replaced-dynamic-010.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-sizing/intrinsic-percent-replaced-dynamic-009.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<link rel="help" href="https://drafts.csswg.org/css-sizing-3/#intrinsic">
+<link rel="match" href="../reference/ref-filled-green-100px-square-only.html">
+<meta name="assert" content="This test checks that a dynamic change in the height of an element calculates the intrinsic min/max size correctly when a replaced element is present."/>
+<p>Test passes if there is a filled green square.</p>
+<div id="target" style="float: left; background: green; line-height: 0;">
+  <span style="display: inline-block; height: 100%;">
+    <canvas width="1" height="1" style="height: 100%;"></canvas>
+  </div>
+</div>
+<script>
+  document.body.offsetTop;
+  document.getElementById('target').style.height = '100px';
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-sizing/intrinsic-percent-replaced-dynamic-010.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<link rel="help" href="https://drafts.csswg.org/css-sizing-3/#intrinsic">
+<link rel="match" href="../reference/ref-filled-green-100px-square-only.html">
+<meta name="assert" content="This test checks that a dynamic change in the height of an element calculates the intrinsic min/max size correctly when a replaced element is present."/>
+<p>Test passes if there is a filled green square.</p>
+<div id="target" style="float: left; background: green; color: transparent;">
+  <span>
+    <div style="float: left; height: 100%;">
+      <canvas width="1" height="1" style="height: 100%;"></canvas>
+    </div>
+  </span>
+</div>
+<script>
+  document.body.offsetTop;
+  document.getElementById('target').style.height = '100px';
+</script>