diff options
Diffstat (limited to 'testing/web-platform/tests/css/css-highlight-api/painting/custom-highlight-painting-below-selection.html')
-rw-r--r-- | testing/web-platform/tests/css/css-highlight-api/painting/custom-highlight-painting-below-selection.html | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-highlight-api/painting/custom-highlight-painting-below-selection.html b/testing/web-platform/tests/css/css-highlight-api/painting/custom-highlight-painting-below-selection.html new file mode 100644 index 0000000000..cd5ad36a69 --- /dev/null +++ b/testing/web-platform/tests/css/css-highlight-api/painting/custom-highlight-painting-below-selection.html @@ -0,0 +1,24 @@ +<!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>
\ No newline at end of file |