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
|
* element which is in aArrayOfListAndTableElements and they are
|
||||||
* actually valid ancestor of at least one of aArrayOfTopMostChildContents.
|
* actually valid ancestor of at least one of aArrayOfTopMostChildContents.
|
||||||
*/
|
*/
|
||||||
Element* GetMostAncestorListOrTableElement(
|
static Element* GetMostAncestorListOrTableElement(
|
||||||
const nsTArray<OwningNonNull<nsIContent>>& aArrayOfTopMostChildContents,
|
const nsTArray<OwningNonNull<nsIContent>>& aArrayOfTopMostChildContents,
|
||||||
const nsTArray<OwningNonNull<Element>>&
|
const nsTArray<OwningNonNull<Element>>&
|
||||||
aArrayOfListAndTableRelatedElements) const;
|
aArrayOfListAndTableRelatedElements);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FindReplaceableTableElement() is a helper method of
|
* FindReplaceableTableElement() is a helper method of
|
||||||
|
@ -3122,15 +3122,15 @@ void HTMLEditor::AutoHTMLFragmentBoundariesFixer::
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
Element*
|
Element*
|
||||||
HTMLEditor::AutoHTMLFragmentBoundariesFixer::GetMostAncestorListOrTableElement(
|
HTMLEditor::AutoHTMLFragmentBoundariesFixer::GetMostAncestorListOrTableElement(
|
||||||
const nsTArray<OwningNonNull<nsIContent>>& aArrayOfTopMostChildContents,
|
const nsTArray<OwningNonNull<nsIContent>>& aArrayOfTopMostChildContents,
|
||||||
const nsTArray<OwningNonNull<Element>>& aArrayOfListAndTableRelatedElements)
|
const nsTArray<OwningNonNull<Element>>&
|
||||||
const {
|
aArrayOfListAndTableRelatedElements) {
|
||||||
Element* lastFoundAncestorListOrTableElement = nullptr;
|
Element* lastFoundAncestorListOrTableElement = nullptr;
|
||||||
for (auto& content : aArrayOfTopMostChildContents) {
|
for (auto& content : aArrayOfTopMostChildContents) {
|
||||||
if (HTMLEditUtils::IsAnyTableElement(content) &&
|
if (HTMLEditUtils::IsAnyTableElementButNotTable(content)) {
|
||||||
!content->IsHTMLElement(nsGkAtoms::table)) {
|
|
||||||
Element* tableElement = nullptr;
|
Element* tableElement = nullptr;
|
||||||
for (Element* maybeTableElement = content->GetParentElement();
|
for (Element* maybeTableElement = content->GetParentElement();
|
||||||
maybeTableElement;
|
maybeTableElement;
|
||||||
|
Loading…
Reference in New Issue
Block a user