commit 493a31c88954ca5f9f4a979fc488e37e80168049 parent b70f5723faabe82734458f1c4174ea39064a9b9e Author: David Grogan <dgrogan@chromium.org> Date: Tue, 16 Dec 2025 08:45:55 +0000 Bug 2005295 [wpt PR 56640] - [viewport units] Housekeeping bits of obeying scrollbars, a=testonly Automatic update from web-platform-tests [viewport units] Housekeeping bits of obeying scrollbars * Replace TODO with DCHECKs in PaintLayerScrollableArea::ComputeScrollbarWidthsForViewportUnits. * Add WPT showing that viewport units in registered custom properties that affect scrollbars do not cause rendering cycles. Bug: 354751900 Change-Id: Ic149c57a9093e02f0dac9258ecb1ac0bba518439 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7236093 Commit-Queue: David Grogan <dgrogan@chromium.org> Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Cr-Commit-Position: refs/heads/main@{#1556853} -- wpt-commits: ca9ce604c3199cb58fa7e422345af83bb45dd898 wpt-pr: 56640 Diffstat:
| A | testing/web-platform/tests/css/css-values/viewport-units-scroll-no-cycles-001.tentative.html | | | 47 | +++++++++++++++++++++++++++++++++++++++++++++++ |
1 file changed, 47 insertions(+), 0 deletions(-)
diff --git a/testing/web-platform/tests/css/css-values/viewport-units-scroll-no-cycles-001.tentative.html b/testing/web-platform/tests/css/css-values/viewport-units-scroll-no-cycles-001.tentative.html @@ -0,0 +1,47 @@ +<!doctype html> +<html> +<title>CSS Values and Units Test: Viewport units and scrollbars</title> +<link rel="help" href="http://www.w3.org/TR/css3-values/#viewport-relative-lengths"> +<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/13189"> +<link rel="help" href="https://crbug.com/467164228"> +<meta name="assert" content="Ensure that a viewport unit cycle in an if() condition causes the if() to be invalid at computed value time."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<style> + iframe { + width: 100px; + height: 100px; + } +</style> +<iframe id="iframe" srcdoc="<!doctype html> +<style> +@property --vw-tracker { + syntax: '<length>'; + initial-value: 0px; + inherits: false; +} + +:root { + --vw-tracker: 100vw; + overflow: if( + style(--vw-tracker = 100px): scroll; + else: hidden; + ); +} +</style> +"></iframe> +<script> + function waitForLoad(w) { + return new Promise(resolve => w.addEventListener('load', resolve)); + } + + promise_test(async () => { + await waitForLoad(window); + const root = iframe.contentDocument.documentElement; + const win = iframe.contentWindow; + const style = win.getComputedStyle(root); + // overflow should be its default value of 'visible'. + assert_equals(style.overflow, 'visible'); + }); +</script>