[go: nahoru, domu]

Skip to content

Commit

Permalink
Resolve highlight custom properties from the root
Browse files Browse the repository at this point in the history
It was resolved in w3c/csswg-drafts#6641
that CSS Highlight Pseudos should inherit custom properties from
the root element if those properties are not defined in the
highlight inheritance path. Implement that by checking the root
element when a custom variable for the highlight is not found.

Bug: 1412395
Change-Id: I88c22cea6a9eb5f465a5c0dd97444b39b07368a2
  • Loading branch information
schenney-chromium authored and chromium-wpt-export-bot committed Aug 30, 2023
1 parent f78f1aa commit 252e054
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions css/css-pseudo/highlight-cascade-008.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<title>Custom property values from the root element</title>
<link rel="help" href="https://drafts.csswg.org/css-pseudo-4/#highlight-cascade">
<link rel="match" href="highlight-cascade-004-ref.html">
<meta name="assert" value="This test verifies that when a custom property is not found in highlight cascade, it's value is taken from the root element.">
<script src="support/selections.js"></script>
<style>
:root {
--background-color: green;
}
div::selection {
background-color: var(--background-color, red);
}
</style>
<div>PASS if background-color is green when selected</div>
<script>
selectNodeContents(document.querySelector("div"));
</script>

0 comments on commit 252e054

Please sign in to comment.