Skip to content

Commit

Permalink
Make `HTMLEditor::AutoDeleteRangesHandler::HandleDeleteNonCollapsedRa…
Browse files Browse the repository at this point in the history
…nges` check if handling range is still editable

In the testcase, editing host is removed when first node removing, but
`HTMLEditor::Destroyed()` still returns `false`.  So, ideally, we should add
a check of editing host validity in `Destroyed()`, but for now, we should make
the method check whether the handling range is still editable after running
each transaction.

Depends on D147723

Differential Revision: https://phabricator.services.mozilla.com/D147724

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1771809
gecko-commit: 8b7e176bb5e0e5abd88dfe5ba66083050468900b
gecko-reviewers: m_kato
  • Loading branch information
masayuki-nakano authored and pull[bot] committed Nov 2, 2023
1 parent c3ad263 commit 1143942
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<script>
addEventListener("DOMContentLoaded", () => {
document.querySelector("dd[contenteditable]").focus();
document.querySelector("dd[contenteditable]").addEventListener("DOMNodeRemoved", () => {
document.querySelector("h6").textContent = "";
});
document.execCommand("selectAll");
document.execCommand("delete");
})
</script>
<h6>
<dd contenteditable>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<script>
addEventListener("DOMContentLoaded", () => {
document.querySelector("dd[contenteditable]").blur();
document.querySelector("dd[contenteditable]").addEventListener("DOMNodeRemoved", () => {
document.querySelector("h6").textContent = "";
});
document.execCommand("selectAll");
document.execCommand("delete");
})
</script>
<h6>
<dd contenteditable>

0 comments on commit 1143942

Please sign in to comment.