summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/shadow-dom/selection-direction.tentative.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /testing/web-platform/tests/shadow-dom/selection-direction.tentative.html
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/shadow-dom/selection-direction.tentative.html')
-rw-r--r--testing/web-platform/tests/shadow-dom/selection-direction.tentative.html42
1 files changed, 42 insertions, 0 deletions
diff --git a/testing/web-platform/tests/shadow-dom/selection-direction.tentative.html b/testing/web-platform/tests/shadow-dom/selection-direction.tentative.html
index 3a2512dcc7..b5b3f6044c 100644
--- a/testing/web-platform/tests/shadow-dom/selection-direction.tentative.html
+++ b/testing/web-platform/tests/shadow-dom/selection-direction.tentative.html
@@ -6,6 +6,9 @@
<link rel="help" href="https://w3c.github.io/selection-api/#dom-selection-getcomposedrange">
<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>
<div id="container"></div>
<script>
@@ -58,6 +61,45 @@ test(() => {
assert_equals(getSelection().direction, 'backward');
}, 'direction returns "backward" when there is a forward selection that crosses shadow boundaries');
+promise_test(async () => {
+ container.innerHTML = 'hello, world';
+ const doubleClick = new test_driver.Actions()
+ .pointerMove(0, 0, container.firstChild)
+ .pointerDown()
+ .pointerUp()
+ .pointerDown()
+ .pointerUp()
+ .send();
+ await doubleClick;
+
+ const sel = getSelection();
+ assert_equals(sel.anchorNode, container.firstChild);
+ assert_equals(sel.anchorOffset, 0);
+ assert_equals(sel.focusNode, container.firstChild);
+ assert_equals(sel.focusOffset, 5); // hello
+ assert_equals(sel.direction, 'none');
+}, 'direction returns "none" when there is a double click selection(directionless)');
+
+promise_test(async () => {
+ container.innerHTML = 'hello, world';
+ const tripleClick = new test_driver.Actions()
+ .pointerMove(0, 0, container.firstChild)
+ .pointerDown()
+ .pointerUp()
+ .pointerDown()
+ .pointerUp()
+ .pointerDown()
+ .pointerUp()
+ .send();
+ await tripleClick;
+
+ const sel = getSelection();
+ assert_equals(sel.anchorNode, container);
+ assert_equals(sel.anchorOffset, 0);
+ assert_equals(sel.focusNode, container);
+ assert_equals(sel.focusOffset, 1);
+ assert_equals(sel.direction, 'none');
+}, 'direction returns "none" when there is a triple click selection(directionless)');
</script>
</body>
</html>