mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 00:05:36 +00:00
Bug 1649121: part 9) Simplify GetMostAncestorListOrTableElement
. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D81547
This commit is contained in:
parent
4477882999
commit
fb374f2e74
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user