Skip to content

Commit

Permalink
Make HTMLEditor::HandleHTMLIndentAroundRanges validate DOM tree in …
Browse files Browse the repository at this point in the history
…each time of the loop

There are 2 possible scenarios which are not handled by the method.

1. Moving content node to new `<blockquote>` has already been moved to outside
of the editing host.
2. There is no container to insert new `<blockquote>`, e.g., in an inline
editing host.

In the case #1, we should ignore the ex-child node.  In the case #2, we should
abort it.  Note that Chrome inserts `<blockquote>` even if there is no proper
container.  However, such behavior is disagreed in interop-2023.  Therefore,
it's okay just to abort it for now.

Depends on D180781

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

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1756237
gecko-commit: 42f3f3ab11b47f1d56d8bcd6a128398539dd1f23
gecko-reviewers: m_kato
  • Loading branch information
masayuki-nakano authored and moz-wptsync-bot committed Jun 16, 2023
1 parent 866ccc0 commit 6381b6c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions editing/crashtests/indent-in-inline-editing-host-outside-body.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script>
addEventListener("load", () => {
const samp = document.createElement("samp");
samp.innerText = "ABC";
samp.contentEditable = true;
document.documentElement.appendChild(samp);
getSelection().selectAllChildren(samp);
document.execCommand("indent");
});
</script>
</head>
<body>
</body>
</html>

0 comments on commit 6381b6c

Please sign in to comment.