Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /css/css-highlight-api/custom-highlight-universal-escaped-star.tentative.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="UTF-8">
<title>Custom Highlight: ::highlight(*) computed style must not be confused with the escaped name \*</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
#outer::highlight(\*) { color: red; }
#outer::highlight(*) { color: green; background-color: yellow; }
</style>
<div id="outer">text</div>
<script>
test(() => {
const style = getComputedStyle(outer, "::highlight(\\*)");
assert_equals(style.color, "rgb(255, 0, 0)");
assert_equals(style.backgroundColor, "rgb(255, 255, 0)");
}, "::highlight(\\*) computed style is the escaped literal name's rule, merged with the universal base");
</script>