blob: ed280f7476ae3ef2259fac0fb2f247273989e0b8 [file] [log] [blame]
<!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-001-ref.html">
<meta name="assert" value="StaticRanges crossing both boundaries of a css-contain (i.e. containing it entirely) should be painted">
<style>
::highlight(example-highlight) {
background-color: yellow;
color: blue;
}
#contained {
contain: style;
}
</style>
<body><span>One <span id="contained">two </span>three…</span>
<script>
let h = new Highlight("example-highlight");
h.add(new StaticRange({startContainer: document.body.firstChild.childNodes[0], startOffset: 0, endContainer: document.body.firstChild.childNodes[2], endOffset: 0}));
CSS.highlights.add(h);
</script>