summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-pseudo/active-selection-043.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/css/css-pseudo/active-selection-043.html
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-pseudo/active-selection-043.html')
-rw-r--r--testing/web-platform/tests/css/css-pseudo/active-selection-043.html83
1 files changed, 83 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-pseudo/active-selection-043.html b/testing/web-platform/tests/css/css-pseudo/active-selection-043.html
new file mode 100644
index 0000000000..944bf5526e
--- /dev/null
+++ b/testing/web-platform/tests/css/css-pseudo/active-selection-043.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+
+<html class="reftest-wait">
+
+ <meta charset="UTF-8">
+
+ <title>CSS Pseudo-Elements Test: active selection and image (complex)</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-bounds">
+ <link rel="match" href="../reference/ref-nothing-below.xht">
+
+ <meta name="assert" content="In this test, a filled red image has a padding belt painted red and a red border. This test checks that the associated overlay for an image must not leak outside the image's border box.">
+
+ <!--
+
+ "
+ For replaced content, the associated overlay must cover
+ at least the entire replaced object, and may extend
+ outward to include the element's entire content box.
+ The overlay may also include other other areas within
+ the border-box of an element (...)
+ "
+ coming from
+ https://www.w3.org/TR/css-pseudo-4/#highlight-bounds
+
+ -->
+
+ <style>
+ div
+ {
+ font-size: 300%;
+ }
+
+ img
+ {
+ background-color: red;
+ /* so that the padding belt is painted red */
+ border: red solid 10px;
+ padding: 10px;
+ }
+
+ /*
+ Chromium 80+ highlights the descender space
+ below the baseline on which the image "sits" while
+ Firefox 72+ only highlights the image itself.
+ */
+
+ img::selection
+ {
+ background-color: red;
+ color: red;
+ }
+
+ span#masking
+ {
+ background-color: white;
+ display: inline-block;
+ height: 100px;
+ position: relative;
+ right: 100px;
+ width: 100px;
+ }
+ </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 nothing below.
+
+ <div id="test"><img src="support/60x60-red.png" alt="Image download support must be enabled"><span id="masking"></span></div>