From 89958b377a0a39277424c07c453fd1eb36d0ef28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 25 May 2020 11:43:51 +0000 Subject: [PATCH] Bug 1640605 - Remove IsInAnonymousSubtree / IsRootOfAnonymousSubtree. r=edgar In favor of the NativeAnonymous versions which they forward to. Done automatically with: rg -l 'IsInAnonymousSubtree' | xargs sed -i 's/IsInAnonymousSubtree/IsInNativeAnonymousSubtree/g' And removing the function definitions afterwards. Differential Revision: https://phabricator.services.mozilla.com/D76681 --- accessible/base/AccIterator.cpp | 2 +- accessible/base/MarkupMap.h | 2 +- dom/base/ChildIterator.cpp | 2 +- dom/base/DirectionalityUtils.cpp | 4 ++-- dom/base/Document.cpp | 4 ++-- dom/base/Element.cpp | 6 +++--- dom/base/ShadowRoot.cpp | 4 ++-- dom/base/nsContentUtils.cpp | 2 +- dom/base/nsDOMMutationObserver.cpp | 2 +- dom/base/nsIContent.h | 10 ---------- dom/base/nsIContentInlines.h | 4 ++-- dom/base/nsINode.cpp | 6 +++--- dom/base/nsINode.h | 10 ---------- dom/events/Event.cpp | 2 +- dom/events/EventDispatcher.cpp | 2 +- dom/html/HTMLInputElement.cpp | 6 +++--- dom/html/nsGenericHTMLElement.cpp | 2 +- editor/libeditor/HTMLAnonymousNodeEditor.cpp | 2 +- .../spellcheck/src/mozInlineSpellChecker.cpp | 2 +- gfx/layers/apz/util/DoubleTapToZoom.cpp | 2 +- layout/base/PresShell.cpp | 2 +- layout/base/RestyleManager.cpp | 8 ++++---- layout/base/nsCSSFrameConstructor.cpp | 20 +++++++++---------- layout/forms/nsTextControlFrame.cpp | 2 +- layout/generic/nsFrame.cpp | 4 ++-- layout/generic/nsGfxScrollFrame.cpp | 2 +- layout/printing/nsPrintObject.cpp | 2 +- 27 files changed, 48 insertions(+), 68 deletions(-) diff --git a/accessible/base/AccIterator.cpp b/accessible/base/AccIterator.cpp index c6164dd6bcf2..99cb77764828 100644 --- a/accessible/base/AccIterator.cpp +++ b/accessible/base/AccIterator.cpp @@ -246,7 +246,7 @@ dom::Element* IDRefsIterator::GetElem(nsIContent* aContent, const nsAString& aID) { // Get elements in DOM tree by ID attribute if this is an explicit content. // In case of bound element check its anonymous subtree. - if (!aContent->IsInAnonymousSubtree()) { + if (!aContent->IsInNativeAnonymousSubtree()) { dom::DocumentOrShadowRoot* docOrShadowRoot = aContent->GetUncomposedDocOrConnectedShadowRoot(); if (docOrShadowRoot) { diff --git a/accessible/base/MarkupMap.h b/accessible/base/MarkupMap.h index 0445aa13abe0..956d1d392f40 100644 --- a/accessible/base/MarkupMap.h +++ b/accessible/base/MarkupMap.h @@ -66,7 +66,7 @@ MARKUPMAP( [](Element* aElement, Accessible* aContext) -> Accessible* { // Never create an accessible if we're part of an anonymous // subtree. - if (aElement->IsInAnonymousSubtree()) { + if (aElement->IsInNativeAnonymousSubtree()) { return nullptr; } // Always create an accessible if the div has an id. diff --git a/dom/base/ChildIterator.cpp b/dom/base/ChildIterator.cpp index 86dea6544ccb..e0cd1ca8db58 100644 --- a/dom/base/ChildIterator.cpp +++ b/dom/base/ChildIterator.cpp @@ -101,7 +101,7 @@ void FlattenedChildIterator::Init(bool aIgnoreXBL) { bool ExplicitChildIterator::Seek(const nsIContent* aChildToFind) { if (aChildToFind->GetParent() == mParent && - !aChildToFind->IsRootOfAnonymousSubtree()) { + !aChildToFind->IsRootOfNativeAnonymousSubtree()) { // Fast path: just point ourselves to aChildToFind, which is a // normal DOM child of ours. mChild = const_cast(aChildToFind); diff --git a/dom/base/DirectionalityUtils.cpp b/dom/base/DirectionalityUtils.cpp index efe20f9c661a..50c39809a164 100644 --- a/dom/base/DirectionalityUtils.cpp +++ b/dom/base/DirectionalityUtils.cpp @@ -285,7 +285,7 @@ static bool DoesNotParticipateInAutoDirection(const nsIContent* aContent) { nodeInfo->Equals(nsGkAtoms::style) || nodeInfo->Equals(nsGkAtoms::input) || nodeInfo->Equals(nsGkAtoms::textarea) || - aContent->IsInAnonymousSubtree())) && + aContent->IsInNativeAnonymousSubtree())) && !aContent->IsShadowRoot(); } @@ -320,7 +320,7 @@ inline static bool NodeAffectsDirAutoAncestor(nsIContent* aTextNode) { nsIContent* parent = GetParentOrHostOrSlot(aTextNode); return (parent && !DoesNotParticipateInAutoDirection(parent) && parent->NodeOrAncestorHasDirAuto() && - !aTextNode->IsInAnonymousSubtree()); + !aTextNode->IsInNativeAnonymousSubtree()); } Directionality GetDirectionFromText(const char16_t* aText, diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp index 09963b6419bd..a1b19e8b233f 100644 --- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp @@ -9273,7 +9273,7 @@ nsINode* Document::AdoptNode(nsINode& aAdoptedNode, ErrorResult& rv) { case COMMENT_NODE: case DOCUMENT_TYPE_NODE: { // Don't allow adopting a node's anonymous subtree out from under it. - if (adoptedNode->AsContent()->IsRootOfAnonymousSubtree()) { + if (adoptedNode->AsContent()->IsRootOfNativeAnonymousSubtree()) { rv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); return nullptr; } @@ -10706,7 +10706,7 @@ nsIContent* Document::GetContentInThisDocument(nsIFrame* aFrame) const { for (nsIFrame* f = aFrame; f; f = nsLayoutUtils::GetParentOrPlaceholderForCrossDoc(f)) { nsIContent* content = f->GetContent(); - if (!content || content->IsInAnonymousSubtree()) continue; + if (!content || content->IsInNativeAnonymousSubtree()) continue; if (content->OwnerDoc() == this) { return content; diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index a96d8cf68a37..ebf6abcaab06 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -922,7 +922,7 @@ void Element::AddToIdTable(nsAtom* aId) { containingShadow->AddToIdTable(this, aId); } else { Document* doc = GetUncomposedDoc(); - if (doc && !IsInAnonymousSubtree()) { + if (doc && !IsInNativeAnonymousSubtree()) { doc->AddToIdTable(this, aId); } } @@ -943,7 +943,7 @@ void Element::RemoveFromIdTable() { } } else { Document* doc = GetUncomposedDoc(); - if (doc && !IsInAnonymousSubtree()) { + if (doc && !IsInNativeAnonymousSubtree()) { doc->RemoveFromIdTable(this, id); } } @@ -1707,7 +1707,7 @@ void Element::UnbindFromTree(bool aNullParent) { if (HasServoData()) { MOZ_ASSERT(document); - MOZ_ASSERT(IsInAnonymousSubtree()); + MOZ_ASSERT(IsInNativeAnonymousSubtree()); } if (document) { diff --git a/dom/base/ShadowRoot.cpp b/dom/base/ShadowRoot.cpp index 89894aada61c..ef483ac46fc9 100644 --- a/dom/base/ShadowRoot.cpp +++ b/dom/base/ShadowRoot.cpp @@ -663,7 +663,7 @@ void ShadowRoot::MaybeUnslotHostChild(nsIContent& aChild) { return; } - MOZ_DIAGNOSTIC_ASSERT(!aChild.IsRootOfAnonymousSubtree(), + MOZ_DIAGNOSTIC_ASSERT(!aChild.IsRootOfNativeAnonymousSubtree(), "How did aChild end up assigned to a slot?"); // If the slot is going to start showing fallback content, we need to tell // layout about it. @@ -679,7 +679,7 @@ void ShadowRoot::MaybeSlotHostChild(nsIContent& aChild) { MOZ_ASSERT(aChild.GetParent() == GetHost()); // Check to ensure that the child not an anonymous subtree root because even // though its parent could be the host it may not be in the host's child list. - if (aChild.IsRootOfAnonymousSubtree()) { + if (aChild.IsRootOfNativeAnonymousSubtree()) { return; } diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 434005961122..0469f83fc0d5 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -2700,7 +2700,7 @@ void nsContentUtils::GenerateStateKey(nsIContent* aContent, Document* aDocument, uint32_t partID = aDocument ? aDocument->GetPartID() : 0; // Don't capture state for anonymous content - if (aContent->IsInAnonymousSubtree()) { + if (aContent->IsInNativeAnonymousSubtree()) { return; } diff --git a/dom/base/nsDOMMutationObserver.cpp b/dom/base/nsDOMMutationObserver.cpp index 39aea9f76e86..52a935282ed0 100644 --- a/dom/base/nsDOMMutationObserver.cpp +++ b/dom/base/nsDOMMutationObserver.cpp @@ -68,7 +68,7 @@ NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsDOMMutationRecord, mTarget, bool nsMutationReceiverBase::IsObservable(nsIContent* aContent) { return !aContent->ChromeOnlyAccess() && - (Observer()->IsChrome() || !aContent->IsInAnonymousSubtree()); + (Observer()->IsChrome() || !aContent->IsInNativeAnonymousSubtree()); } NS_IMPL_ADDREF(nsMutationReceiver) diff --git a/dom/base/nsIContent.h b/dom/base/nsIContent.h index bda73d924a95..0146aa63e37a 100644 --- a/dom/base/nsIContent.h +++ b/dom/base/nsIContent.h @@ -187,16 +187,6 @@ class nsIContent : public nsINode { */ nsIContent* FindFirstNonChromeOnlyAccessContent() const; - /** - * Returns true if and only if this node has a parent, but is not in - * its parent's child list. - * - * FIXME(emilio): Remove along nsINode::IsInAnonymousSubtree. - */ - bool IsRootOfAnonymousSubtree() const { - return IsRootOfNativeAnonymousSubtree(); - } - /** * Return true iff this node is in an HTML document (in the HTML5 sense of * the term, i.e. not in an XHTML/XML document). diff --git a/dom/base/nsIContentInlines.h b/dom/base/nsIContentInlines.h index 6ec10007767d..b6c62026f3e8 100644 --- a/dom/base/nsIContentInlines.h +++ b/dom/base/nsIContentInlines.h @@ -94,7 +94,7 @@ static inline nsINode* GetFlattenedTreeParentNode(const nsINode* aNode) { return docLevel ? content->OwnerDocAsNode() : parent; } - if (content->IsRootOfAnonymousSubtree()) { + if (content->IsRootOfNativeAnonymousSubtree()) { return parent; } @@ -171,7 +171,7 @@ inline void nsIContent::HandleInsertionToOrRemovalFromSlot() { using mozilla::dom::HTMLSlotElement; MOZ_ASSERT(GetParentElement()); - if (!IsInShadowTree() || IsRootOfAnonymousSubtree()) { + if (!IsInShadowTree() || IsRootOfNativeAnonymousSubtree()) { return; } HTMLSlotElement* slot = HTMLSlotElement::FromNode(mParent); diff --git a/dom/base/nsINode.cpp b/dom/base/nsINode.cpp index fe7f616da0fa..aba02dc286f2 100644 --- a/dom/base/nsINode.cpp +++ b/dom/base/nsINode.cpp @@ -774,7 +774,7 @@ nsINode* nsINode::RemoveChild(nsINode& aOldChild, ErrorResult& aError) { // Check again, we may not be the child's parent anymore. // Can be triggered by dom/base/crashtests/293388-1.html - if (aOldChild.AsContent()->IsRootOfAnonymousSubtree() || + if (aOldChild.AsContent()->IsRootOfNativeAnonymousSubtree() || aOldChild.GetParentNode() != this) { // aOldChild isn't one of our children. aError.ThrowNotFoundError( @@ -2302,7 +2302,7 @@ void nsINode::EnsurePreInsertionValidity2(bool aReplace, nsINode& aNewChild, nsINode* aRefChild, ErrorResult& aError) { if (aNewChild.IsContent() && - aNewChild.AsContent()->IsRootOfAnonymousSubtree()) { + aNewChild.AsContent()->IsRootOfNativeAnonymousSubtree()) { // This is anonymous content. Don't allow its insertion // anywhere, since it might have UnbindFromTree calls coming // its way. @@ -2748,7 +2748,7 @@ bool nsINode::Contains(const nsINode* aOther) const { // document.contains(aOther) returns true if aOther is in the document, // but is not in any anonymous subtree. // IsInUncomposedDoc() check is done already before this. - return !aOther->IsInAnonymousSubtree(); + return !aOther->IsInNativeAnonymousSubtree(); } if (!IsElement() && !IsDocumentFragment()) { diff --git a/dom/base/nsINode.h b/dom/base/nsINode.h index 4b95014dc58f..52af71eae489 100644 --- a/dom/base/nsINode.h +++ b/dom/base/nsINode.h @@ -1295,16 +1295,6 @@ class nsINode : public mozilla::dom::EventTarget { return HasFlag(NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE); } - /** - * Returns true if there is NOT a path through child lists - * from the top of this node's parent chain back to this node or - * if the node is in native anonymous subtree without a parent. - * - * TODO(emilio):: Remove this function, and use just - * IsInNativeAnonymousSubtree, or something? - */ - bool IsInAnonymousSubtree() const { return IsInNativeAnonymousSubtree(); } - /** * If |this| or any ancestor is native anonymous, return the root of the * native anonymous subtree. Note that in case of nested native anonymous diff --git a/dom/events/Event.cpp b/dom/events/Event.cpp index 3740ccd1b3c9..48894110a7e3 100644 --- a/dom/events/Event.cpp +++ b/dom/events/Event.cpp @@ -102,7 +102,7 @@ void Event::InitPresContextData(nsPresContext* aPresContext) { { nsCOMPtr content = GetTargetFromFrame(); mExplicitOriginalTarget = content; - if (content && content->IsInAnonymousSubtree()) { + if (content && content->IsInNativeAnonymousSubtree()) { mExplicitOriginalTarget = nullptr; } } diff --git a/dom/events/EventDispatcher.cpp b/dom/events/EventDispatcher.cpp index d12600492245..c25bff12310d 100644 --- a/dom/events/EventDispatcher.cpp +++ b/dom/events/EventDispatcher.cpp @@ -892,7 +892,7 @@ nsresult EventDispatcher::Dispatch(nsISupports* aTarget, bool clearTargets = false; nsCOMPtr content = do_QueryInterface(aEvent->mOriginalTarget); - bool isInAnon = content && content->IsInAnonymousSubtree(); + bool isInAnon = content && content->IsInNativeAnonymousSubtree(); aEvent->mFlags.mIsBeingDispatched = true; diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp index d9c9262095a9..eec6753e23a6 100644 --- a/dom/html/HTMLInputElement.cpp +++ b/dom/html/HTMLInputElement.cpp @@ -2862,7 +2862,7 @@ nsIRadioGroupContainer* HTMLInputElement::GetRadioGroupContainer() const { return mForm; } - if (IsInAnonymousSubtree()) { + if (IsInNativeAnonymousSubtree()) { return nullptr; } @@ -6059,8 +6059,8 @@ bool HTMLInputElement::AllowDrop() { void HTMLInputElement::AddedToRadioGroup() { // If the element is neither in a form nor a document, there is no group so we // should just stop here. - if (!mForm && - (!GetUncomposedDocOrConnectedShadowRoot() || IsInAnonymousSubtree())) { + if (!mForm && (!GetUncomposedDocOrConnectedShadowRoot() || + IsInNativeAnonymousSubtree())) { return; } diff --git a/dom/html/nsGenericHTMLElement.cpp b/dom/html/nsGenericHTMLElement.cpp index f4b61e9ec28d..52f52d548df9 100644 --- a/dom/html/nsGenericHTMLElement.cpp +++ b/dom/html/nsGenericHTMLElement.cpp @@ -146,7 +146,7 @@ static const nsAttrValue::EnumTable kDirTable[] = { void nsGenericHTMLElement::AddToNameTable(nsAtom* aName) { MOZ_ASSERT(HasName(), "Node doesn't have name?"); Document* doc = GetUncomposedDoc(); - if (doc && !IsInAnonymousSubtree()) { + if (doc && !IsInNativeAnonymousSubtree()) { doc->AddToNameTable(this, aName); } } diff --git a/editor/libeditor/HTMLAnonymousNodeEditor.cpp b/editor/libeditor/HTMLAnonymousNodeEditor.cpp index 04ce38c0b8b2..3a15b7a6d38a 100644 --- a/editor/libeditor/HTMLAnonymousNodeEditor.cpp +++ b/editor/libeditor/HTMLAnonymousNodeEditor.cpp @@ -248,7 +248,7 @@ void HTMLEditor::DeleteRefToAnonymousNode(ManualNACPtr aContent, // See bug 338129. if (aContent->IsInComposedDoc() && aPresShell && !aPresShell->IsDestroying()) { - MOZ_ASSERT(aContent->IsRootOfAnonymousSubtree()); + MOZ_ASSERT(aContent->IsRootOfNativeAnonymousSubtree()); MOZ_ASSERT(!aContent->GetPreviousSibling(), "NAC has no siblings"); // FIXME(emilio): This is the only caller to PresShell::ContentRemoved that diff --git a/extensions/spellcheck/src/mozInlineSpellChecker.cpp b/extensions/spellcheck/src/mozInlineSpellChecker.cpp index cb29a41e0171..ebba991eae03 100644 --- a/extensions/spellcheck/src/mozInlineSpellChecker.cpp +++ b/extensions/spellcheck/src/mozInlineSpellChecker.cpp @@ -1082,7 +1082,7 @@ bool mozInlineSpellChecker::ShouldSpellCheckNode(TextEditor* aTextEditor, // Make sure that we can always turn on spell checking for inputs/textareas. // Note that because of the previous check, at this point we know that the // node is editable. - if (content->IsInAnonymousSubtree()) { + if (content->IsInNativeAnonymousSubtree()) { nsIContent* node = content->GetParent(); while (node && node->IsInNativeAnonymousSubtree()) { node = node->GetParent(); diff --git a/gfx/layers/apz/util/DoubleTapToZoom.cpp b/gfx/layers/apz/util/DoubleTapToZoom.cpp index 159146c03ba0..2ff48431adc0 100644 --- a/gfx/layers/apz/util/DoubleTapToZoom.cpp +++ b/gfx/layers/apz/util/DoubleTapToZoom.cpp @@ -43,7 +43,7 @@ static already_AddRefed ElementFromPoint( RelativeTo{rootFrame, ViewportType::Visual}, CSSPoint::ToAppUnits(aPoint), {FrameForPointOption::IgnorePaintSuppression}); while (frame && (!frame->GetContent() || - frame->GetContent()->IsInAnonymousSubtree())) { + frame->GetContent()->IsInNativeAnonymousSubtree())) { frame = nsLayoutUtils::GetParentOrPlaceholderFor(frame); } if (!frame) { diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index 523879b2020a..47e2781e9f1c 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -4402,7 +4402,7 @@ MOZ_CAN_RUN_SCRIPT_BOUNDARY void PresShell::ContentRemoved( // Editor calls into here with NAC via HTMLEditor::DeleteRefToAnonymousNode. // This could be asserted if that caller is fixed. - if (MOZ_LIKELY(!aChild->IsRootOfAnonymousSubtree())) { + if (MOZ_LIKELY(!aChild->IsRootOfNativeAnonymousSubtree())) { oldNextSibling = aPreviousSibling ? aPreviousSibling->GetNextSibling() : container->GetFirstChild(); } diff --git a/layout/base/RestyleManager.cpp b/layout/base/RestyleManager.cpp index b11661933465..fdccd90c49b1 100644 --- a/layout/base/RestyleManager.cpp +++ b/layout/base/RestyleManager.cpp @@ -90,7 +90,7 @@ void RestyleManager::ContentAppended(nsIContent* aFirstNewContent) { #ifdef DEBUG { for (nsIContent* cur = aFirstNewContent; cur; cur = cur->GetNextSibling()) { - NS_ASSERTION(!cur->IsRootOfAnonymousSubtree(), + NS_ASSERTION(!cur->IsRootOfNativeAnonymousSubtree(), "anonymous nodes should not be in child lists"); } } @@ -265,7 +265,7 @@ void RestyleManager::CharacterDataChanged( return; } - if (MOZ_UNLIKELY(aContent->IsRootOfAnonymousSubtree())) { + if (MOZ_UNLIKELY(aContent->IsRootOfNativeAnonymousSubtree())) { // This is an anonymous node and thus isn't in child lists, so isn't taken // into account for selector matching the relevant selectors here. return; @@ -333,7 +333,7 @@ void RestyleManager::RestyleForInsertOrChange(nsIContent* aChild) { } Element* container = parentNode->AsElement(); - NS_ASSERTION(!aChild->IsRootOfAnonymousSubtree(), + NS_ASSERTION(!aChild->IsRootOfNativeAnonymousSubtree(), "anonymous nodes should not be in child lists"); uint32_t selectorFlags = container->GetFlags() & NODE_ALL_SELECTOR_FLAGS; if (selectorFlags == 0) return; @@ -383,7 +383,7 @@ void RestyleManager::ContentRemoved(nsIContent* aOldChild, } Element* container = aOldChild->GetParentNode()->AsElement(); - if (aOldChild->IsRootOfAnonymousSubtree()) { + if (aOldChild->IsRootOfNativeAnonymousSubtree()) { // This should be an assert, but this is called incorrectly in // HTMLEditor::DeleteRefToAnonymousNode and the assertions were clogging // up the logs. Make it an assert again when that's fixed. diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 9bd68e93fe26..a3667458c2ac 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -5176,7 +5176,7 @@ static bool ShouldSuppressFrameInSelect(const nsIContent* aParent, // Options with labels have their label text added in ::before by forms.css. // Suppress frames for their child text. if (aParent->IsHTMLElement(nsGkAtoms::option) && - !aChild.IsRootOfAnonymousSubtree()) { + !aChild.IsRootOfNativeAnonymousSubtree()) { return aParent->AsElement()->HasNonEmptyAttr(nsGkAtoms::label); } @@ -5200,7 +5200,7 @@ static bool ShouldSuppressFrameInSelect(const nsIContent* aParent, } // Allow native anonymous content no matter what. - if (aChild.IsRootOfAnonymousSubtree()) { + if (aChild.IsRootOfNativeAnonymousSubtree()) { return false; } @@ -5224,7 +5224,7 @@ static bool ShouldSuppressFrameInNonOpenDetails( } // Don't suppress NAC, unless it's a ::before, inside ::marker, or ::after. - if (aChild.IsRootOfAnonymousSubtree() && + if (aChild.IsRootOfNativeAnonymousSubtree() && !(aChild.IsGeneratedContentContainerForMarker() && aComputedStyle->StyleList()->mListStylePosition == NS_STYLE_LIST_STYLE_POSITION_INSIDE) && @@ -6209,8 +6209,8 @@ nsIFrame* nsCSSFrameConstructor::GetInsertionPrevSibling( // XBL insertion point is involved, we'll need to use _that_ to find // the preceding frame. FlattenedChildIterator iter(aInsertion->mContainer); - if (iter.ShadowDOMInvolved() || !aChild->IsRootOfAnonymousSubtree()) { - // The check for IsRootOfAnonymousSubtree() is because editor is + if (iter.ShadowDOMInvolved() || !aChild->IsRootOfNativeAnonymousSubtree()) { + // The check for IsRootOfNativeAnonymousSubtree() is because editor is // severely broken and calls us directly for native anonymous // nodes that it creates. if (aStartSkipChild) { @@ -7136,7 +7136,7 @@ void nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aStartChild, if (isSingleInsert) { AddFrameConstructionItems(state, aStartChild, - aStartChild->IsRootOfAnonymousSubtree(), + aStartChild->IsRootOfNativeAnonymousSubtree(), insertion, items); } else { for (nsIContent* child = aStartChild; child != aEndChild; @@ -7301,7 +7301,7 @@ bool nsCSSFrameConstructor::ContentRemoved(nsIContent* aChild, nsIContent* aOldNextSibling, RemoveFlags aFlags) { MOZ_ASSERT(aChild); - MOZ_ASSERT(!aChild->IsRootOfAnonymousSubtree() || !aOldNextSibling, + MOZ_ASSERT(!aChild->IsRootOfNativeAnonymousSubtree() || !aOldNextSibling, "Anonymous roots don't have siblings"); AUTO_PROFILER_LABEL("nsCSSFrameConstructor::ContentRemoved", LAYOUT_FrameConstruction); @@ -8557,7 +8557,7 @@ void nsCSSFrameConstructor::RecreateFramesForContent( MOZ_ASSERT(aContent->GetParentNode()); // Remove the frames associated with the content object. - nsIContent* nextSibling = aContent->IsRootOfAnonymousSubtree() + nsIContent* nextSibling = aContent->IsRootOfNativeAnonymousSubtree() ? nullptr : aContent->GetNextSibling(); bool didReconstruct = @@ -8587,7 +8587,7 @@ void nsCSSFrameConstructor::RecreateFramesForContent( bool nsCSSFrameConstructor::DestroyFramesFor(Element* aElement) { MOZ_ASSERT(aElement && aElement->GetParentNode()); - nsIContent* nextSibling = aElement->IsRootOfAnonymousSubtree() + nsIContent* nextSibling = aElement->IsRootOfNativeAnonymousSubtree() ? nullptr : aElement->GetNextSibling(); @@ -9531,7 +9531,7 @@ void nsCSSFrameConstructor::ProcessChildren( GetAnonymousContent(aContent, aPossiblyLeafFrame, anonymousItems); #ifdef DEBUG for (uint32_t i = 0; i < anonymousItems.Length(); ++i) { - MOZ_ASSERT(anonymousItems[i].mContent->IsRootOfAnonymousSubtree(), + MOZ_ASSERT(anonymousItems[i].mContent->IsRootOfNativeAnonymousSubtree(), "Content should know it's an anonymous subtree"); } #endif diff --git a/layout/forms/nsTextControlFrame.cpp b/layout/forms/nsTextControlFrame.cpp index 7d599384da1d..5bb846c3d103 100644 --- a/layout/forms/nsTextControlFrame.cpp +++ b/layout/forms/nsTextControlFrame.cpp @@ -154,7 +154,7 @@ void nsTextControlFrame::DestroyFrom(nsIFrame* aDestructRoot, if (mClass == kClassID) { aPostDestroyData.AddAnonymousContent(mRootNode.forget()); } else { - MOZ_ASSERT(!mRootNode || !mRootNode->IsRootOfAnonymousSubtree()); + MOZ_ASSERT(!mRootNode || !mRootNode->IsRootOfNativeAnonymousSubtree()); mRootNode = nullptr; } diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 462526e9de1d..d3f5535db254 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -5306,7 +5306,7 @@ static FrameContentRange GetRangeForFrame(nsIFrame* aFrame) { return FrameContentRange(parent, beginOffset, beginOffset); } - while (content->IsRootOfAnonymousSubtree()) { + while (content->IsRootOfNativeAnonymousSubtree()) { content = content->GetParent(); } @@ -10206,7 +10206,7 @@ static nsIFrame* GetCorrectedParent(const nsIFrame* aFrame) { if (element && !element->IsRootOfNativeAnonymousSubtree() && element->GetPseudoElementType() == aFrame->Style()->GetPseudoType()) { while (parent->GetContent() && - !parent->GetContent()->IsRootOfAnonymousSubtree()) { + !parent->GetContent()->IsRootOfNativeAnonymousSubtree()) { parent = parent->GetInFlowParent(); } parent = parent->GetInFlowParent(); diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index eb8ce0eb2339..aee725689c36 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -1379,7 +1379,7 @@ static bool IsFocused(nsIContent* aContent) { // for a text input field, are inside anonymous subtrees, but the focus // manager always reports a non-anonymous element as the focused one, so // walk up the tree until we reach a non-anonymous element. - while (aContent && aContent->IsInAnonymousSubtree()) { + while (aContent && aContent->IsInNativeAnonymousSubtree()) { aContent = aContent->GetParent(); } diff --git a/layout/printing/nsPrintObject.cpp b/layout/printing/nsPrintObject.cpp index 7836dff67b72..426847c6a5a7 100644 --- a/layout/printing/nsPrintObject.cpp +++ b/layout/printing/nsPrintObject.cpp @@ -70,7 +70,7 @@ static nsINode* GetCorrespondingNodeInDocument(const nsINode* aOrigNode, MOZ_ASSERT(aOrigNode); // Selections in anonymous subtrees aren't supported. - if (aOrigNode->IsInAnonymousSubtree() || aOrigNode->IsInShadowTree()) { + if (aOrigNode->IsInNativeAnonymousSubtree() || aOrigNode->IsInShadowTree()) { return nullptr; }