Skip to content

Commit 6381b6c

Browse files
masayuki-nakanomoz-wptsync-bot
authored andcommitted
Make HTMLEditor::HandleHTMLIndentAroundRanges validate DOM tree in 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
1 parent 866ccc0 commit 6381b6c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<script>
6+
addEventListener("load", () => {
7+
const samp = document.createElement("samp");
8+
samp.innerText = "ABC";
9+
samp.contentEditable = true;
10+
document.documentElement.appendChild(samp);
11+
getSelection().selectAllChildren(samp);
12+
document.execCommand("indent");
13+
});
14+
</script>
15+
</head>
16+
<body>
17+
</body>
18+
</html>

0 commit comments

Comments
 (0)