mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 16:25:38 +00:00
d9e3ea7e57
`HTMLEditor` initializes selection ancestor limit when it receives `focus` event. If `Document.execCommand()` is called immediately after an ancestor of active editing host becomes new editing host, `HTMLEditor::GetActiveEditingHost()` returns the new one, but selection ancestor limit is still the previous one. This mismatch causes a lot of bugs. Therefore, this patch makes `nsGenericHTMLElement` notifies `HTMLEditor` of an element becoming `contenteditable`, and makes `HTMLEditor` update selection ancestor limit only when the new editing host is ancestor of old selection ancestor limit. Differential Revision: https://phabricator.services.mozilla.com/D32823 --HG-- extra : moz-landing-system : lando
18 lines
389 B
HTML
18 lines
389 B
HTML
<script>
|
|
function go() {
|
|
a.setAttribute("contenteditable", "true");
|
|
b.addEventListener("DOMNodeRemoved", eh);
|
|
b.appendChild(c);
|
|
}
|
|
function eh() {
|
|
document.body.appendChild(b);
|
|
document.execCommand("justifyFull", false);
|
|
document.execCommand("delete", false);
|
|
}
|
|
</script>
|
|
<body onload=go()>
|
|
<li id="a">
|
|
A
|
|
<pre id="b" contenteditable="true">
|
|
<input autofocus="autofocus" id="c">
|