summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-highlight-api/painting/custom-highlight-painting-inheritance-001.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/css/css-highlight-api/painting/custom-highlight-painting-inheritance-001.html')
-rw-r--r--testing/web-platform/tests/css/css-highlight-api/painting/custom-highlight-painting-inheritance-001.html27
1 files changed, 27 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-highlight-api/painting/custom-highlight-painting-inheritance-001.html b/testing/web-platform/tests/css/css-highlight-api/painting/custom-highlight-painting-inheritance-001.html
new file mode 100644
index 0000000000..eb5e5e1181
--- /dev/null
+++ b/testing/web-platform/tests/css/css-highlight-api/painting/custom-highlight-painting-inheritance-001.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<meta charset="UTF-8">
+<title>CSS Highlight API Test: Inheritance</title>
+<link rel="help" href="https://drafts.csswg.org/css-highlight-api-1/">
+<link rel="match" href="custom-highlight-painting-inheritance-001-ref.html">
+<meta name="assert" value="Highlighted elements inherit style properties from their parent if they're not set">
+<style>
+ div::highlight(div-highlight) {
+ background-color: green;
+ color: red;
+ }
+ span::highlight(span-highlight) {
+ color: blue;
+ }
+</style>
+<body>
+<div>There should be only one green rectangle below from [ to ]:</div>
+<div id="target">[<span>&nbsp;&nbsp;&nbsp;<strong>&nbsp;&nbsp;&nbsp;</strong>&nbsp;&nbsp;&nbsp;</span>]</div>
+<script>
+ let r = new Range();
+ const node = document.getElementById("target");
+ r.setStart(node, 1);
+ r.setEnd(node, 2);
+
+ CSS.highlights.set("div-highlight", new Highlight(r));
+ CSS.highlights.set("span-highlight", new Highlight(r));
+</script> \ No newline at end of file