summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-pseudo/highlight-cascade/cascade-highlight-005.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
commita90a5cba08fdf6c0ceb95101c275108a152a3aed (patch)
tree532507288f3defd7f4dcf1af49698bcb76034855 /testing/web-platform/tests/css/css-pseudo/highlight-cascade/cascade-highlight-005.html
parentAdding debian version 126.0.1-1. (diff)
downloadfirefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz
firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-pseudo/highlight-cascade/cascade-highlight-005.html')
-rw-r--r--testing/web-platform/tests/css/css-pseudo/highlight-cascade/cascade-highlight-005.html67
1 files changed, 67 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-pseudo/highlight-cascade/cascade-highlight-005.html b/testing/web-platform/tests/css/css-pseudo/highlight-cascade/cascade-highlight-005.html
new file mode 100644
index 0000000000..25ad85fe70
--- /dev/null
+++ b/testing/web-platform/tests/css/css-pseudo/highlight-cascade/cascade-highlight-005.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+
+ <meta charset="UTF-8">
+
+ <title>CSS Pseudo-Elements Test: inheritance of selection highlight background color from its parent element</title>
+
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
+ <link rel="help" href="https://www.w3.org/TR/css-pseudo-4/#highlight-cascade">
+ <link rel="match" href="cascade-highlight-005-ref.html">
+
+ <meta name="assert" content="In this test, 'background-color' has not been specified a value for the highlight pseudo-element of the span element. Since the span's parent element has an highlight pseudo-element also, then the span's background color for its highlight pseudo-element should be inherited from its parent highlight pseudo-element. Therefore the span element should have a green background color.">
+
+ <!--
+
+ This is a modified version of Example 11
+ https://www.w3.org/TR/css-pseudo-4/#example-c35bf49a
+ found in § 3.5 Cascading and Per-Element Highlight Styles
+ https://www.w3.org/TR/css-pseudo-4/#highlight-cascade
+
+ -->
+
+ <!--
+ When any supported property is not given a value by the
+ cascade, its value is determined by inheritance from the
+ corresponding highlight pseudo-element of its originating
+ element's parent element (regardless of whether that property
+ is an inherited property).
+ https://www.w3.org/TR/css-pseudo-4/#highlight-cascade
+ -->
+
+ <link rel="stylesheet" href="../support/highlights.css">
+
+ <style>
+ div
+ {
+ font-size: 300%;
+ }
+
+ div::selection
+ {
+ background-color: green;
+ color: yellow;
+ }
+
+ span::selection
+ {
+ color: orange;
+ }
+ </style>
+
+ <script>
+ function startTest()
+ {
+ var targetRange = document.createRange();
+ /* We first create an empty range */
+ targetRange.selectNodeContents(document.getElementById("test"));
+ /* Then we set the range boundaries to the children of div#test */
+ window.getSelection().addRange(targetRange);
+ /* Finally, we now select such range of content */
+ }
+ </script>
+
+ <body onload="startTest();">
+
+ <p>Test passes if "Text selected" has a green background throughout, if "Tex" and "cted" are yellow and if "t sele" are orange.
+
+ <div id="test" class="highlight_reftest">Tex<span>t sele</span>cted</div>