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
This commit is contained in:
committed by
ealvarez@mozilla.com
parent
a1581baad2
commit
5edae9ae71
@@ -8753,39 +8753,6 @@ void Document::RemoveAnonymousContent(AnonymousContent& aContent) {
|
||||
}
|
||||
}
|
||||
|
||||
Element* Document::GetAnonRootIfInAnonymousContentContainer(
|
||||
nsINode* aNode) const {
|
||||
if (!aNode->IsInNativeAnonymousSubtree()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PresShell* presShell = GetPresShell();
|
||||
if (!presShell || !presShell->GetCanvasFrame()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
nsCOMPtr<Element> customContainer =
|
||||
presShell->GetCanvasFrame()->GetCustomContentContainer();
|
||||
if (!customContainer) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// An arbitrary number of elements can be inserted as children of the custom
|
||||
// container frame. We want the one that was added that contains aNode, so
|
||||
// we need to keep track of the last child separately using |child| here.
|
||||
nsINode* child = aNode;
|
||||
nsINode* parent = aNode->GetParentNode();
|
||||
while (parent && parent->IsInNativeAnonymousSubtree()) {
|
||||
if (parent == customContainer) {
|
||||
return Element::FromNode(child);
|
||||
}
|
||||
child = parent;
|
||||
parent = child->GetParentNode();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Maybe<ClientInfo> Document::GetClientInfo() const {
|
||||
if (const Document* orig = GetOriginalDocument()) {
|
||||
if (Maybe<ClientInfo> info = orig->GetClientInfo()) {
|
||||
|
||||
@@ -1310,13 +1310,6 @@ class Document : public nsINode,
|
||||
already_AddRefed<AnonymousContent> InsertAnonymousContent(bool aForce,
|
||||
ErrorResult&);
|
||||
void RemoveAnonymousContent(AnonymousContent&);
|
||||
/**
|
||||
* If aNode is a descendant of anonymous content inserted by
|
||||
* InsertAnonymousContent, this method returns the root element of the
|
||||
* inserted anonymous content (in other words, the clone of the aElement
|
||||
* that was passed to InsertAnonymousContent).
|
||||
*/
|
||||
Element* GetAnonRootIfInAnonymousContentContainer(nsINode* aNode) const;
|
||||
nsTArray<RefPtr<AnonymousContent>>& GetAnonymousContents() {
|
||||
return mAnonymousContents;
|
||||
}
|
||||
|
||||
@@ -80,20 +80,6 @@ void IDTracker::ResetToURIWithFragmentID(Element& aFrom, nsIURI* aURI,
|
||||
return;
|
||||
}
|
||||
|
||||
if (aFrom.IsInNativeAnonymousSubtree()) {
|
||||
// This happens, for example, if aFromContent is part of the content
|
||||
// inserted by a call to Document::InsertAnonymousContent, which we
|
||||
// also want to handle. (It also happens for other native anonymous content
|
||||
// etc.)
|
||||
Element* anonRoot = doc->GetAnonRootIfInAnonymousContentContainer(&aFrom);
|
||||
if (anonRoot) {
|
||||
mElement = nsContentUtils::MatchElementId(anonRoot, ref);
|
||||
// We don't have watching working yet for anonymous content, so bail out
|
||||
// here.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bool isEqualExceptRef;
|
||||
rv = aURI->EqualsExceptRef(doc->GetDocumentURI(), &isEqualExceptRef);
|
||||
RefPtr<nsAtom> refAtom = NS_Atomize(ref);
|
||||
|
||||
Reference in New Issue
Block a user