Bug 1658472 - part 4: Make AutoInclusiveAncestorBlockElementsJoiner store new list element tag name with its member r=m_kato

Depends on D86883

Differential Revision: https://phabricator.services.mozilla.com/D86884
This commit is contained in:
Masayuki Nakano 2020-08-17 10:24:13 +00:00
parent 3e0a1d8d61
commit 5d03594318
2 changed files with 5 additions and 5 deletions

View File

@ -4653,7 +4653,6 @@ EditActionResult HTMLEditor::AutoBlockElementsJoiner::
// Special rule here: if we are trying to join list items, and they are in
// different lists, join the lists instead.
Maybe<nsAtom*> newListElementTagNameOfRightListElement;
if (HTMLEditUtils::IsListItem(mLeftBlockElement) &&
HTMLEditUtils::IsListItem(mRightBlockElement)) {
// XXX leftListElement and/or rightListElement may be not list elements.
@ -4673,7 +4672,7 @@ EditActionResult HTMLEditor::AutoBlockElementsJoiner::
MOZ_DIAGNOSTIC_ASSERT(!atChildInBlock.IsSet());
mLeftBlockElement = leftListElement;
mRightBlockElement = rightListElement;
newListElementTagNameOfRightListElement =
mNewListElementTagNameOfRightListElement =
Some(leftListElement->NodeInfo()->NameAtom());
}
}
@ -4688,7 +4687,7 @@ EditActionResult HTMLEditor::AutoBlockElementsJoiner::
MergeFirstLineOfRightBlockElementIntoDescendantLeftBlockElement(
aHTMLEditor, MOZ_KnownLive(*mLeftBlockElement),
MOZ_KnownLive(*mRightBlockElement), atRightBlockChild,
newListElementTagNameOfRightListElement);
mNewListElementTagNameOfRightListElement);
NS_WARNING_ASSERTION(result.Succeeded(),
"WhiteSpaceVisibilityKeeper::"
"MergeFirstLineOfRightBlockElementIntoDescendantLeftBl"
@ -4712,7 +4711,7 @@ EditActionResult HTMLEditor::AutoBlockElementsJoiner::
aHTMLEditor, MOZ_KnownLive(*mLeftBlockElement),
MOZ_KnownLive(*mRightBlockElement), atLeftBlockChild,
MOZ_KnownLive(*mInclusiveDescendantOfLeftBlockElement),
newListElementTagNameOfRightListElement);
mNewListElementTagNameOfRightListElement);
NS_WARNING_ASSERTION(result.Succeeded(),
"WhiteSpaceVisibilityKeeper::"
"MergeFirstLineOfRightBlockElementIntoAncestorLeftBloc"
@ -4728,7 +4727,7 @@ EditActionResult HTMLEditor::AutoBlockElementsJoiner::
MergeFirstLineOfRightBlockElementIntoLeftBlockElement(
aHTMLEditor, MOZ_KnownLive(*mLeftBlockElement),
MOZ_KnownLive(*mRightBlockElement),
newListElementTagNameOfRightListElement);
mNewListElementTagNameOfRightListElement);
NS_WARNING_ASSERTION(
result.Succeeded(),
"WhiteSpaceVisibilityKeeper::"

View File

@ -2972,6 +2972,7 @@ class HTMLEditor final : public TextEditor,
OwningNonNull<nsIContent> mInclusiveDescendantOfRightBlockElement;
RefPtr<Element> mLeftBlockElement;
RefPtr<Element> mRightBlockElement;
Maybe<nsAtom*> mNewListElementTagNameOfRightListElement;
};
enum class Mode {