Skip to content

Commit d6fa29d

Browse files
committed
Bug 1967507 - Remove Document::GetAnonRootIfInAnonymousContentContainer. r=smaug
These bits are not needed now that AnonymousContent uses shadow DOM. Differential Revision: https://phabricator.services.mozilla.com/D250530 UltraBlame original commit: 67b772c75494f55d23ebfd97802c617175ff3336
1 parent 3e2981d commit d6fa29d

File tree

3 files changed

+0
-54
lines changed

3 files changed

+0
-54
lines changed

dom/base/Document.cpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8753,39 +8753,6 @@ void Document::RemoveAnonymousContent(AnonymousContent& aContent) {
87538753
}
87548754
}
87558755

8756-
Element* Document::GetAnonRootIfInAnonymousContentContainer(
8757-
nsINode* aNode) const {
8758-
if (!aNode->IsInNativeAnonymousSubtree()) {
8759-
return nullptr;
8760-
}
8761-
8762-
PresShell* presShell = GetPresShell();
8763-
if (!presShell || !presShell->GetCanvasFrame()) {
8764-
return nullptr;
8765-
}
8766-
8767-
nsAutoScriptBlocker scriptBlocker;
8768-
nsCOMPtr<Element> customContainer =
8769-
presShell->GetCanvasFrame()->GetCustomContentContainer();
8770-
if (!customContainer) {
8771-
return nullptr;
8772-
}
8773-
8774-
8775-
8776-
8777-
nsINode* child = aNode;
8778-
nsINode* parent = aNode->GetParentNode();
8779-
while (parent && parent->IsInNativeAnonymousSubtree()) {
8780-
if (parent == customContainer) {
8781-
return Element::FromNode(child);
8782-
}
8783-
child = parent;
8784-
parent = child->GetParentNode();
8785-
}
8786-
return nullptr;
8787-
}
8788-
87898756
Maybe<ClientInfo> Document::GetClientInfo() const {
87908757
if (const Document* orig = GetOriginalDocument()) {
87918758
if (Maybe<ClientInfo> info = orig->GetClientInfo()) {

dom/base/Document.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,13 +1310,6 @@ class Document : public nsINode,
13101310
already_AddRefed<AnonymousContent> InsertAnonymousContent(bool aForce,
13111311
ErrorResult&);
13121312
void RemoveAnonymousContent(AnonymousContent&);
1313-
1314-
1315-
1316-
1317-
1318-
1319-
Element* GetAnonRootIfInAnonymousContentContainer(nsINode* aNode) const;
13201313
nsTArray<RefPtr<AnonymousContent>>& GetAnonymousContents() {
13211314
return mAnonymousContents;
13221315
}

dom/base/IDTracker.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,20 +80,6 @@ void IDTracker::ResetToURIWithFragmentID(Element& aFrom, nsIURI* aURI,
8080
return;
8181
}
8282

83-
if (aFrom.IsInNativeAnonymousSubtree()) {
84-
85-
86-
87-
88-
Element* anonRoot = doc->GetAnonRootIfInAnonymousContentContainer(&aFrom);
89-
if (anonRoot) {
90-
mElement = nsContentUtils::MatchElementId(anonRoot, ref);
91-
92-
93-
return;
94-
}
95-
}
96-
9783
bool isEqualExceptRef;
9884
rv = aURI->EqualsExceptRef(doc->GetDocumentURI(), &isEqualExceptRef);
9985
RefPtr<nsAtom> refAtom = NS_Atomize(ref);

0 commit comments

Comments
 (0)