Bug 1623706 [wpt PR 22339] - [FlexNG] 4/4 Cache intrinsic logical widths instead of preferred., a=testonly
authorIan Kilpatrick <ikilpatrick@chromium.org>
Mon, 23 Mar 2020 11:42:26 +0000
changeset 520498 bd60f7b157826e6f34d17a5244a6e7d5038e36b8
parent 520497 6ac1b1858a64d422ea8091a76422f6b41574bb47
child 520499 cd4e77469af17455981a4f11b1431487dc1d2595
push id37252
push usermalexandru@mozilla.com
push dateThu, 26 Mar 2020 15:34:27 +0000
treeherdermozilla-central@31360ced8ff8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1623706, 22339, 845235, 2099322, 751828
milestone76.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 1623706 [wpt PR 22339] - [FlexNG] 4/4 Cache intrinsic logical widths instead of preferred., a=testonly Automatic update from web-platform-tests [FlexNG] 4/4 Cache intrinsic logical widths instead of preferred. This moves the caching from preferred logical widths "down" one level to intrinsic logical widths. This improves performance of FlexNG in particular, but also legacy flexbox and other functions. This comes at the expense of some grid perf-tests which seems like the right tradeoff given how popular flex is. FlexNG: https://pinpoint-dot-chromeperf.appspot.com/job/17dcb4ff620000 non-FlexNG: https://pinpoint-dot-chromeperf.appspot.com/job/161c179b620000 This patch transforms ComputePreferredLogicalWidths into PreferredLogicalWidths. We also store what we used to resolve %-block-sizes within the min/max phase. We can use this additional data for a more precise min/max size cache see: CanUseCachedIntrinsicLogicalWidths. Bug: 845235 Change-Id: I4a6584f580ae7967b156592d1e97ddbb4631a432 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2099322 Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org> Reviewed-by: Christian Biesinger <cbiesinger@chromium.org> Reviewed-by: David Grogan <dgrogan@chromium.org> Reviewed-by: Morten Stenshorne <mstensho@chromium.org> Cr-Commit-Position: refs/heads/master@{#751828} -- wpt-commits: 908c2b043378ab361f2a34ebb51846c48b24069d wpt-pr: 22339
testing/web-platform/tests/css/css-sizing/intrinsic-percent-replaced-dynamic-001.html
testing/web-platform/tests/css/css-sizing/intrinsic-percent-replaced-dynamic-002.html
testing/web-platform/tests/css/css-sizing/intrinsic-percent-replaced-dynamic-003.html
testing/web-platform/tests/css/css-sizing/intrinsic-percent-replaced-dynamic-004.html
testing/web-platform/tests/css/css-sizing/intrinsic-percent-replaced-dynamic-005.html
testing/web-platform/tests/css/css-sizing/intrinsic-percent-replaced-dynamic-006.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-sizing/intrinsic-percent-replaced-dynamic-001.html
@@ -0,0 +1,14 @@
+<!-- quirks mode -->
+<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 style="margin-top: 1em;">Test passes if there is a filled green square.</p>
+<div id="target" style="float: left; background: green;">
+  <div>
+    <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-002.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;">
+  <span>
+    <div style="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>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-sizing/intrinsic-percent-replaced-dynamic-003.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;">
+  <div style="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-004.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;">
+  <div style="width: fit-content; 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-005.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 style="position: relative; width: 100px; height: 100px;">
+  <div id="target" style="position: absolute; top:0; background: green;">
+    <canvas width="1" height="1" style="height: 100%;"></canvas>
+  </div>
+</div>
+<script>
+  document.body.offsetTop;
+  document.getElementById('target').style.bottom = '0px';
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-sizing/intrinsic-percent-replaced-dynamic-006.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;">
+  <div style="width: 100%; height: 100%;">
+    <canvas width="1" height="1" style="height: 100%;"></canvas>
+  </div>
+</div>
+<script>
+  document.body.offsetTop;
+  document.getElementById('target').style.height = '100px';
+</script>