1
0
Fork 0
firefox/testing/web-platform/tests/css/css-pseudo/highlight-cascade/highlight-cascade-010.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

29 lines
1.3 KiB
HTML

<!doctype html>
<meta charset="utf-8">
<title>CSS Pseudo-Elements Test: highlight styling: late property registration updates highlights</title>
<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-pseudo-4/#highlight-cascade">
<meta name="assert" value="This test verifies that custom property values when defined on a highlight pseudo update when the property registration happens after first style recalc.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
#originating::spelling-error {
color: white;
--x: initial;
background-color: var(--x, red);
}
</style>
<div id="originating">Text wth a spelling error</div>
<script>
promise_test(async () => {
await new Promise(requestAnimationFrame);
CSS.registerProperty({
name: '--x',
inherits: true,
initialValue: "green"
});
await new Promise(requestAnimationFrame);
const originating_spelling = getComputedStyle(document.querySelector("div"), "::spelling-error");
assert_equals(originating_spelling.getPropertyValue("--x"), "green");
}, "the custom property receives its initial value from a deferred registration");
</script>