Files
sousa-gecko/testing/web-platform/tests/css/css-shapes/shape-functions/path-function-computed-collision.html
T
Etienne Pierre-doray 6ee39d2c88 Bug 2040945 [wpt PR 60000] - [css] Account for WindRule when comparing CSSPathValue, a=testonly
Automatic update from web-platform-tests
[css] Account for WindRule when comparing CSSPathValue

This seems like a correctness bug, demonstrated by
new path-function-computed-collision.html
To prevent the Matched Properties Cache from reusing incompatible
CSSPathValue, we need to account for WindRule.

I've hit this issue while working on a css cache optimization (https://crrev.com/c/7852775)

Bug: 514751990
Change-Id: Id55d3b8d2447b84f2887e5202a439b3cd3b86033
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7859291
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1633540}

--

wpt-commits: 6d14654eabfce1d3c398886387faa2affabd2675
wpt-pr: 60000
2026-05-22 14:17:24 +00:00

37 lines
1.4 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Shapes Module Level 1: path() function cache collision</title>
<link rel="help" href="https://drafts.csswg.org/css-shapes-1/#funcdef-basic-shape-path">
<link rel="help" href="https://crbug.com/514751990">
<meta name="assert" content="Tests that path() with different wind rules does not collide in the Matched Properties Cache when defined via stylesheets">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
.nonzero-path {
clip-path: path(nonzero, 'M10,10H90V90H10ZM25,25H75V75H25Z');
}
.evenodd-path {
clip-path: path(evenodd, 'M10,10H90V90H10ZM25,25H75V75H25Z');
}
</style>
</head>
<body>
<div id="t1" class="nonzero-path"></div>
<div id="t2" class="evenodd-path"></div>
<script>
test(function() {
var t1 = document.getElementById('t1');
var t2 = document.getElementById('t2');
// Resolve t1 first. It should be nonzero.
assert_equals(getComputedStyle(t1).clipPath, 'path("M 10 10 H 90 V 90 H 10 Z M 25 25 H 75 V 75 H 25 Z")');
// Resolve t2. If cache collision occurs and wind rule is ignored, it might reuse t1's style and be nonzero instead of evenodd.
assert_equals(getComputedStyle(t2).clipPath, 'path(evenodd, "M 10 10 H 90 V 90 H 10 Z M 25 25 H 75 V 75 H 25 Z")');
}, "Test that path() with different wind rules does not collide in the Matched Properties Cache");
</script>
</body>
</html>