Bug 1415588 part 4. Move the .anchors getter from HTMLDocument to Document. r=mystor

MozReview-Commit-ID: 2uqt9cdz6y7
This commit is contained in:
Boris Zbarsky
2018-03-12 21:44:57 -04:00
parent 2ffd523b10
commit 4627e6ad5e
7 changed files with 22 additions and 80 deletions

View File

@@ -196,7 +196,6 @@ nsHTMLDocument::~nsHTMLDocument()
NS_IMPL_CYCLE_COLLECTION_INHERITED(nsHTMLDocument, nsDocument,
mAll,
mAnchors,
mWyciwygChannel,
mMidasCommandManager)
@@ -1047,39 +1046,6 @@ nsHTMLDocument::SetDomain(const nsAString& aDomain, ErrorResult& rv)
rv = NodePrincipal()->SetDomain(newURI);
}
bool
nsHTMLDocument::MatchAnchors(Element* aElement, int32_t aNamespaceID,
nsAtom* aAtom, void* aData)
{
NS_ASSERTION(aElement->IsInUncomposedDoc(),
"This method should never be called on content nodes that "
"are not in a document!");
#ifdef DEBUG
{
nsCOMPtr<nsIHTMLDocument> htmldoc =
do_QueryInterface(aElement->GetUncomposedDoc());
NS_ASSERTION(htmldoc,
"Huh, how did this happen? This should only be used with "
"HTML documents!");
}
#endif
if (aElement->IsHTMLElement(nsGkAtoms::a)) {
return aElement->HasAttr(kNameSpaceID_None, nsGkAtoms::name);
}
return false;
}
nsIHTMLCollection*
nsHTMLDocument::Anchors()
{
if (!mAnchors) {
mAnchors = new nsContentList(this, MatchAnchors, nullptr, nullptr);
}
return mAnchors;
}
already_AddRefed<nsIChannel>
nsHTMLDocument::CreateDummyChannelForCookies(nsIURI* aCodebaseURI)
{