diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/css/css-color/system-color-hightlights-vs-getSelection-002.html | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-color/system-color-hightlights-vs-getSelection-002.html')
-rw-r--r-- | testing/web-platform/tests/css/css-color/system-color-hightlights-vs-getSelection-002.html | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-color/system-color-hightlights-vs-getSelection-002.html b/testing/web-platform/tests/css/css-color/system-color-hightlights-vs-getSelection-002.html new file mode 100644 index 0000000000..f4025cd3f0 --- /dev/null +++ b/testing/web-platform/tests/css/css-color/system-color-hightlights-vs-getSelection-002.html @@ -0,0 +1,91 @@ +<!DOCTYPE html> + + <meta charset="UTF-8"> + + <title>CSS Color Test: system color highlights values versus getSelection().addRange(targetRange)</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-color-4/#css-system-colors"> + <link rel="help" href="https://www.w3.org/TR/css-pseudo-4/#highlight-styling"> + <link rel="match" href="reference/system-color-hightlights-vs-getSelection-002-ref.html"> + + <!-- + + Created: March 29th 2023 + + Last modified: July 12th 2023 + + Chromium bug report 932343 comment #c20: Issue 932343: Support text decoration properties in ::selection + https://bugs.chromium.org/p/chromium/issues/detail?id=932343#c20 + + Chromium bug report 1429019: Issue 1429019: [CSS4 Color] [CSS4 Pseudo] getSelection() color and background color should match system color highlights + https://bugs.chromium.org/p/chromium/issues/detail?id=1429019 + + WebKit Bug report 254691: [CSS4 Color] [CSS4 Pseudo] getSelection() color and background color should match system color highlights + https://bugs.webkit.org/show_bug.cgi?id=254691 + + --> + + <meta content="" name="flags"> + <meta content="This test checks that color and background color generated by window.getSelection().addRange(targetRange) correspond to system color highlights values when there is a non-transparent background color behind the tested range of text." name="assert"> + + <style> + div + { + font-size: 40px; + line-height: 1; + } + + /* + https://www.w3.org/TR/css-pseudo-4/#highlight-bounds + For text, the corresponding overlay must cover at least + the entire em box and may extend further above/below the + em box to the line box edges. + */ + + span.system-color-highlight + { + background-color: Highlight; + color: HighlightText; + } + + /* + + Highlight + Background of item(s) selected in a control. + https://www.w3.org/TR/css-color-4/#valdef-system-color-highlight + + HighlightText + Text of item(s) selected in a control. + https://www.w3.org/TR/css-color-4/#valdef-system-color-highlighttext + + CSS4 Color Module + 5.2 System Colors + https://www.w3.org/TR/css-color-4/#css-system-colors + + */ + </style> + + <script type="text/javascript"> + function startTest() + { + /* We first create an empty range */ + var targetRange = document.createRange(); + + /* Then we select the node */ + targetRange.selectNode(document.getElementById("getSelection")); + + /* Finally, we now select such range of content */ + window.getSelection().addRange(targetRange); + } + + </script> + + <body onload="startTest();"> + <div style="background-color: yellow;"> + <span id="getSelection">With getSelection()</span> + </div> + + <div style="background-color: yellow;"> + <span class="system-color-highlight">With system-color-highlight</span> + </div> |