Bug 1649121: part 9) Simplify GetMostAncestorListOrTableElement. r=masayuki

Differential Revision: https://phabricator.services.mozilla.com/D81547
This commit is contained in:
Mirko Brodesser 2020-06-30 13:13:12 +00:00
parent 4477882999
commit fb374f2e74
2 changed files with 6 additions and 6 deletions

View File

@ -4476,10 +4476,10 @@ class HTMLEditor final : public TextEditor,
* element which is in aArrayOfListAndTableElements and they are
* actually valid ancestor of at least one of aArrayOfTopMostChildContents.
*/
Element* GetMostAncestorListOrTableElement(
static Element* GetMostAncestorListOrTableElement(
const nsTArray<OwningNonNull<nsIContent>>& aArrayOfTopMostChildContents,
const nsTArray<OwningNonNull<Element>>&
aArrayOfListAndTableRelatedElements) const;
aArrayOfListAndTableRelatedElements);
/**
* FindReplaceableTableElement() is a helper method of

View File

@ -3122,15 +3122,15 @@ void HTMLEditor::AutoHTMLFragmentBoundariesFixer::
}
}
// static
Element*
HTMLEditor::AutoHTMLFragmentBoundariesFixer::GetMostAncestorListOrTableElement(
const nsTArray<OwningNonNull<nsIContent>>& aArrayOfTopMostChildContents,
const nsTArray<OwningNonNull<Element>>& aArrayOfListAndTableRelatedElements)
const {
const nsTArray<OwningNonNull<Element>>&
aArrayOfListAndTableRelatedElements) {
Element* lastFoundAncestorListOrTableElement = nullptr;
for (auto& content : aArrayOfTopMostChildContents) {
if (HTMLEditUtils::IsAnyTableElement(content) &&
!content->IsHTMLElement(nsGkAtoms::table)) {
if (HTMLEditUtils::IsAnyTableElementButNotTable(content)) {
Element* tableElement = nullptr;
for (Element* maybeTableElement = content->GetParentElement();
maybeTableElement;