зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1748018 - Make `HTMLEditUtils::GetFirstListItemElement` scan only within the given list element r=m_kato
It calls `nsINode::GetNextNode()` to scan first descendant list item in the list without specifying the root node to scan within. Therefore, it may return following list item element of the given list element if the list element does not have children. Differential Revision: https://phabricator.services.mozilla.com/D135110
This commit is contained in:
Родитель
88b259fb02
Коммит
0edb1a99b9
|
@ -1341,7 +1341,7 @@ class HTMLEditUtils final {
|
|||
MOZ_ASSERT(HTMLEditUtils::IsAnyListElement(&aListElement));
|
||||
for (nsIContent* maybeFirstListItem = aListElement.GetFirstChild();
|
||||
maybeFirstListItem;
|
||||
maybeFirstListItem = maybeFirstListItem->GetNextNode()) {
|
||||
maybeFirstListItem = maybeFirstListItem->GetNextNode(&aListElement)) {
|
||||
if (HTMLEditUtils::IsListItem(maybeFirstListItem)) {
|
||||
return maybeFirstListItem->AsElement();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html id="a">
|
||||
<meta charset="utf-8">
|
||||
<script id="b">
|
||||
window.onload = () => {
|
||||
c.appendChild(document.head)
|
||||
a.appendChild(d)
|
||||
document.execCommand("selectAll")
|
||||
document.execCommand("delete")
|
||||
}
|
||||
</script>
|
||||
<dl id="c" contenteditable="true">
|
||||
<dt id="d">
|
Загрузка…
Ссылка в новой задаче