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-pseudo/active-selection-041.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-pseudo/active-selection-041.html')
-rw-r--r-- | testing/web-platform/tests/css/css-pseudo/active-selection-041.html | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-pseudo/active-selection-041.html b/testing/web-platform/tests/css/css-pseudo/active-selection-041.html new file mode 100644 index 0000000000..f437c8bb52 --- /dev/null +++ b/testing/web-platform/tests/css/css-pseudo/active-selection-041.html @@ -0,0 +1,86 @@ +<!DOCTYPE html> + +<html class="reftest-wait"> + + <meta charset="UTF-8"> + + <title>CSS Pseudo-Elements Test: active selection and image</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-painting"> + <link rel="mismatch" href="reference/active-selection-041-notref.html"> + + <meta content="should" name="flags"> + <meta name="assert" content="In this test, a filled yellow image is selected and is overlaid with an opaque blue background color. The specification states that, for replaced content, the UA should create a semi-transparent wash to coat the content. But such semi-transparent wash could use a transparency of 0.3 or 0.5 or 0.7: so, we do not know. Therefore we can not predict the rendered end result. All we can be sure of is that the image, once selected, must not be identical to its original non-selected version. This test checks precisely and only this."> + + <!-- + " + (...) for replaced content, the UA should create + a semi-transparent wash to coat the content so + that it can show through the selection. + " + coming from + https://www.w3.org/TR/css-pseudo-4/#highlight-painting + --> + + <!-- + July 28th 2020 + + Firefox 68.10.0 ESR will create a resulting + background color of #7F7F80, which looks like + dark gray. + + Chrome 83.0.4103.116 will create a resulting + background color of #33CCCC which looks like + dark blue. + + July 28th 2020 + --> + + <style> + div + { + font-size: 300%; + } + + img + { + vertical-align: top; + } + + /* + Chromium 80+ will highlight space + below and above content box while + Firefox 72+ only highlights the image itself. + Therefore this 'vertical-align: top' declaration + to work around this possible behavior. + */ + + img::selection + { + background-color: blue; + /* + equivalent to rgb(0, 0, 255) or rgb(0%, 0%, 100%) + or rgba(0, 0, 255, 1) or #0000FF + */ + } + </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 */ + document.documentElement.className = ""; + } + </script> + + <body onload="startTest();"> + + <p>Test passes if there is a filled square which is <strong>not yellow</strong>. + + <div id="test"><img src="../support/swatch-yellow.png" width="100" height="100" alt="Image download support must be enabled"></div> |