Skip to content

Commit bbb3bb0

Browse files
saschanazmoz-wptsync-bot
authored andcommitted
Set selection as dirty when unbinding from frame
Differential Revision: https://phabricator.services.mozilla.com/D268527 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1993351 gecko-commit: a0e6fc95407993cca739629778fd25820f816a0a gecko-reviewers: masayuki
1 parent b821fbd commit bbb3bb0

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
<script src="/resources/testharness.js"></script>
4+
<script src="/resources/testharnessreport.js"></script>
5+
<script src="/resources/testdriver.js"></script>
6+
<script src="/resources/testdriver-vendor.js"></script>
7+
<script src="/resources/testdriver-actions.js"></script>
8+
<textarea id="t" style="white-space: nowrap">Hello</textarea>
9+
<script>
10+
promise_test(async () => {
11+
t.focus();
12+
if (navigator.userAgent.includes("Mac")) {
13+
// Meta+ArrowLeft
14+
await new test_driver.Actions()
15+
.keyDown("\uE03D")
16+
.keyDown("\uE058")
17+
.keyUp("\uE058")
18+
.keyUp("\uE03D")
19+
.send();
20+
} else {
21+
// Home
22+
await test_driver.send_keys(t, ["\uE011"]);
23+
}
24+
// And then Delete
25+
await test_driver.send_keys(t, ["\uE017"]);
26+
t.style.whiteSpace = "pre-line";
27+
await new Promise(setTimeout);
28+
assert_equals(t.selectionStart, 0, "selectionStart should remain 0");
29+
assert_equals(t.selectionEnd, 0, "selectionEnd should remain 0");
30+
}, "Changing white-space should not change selection");
31+
</script>

0 commit comments

Comments
 (0)