summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/selection/select-end-of-line-image.tentative.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /testing/web-platform/tests/selection/select-end-of-line-image.tentative.html
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/selection/select-end-of-line-image.tentative.html')
-rw-r--r--testing/web-platform/tests/selection/select-end-of-line-image.tentative.html49
1 files changed, 49 insertions, 0 deletions
diff --git a/testing/web-platform/tests/selection/select-end-of-line-image.tentative.html b/testing/web-platform/tests/selection/select-end-of-line-image.tentative.html
new file mode 100644
index 0000000000..572296c443
--- /dev/null
+++ b/testing/web-platform/tests/selection/select-end-of-line-image.tentative.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+ <meta charset="utf-8">
+ <title>Selection: Select the image at the end of the line</title>
+ <link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com">
+ <link rel="author" title="Mozilla" href="https://www.mozilla.org/">
+ <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1745435">
+
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/resources/testdriver.js"></script>
+ <script src="/resources/testdriver-actions.js"></script>
+ <script src='/resources/testdriver-vendor.js'></script>
+
+ <style>
+ img {
+ inline-size: 100px;
+ block-size: 20px;
+ background: orange;
+ }
+ </style>
+
+ <body>
+ You shouldn't see an orange image at the end of this line
+ <img id="target" src='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"><text>hello</text></svg>'>
+ </body>
+
+ <script>
+ promise_test(async function() {
+ let target = document.getElementById("target");
+ let actions = new test_driver.Actions();
+
+ // Move the pointer from the left edge of the image, to the right for about
+ // 3/4 width of the image. This should be sufficient to select the image.
+ await actions.pointerMove(0, 10, {origin: target})
+ .pointerDown()
+ .pointerMove(75, 10, {origin: target})
+ .pointerUp()
+ .send();
+
+ // Delete the image to verify the image is selected. It's tricky to verify
+ // it using Range API.
+ window.getSelection().deleteFromDocument();
+
+ assert_equals(document.getElementById("target"), null,
+ "The image should be selected and then deleted.")
+ }, "Select image at the end of the line.");
+ </script>
+</html>