Skip to content

Commit 451b62d

Browse files
masayuki-nakanomoz-wptsync-bot
authored andcommitted
Hide selection changes from web apps which are caused by the hacks of `HTMLEditor
The hacks are only for specific web apps. Therefore, unless they require to know the selection changes, we don't need to expose that. Differential Revision: https://phabricator.services.mozilla.com/D239835 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1949901 gecko-commit: e5966fe5bcf4a01c11e1844cc57dbef82f964d2f gecko-reviewers: m_kato
1 parent d48385d commit 451b62d

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+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<script>
6+
"use strict";
7+
8+
addEventListener("DOMContentLoaded", () => {
9+
document.addEventListener("selectstart", () => {
10+
window.find("A");
11+
document.body.prepend(document.getElementById("br"));
12+
});
13+
document.querySelector("picture").addEventListener("focusin", () => {
14+
document.body.prepend(document.getElementById("br"));
15+
});
16+
document.execCommand("selectAll");
17+
}, {once: true});
18+
</script>
19+
</head>
20+
<body>
21+
A
22+
<picture>
23+
<keygen tabindex="-1" autofocus>
24+
<q contenteditable>
25+
A
26+
<br id="br">
27+
<table></table>
28+
</q>
29+
</picture>
30+
</body>
31+
</html>

0 commit comments

Comments
 (0)