1
0
Fork 0
firefox/testing/web-platform/tests/css/css-highlight-api/painting/custom-highlight-painting-below-selection.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

24 lines
No EOL
826 B
HTML

<!DOCTYPE html>
<meta charset="UTF-8">
<title>CSS Highlight API Test: </title>
<link rel="help" href="https://drafts.csswg.org/css-highlight-api-1/">
<link rel="match" href="custom-highlight-painting-below-selection-ref.html">
<meta name="assert" value="Highlight overlay is painted below selection overlay">
<style>
::highlight(foo) {
background: cyan;
color: blue;
}
::selection {
background: blue;
color: cyan;
}
</style>
<body>Text should be blue over cyan here and <span id="selected">cyan over blue here</span>.
<script>
let highlightRange = new Range();
highlightRange.setStart(document.body.firstChild, 0);
highlightRange.setEnd(document.body.lastChild, 0);
CSS.highlights.set("foo", new Highlight(highlightRange));
getSelection().setBaseAndExtent(selected, 0, selected, 1);
</script>