зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 3 changesets (bug 1426494) for build bustages on dom/base/FuzzingFunctions.h:25:44 r=backout on a CLOSED TREE
Backed out changeset 8d07cb1ef232 (bug 1426494) Backed out changeset 74a8ebb0f5d3 (bug 1426494) Backed out changeset 07c4aa18a0b6 (bug 1426494)
This commit is contained in:
Родитель
f617a73ddf
Коммит
4620ebda6e
|
@ -1,95 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "DocumentOrShadowRoot.h"
|
||||
#include "mozilla/dom/StyleSheetList.h"
|
||||
#include "XULDocument.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
DocumentOrShadowRoot::DocumentOrShadowRoot(mozilla::dom::ShadowRoot& aShadowRoot)
|
||||
: mAsNode(aShadowRoot)
|
||||
, mKind(Kind::ShadowRoot)
|
||||
{}
|
||||
|
||||
DocumentOrShadowRoot::DocumentOrShadowRoot(nsIDocument& aDoc)
|
||||
: mAsNode(aDoc)
|
||||
, mKind(Kind::Document)
|
||||
{}
|
||||
|
||||
StyleSheetList&
|
||||
DocumentOrShadowRoot::EnsureDOMStyleSheets()
|
||||
{
|
||||
if (!mDOMStyleSheets) {
|
||||
mDOMStyleSheets = new StyleSheetList(*this);
|
||||
}
|
||||
return *mDOMStyleSheets;
|
||||
}
|
||||
|
||||
Element*
|
||||
DocumentOrShadowRoot::GetElementById(const nsAString& aElementId)
|
||||
{
|
||||
if (MOZ_UNLIKELY(aElementId.IsEmpty())) {
|
||||
nsContentUtils::ReportEmptyGetElementByIdArg(AsNode().OwnerDoc());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (nsIdentifierMapEntry* entry = mIdentifierMap.GetEntry(aElementId)) {
|
||||
if (Element* el = entry->GetIdElement()) {
|
||||
return el;
|
||||
}
|
||||
}
|
||||
|
||||
if (MOZ_UNLIKELY(mKind == Kind::Document &&
|
||||
static_cast<nsIDocument&>(AsNode()).IsXULDocument())) {
|
||||
return static_cast<XULDocument&>(AsNode()).GetRefById(aElementId);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
already_AddRefed<nsContentList>
|
||||
DocumentOrShadowRoot::GetElementsByTagNameNS(const nsAString& aNamespaceURI,
|
||||
const nsAString& aLocalName)
|
||||
{
|
||||
ErrorResult rv;
|
||||
RefPtr<nsContentList> list =
|
||||
GetElementsByTagNameNS(aNamespaceURI, aLocalName, rv);
|
||||
if (rv.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
return list.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<nsContentList>
|
||||
DocumentOrShadowRoot::GetElementsByTagNameNS(const nsAString& aNamespaceURI,
|
||||
const nsAString& aLocalName,
|
||||
mozilla::ErrorResult& aResult)
|
||||
{
|
||||
int32_t nameSpaceId = kNameSpaceID_Wildcard;
|
||||
|
||||
if (!aNamespaceURI.EqualsLiteral("*")) {
|
||||
aResult =
|
||||
nsContentUtils::NameSpaceManager()->RegisterNameSpace(aNamespaceURI,
|
||||
nameSpaceId);
|
||||
if (aResult.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
NS_ASSERTION(nameSpaceId != kNameSpaceID_Unknown, "Unexpected namespace ID!");
|
||||
return NS_GetContentList(&AsNode(), nameSpaceId, aLocalName);
|
||||
}
|
||||
|
||||
already_AddRefed<nsContentList>
|
||||
DocumentOrShadowRoot::GetElementsByClassName(const nsAString& aClasses)
|
||||
{
|
||||
return nsContentUtils::GetElementsByClassName(&AsNode(), aClasses);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,149 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef mozilla_dom_DocumentOrShadowRoot_h__
|
||||
#define mozilla_dom_DocumentOrShadowRoot_h__
|
||||
|
||||
#include "nsTArray.h"
|
||||
#include "nsIdentifierMapEntry.h"
|
||||
|
||||
class nsContentList;
|
||||
class nsINode;
|
||||
|
||||
namespace mozilla {
|
||||
class StyleSheet;
|
||||
|
||||
namespace dom {
|
||||
|
||||
class StyleSheetList;
|
||||
class ShadowRoot;
|
||||
|
||||
/**
|
||||
* A class meant to be shared by ShadowRoot and Document, that holds a list of
|
||||
* stylesheets.
|
||||
*
|
||||
* TODO(emilio, bug 1418159): In the future this should hold most of the
|
||||
* relevant style state, this should allow us to fix bug 548397.
|
||||
*/
|
||||
class DocumentOrShadowRoot
|
||||
{
|
||||
enum class Kind
|
||||
{
|
||||
Document,
|
||||
ShadowRoot,
|
||||
};
|
||||
|
||||
public:
|
||||
explicit DocumentOrShadowRoot(nsIDocument&);
|
||||
explicit DocumentOrShadowRoot(mozilla::dom::ShadowRoot&);
|
||||
|
||||
nsINode& AsNode()
|
||||
{
|
||||
return mAsNode;
|
||||
}
|
||||
|
||||
const nsINode& AsNode() const
|
||||
{
|
||||
return mAsNode;
|
||||
}
|
||||
|
||||
StyleSheet* SheetAt(size_t aIndex) const
|
||||
{
|
||||
return mStyleSheets.SafeElementAt(aIndex);
|
||||
}
|
||||
|
||||
size_t SheetCount() const
|
||||
{
|
||||
return mStyleSheets.Length();
|
||||
}
|
||||
|
||||
int32_t IndexOfSheet(const StyleSheet& aSheet) const
|
||||
{
|
||||
return mStyleSheets.IndexOf(&aSheet);
|
||||
}
|
||||
|
||||
void InsertSheetAt(size_t aIndex, StyleSheet& aSheet)
|
||||
{
|
||||
mStyleSheets.InsertElementAt(aIndex, &aSheet);
|
||||
}
|
||||
|
||||
void RemoveSheet(StyleSheet& aSheet)
|
||||
{
|
||||
mStyleSheets.RemoveElement(&aSheet);
|
||||
}
|
||||
|
||||
void AppendStyleSheet(StyleSheet& aSheet)
|
||||
{
|
||||
mStyleSheets.AppendElement(&aSheet);
|
||||
}
|
||||
|
||||
StyleSheetList& EnsureDOMStyleSheets();
|
||||
|
||||
Element* GetElementById(const nsAString& aElementId);
|
||||
|
||||
/**
|
||||
* This method returns _all_ the elements in this scope which have id
|
||||
* aElementId, if there are any. Otherwise it returns null.
|
||||
*
|
||||
* This is useful for stuff like QuerySelector optimization and such.
|
||||
*/
|
||||
inline const nsTArray<Element*>*
|
||||
GetAllElementsForId(const nsAString& aElementId) const;
|
||||
|
||||
already_AddRefed<nsContentList>
|
||||
GetElementsByTagName(const nsAString& aTagName)
|
||||
{
|
||||
return NS_GetContentList(&AsNode(), kNameSpaceID_Unknown, aTagName);
|
||||
}
|
||||
|
||||
already_AddRefed<nsContentList>
|
||||
GetElementsByTagNameNS(const nsAString& aNamespaceURI,
|
||||
const nsAString& aLocalName);
|
||||
|
||||
already_AddRefed<nsContentList>
|
||||
GetElementsByTagNameNS(const nsAString& aNamespaceURI,
|
||||
const nsAString& aLocalName,
|
||||
mozilla::ErrorResult&);
|
||||
|
||||
already_AddRefed<nsContentList>
|
||||
GetElementsByClassName(const nsAString& aClasses);
|
||||
|
||||
~DocumentOrShadowRoot() = default;
|
||||
|
||||
protected:
|
||||
nsTArray<RefPtr<mozilla::StyleSheet>> mStyleSheets;
|
||||
RefPtr<mozilla::dom::StyleSheetList> mDOMStyleSheets;
|
||||
|
||||
/*
|
||||
* mIdentifierMap works as follows for IDs:
|
||||
* 1) Attribute changes affect the table immediately (removing and adding
|
||||
* entries as needed).
|
||||
* 2) Removals from the DOM affect the table immediately
|
||||
* 3) Additions to the DOM always update existing entries for names, and add
|
||||
* new ones for IDs.
|
||||
*/
|
||||
nsTHashtable<nsIdentifierMapEntry> mIdentifierMap;
|
||||
|
||||
nsINode& mAsNode;
|
||||
const Kind mKind;
|
||||
};
|
||||
|
||||
inline const nsTArray<Element*>*
|
||||
DocumentOrShadowRoot::GetAllElementsForId(const nsAString& aElementId) const
|
||||
{
|
||||
if (aElementId.IsEmpty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsIdentifierMapEntry* entry = mIdentifierMap.GetEntry(aElementId);
|
||||
return entry ? &entry->GetIdElements() : nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -183,7 +183,6 @@ class EventStateManager;
|
|||
|
||||
namespace dom {
|
||||
|
||||
struct CustomElementDefinition;
|
||||
class Animation;
|
||||
class CustomElementRegistry;
|
||||
class Link;
|
||||
|
|
|
@ -56,7 +56,6 @@ ShadowRoot::ShadowRoot(Element* aElement, bool aClosed,
|
|||
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
|
||||
nsXBLPrototypeBinding* aProtoBinding)
|
||||
: DocumentFragment(aNodeInfo)
|
||||
, DocumentOrShadowRoot(*this)
|
||||
, mProtoBinding(aProtoBinding)
|
||||
, mInsertionPointChanged(false)
|
||||
, mIsComposedDocParticipant(false)
|
||||
|
@ -218,7 +217,7 @@ ShadowRoot::InsertSheet(StyleSheet* aSheet,
|
|||
|
||||
linkingElement->SetStyleSheet(aSheet); // This sets the ownerNode on the sheet
|
||||
|
||||
MOZ_DIAGNOSTIC_ASSERT(mProtoBinding->SheetCount() == DocumentOrShadowRoot::SheetCount());
|
||||
MOZ_DIAGNOSTIC_ASSERT(mProtoBinding->SheetCount() == StyleScope::SheetCount());
|
||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
||||
// FIXME(emilio, bug 1425759): For now we keep them duplicated, the proto
|
||||
// binding will disappear soon (tm).
|
||||
|
@ -256,13 +255,44 @@ void
|
|||
ShadowRoot::RemoveSheet(StyleSheet* aSheet)
|
||||
{
|
||||
mProtoBinding->RemoveStyleSheet(aSheet);
|
||||
DocumentOrShadowRoot::RemoveSheet(*aSheet);
|
||||
StyleScope::RemoveSheet(*aSheet);
|
||||
|
||||
if (aSheet->IsApplicable()) {
|
||||
StyleSheetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
Element*
|
||||
ShadowRoot::GetElementById(const nsAString& aElementId)
|
||||
{
|
||||
nsIdentifierMapEntry *entry = mIdentifierMap.GetEntry(aElementId);
|
||||
return entry ? entry->GetIdElement() : nullptr;
|
||||
}
|
||||
|
||||
already_AddRefed<nsContentList>
|
||||
ShadowRoot::GetElementsByTagName(const nsAString& aTagName)
|
||||
{
|
||||
return NS_GetContentList(this, kNameSpaceID_Unknown, aTagName);
|
||||
}
|
||||
|
||||
already_AddRefed<nsContentList>
|
||||
ShadowRoot::GetElementsByTagNameNS(const nsAString& aNamespaceURI,
|
||||
const nsAString& aLocalName)
|
||||
{
|
||||
int32_t nameSpaceId = kNameSpaceID_Wildcard;
|
||||
|
||||
if (!aNamespaceURI.EqualsLiteral("*")) {
|
||||
nsresult rv =
|
||||
nsContentUtils::NameSpaceManager()->RegisterNameSpace(aNamespaceURI,
|
||||
nameSpaceId);
|
||||
NS_ENSURE_SUCCESS(rv, nullptr);
|
||||
}
|
||||
|
||||
NS_ASSERTION(nameSpaceId != kNameSpaceID_Unknown, "Unexpected namespace ID!");
|
||||
|
||||
return NS_GetContentList(this, nameSpaceId, aLocalName);
|
||||
}
|
||||
|
||||
void
|
||||
ShadowRoot::AddToIdTable(Element* aElement, nsAtom* aId)
|
||||
{
|
||||
|
@ -284,6 +314,12 @@ ShadowRoot::RemoveFromIdTable(Element* aElement, nsAtom* aId)
|
|||
}
|
||||
}
|
||||
|
||||
already_AddRefed<nsContentList>
|
||||
ShadowRoot::GetElementsByClassName(const nsAString& aClasses)
|
||||
{
|
||||
return nsContentUtils::GetElementsByClassName(this, aClasses);
|
||||
}
|
||||
|
||||
nsresult
|
||||
ShadowRoot::GetEventTargetParent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#define mozilla_dom_shadowroot_h__
|
||||
|
||||
#include "mozilla/dom/DocumentFragment.h"
|
||||
#include "mozilla/dom/DocumentOrShadowRoot.h"
|
||||
#include "mozilla/dom/StyleScope.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsIContentInlines.h"
|
||||
|
@ -28,7 +28,7 @@ namespace dom {
|
|||
class Element;
|
||||
|
||||
class ShadowRoot final : public DocumentFragment,
|
||||
public DocumentOrShadowRoot,
|
||||
public StyleScope,
|
||||
public nsStubMutationObserver
|
||||
{
|
||||
public:
|
||||
|
@ -56,14 +56,22 @@ public:
|
|||
return mMode == ShadowRootMode::Closed;
|
||||
}
|
||||
|
||||
// StyleScope.
|
||||
nsINode& AsNode() final
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
// [deprecated] Shadow DOM v0
|
||||
void AddToIdTable(Element* aElement, nsAtom* aId);
|
||||
void RemoveFromIdTable(Element* aElement, nsAtom* aId);
|
||||
void InsertSheet(StyleSheet* aSheet, nsIContent* aLinkingContent);
|
||||
void RemoveSheet(StyleSheet* aSheet);
|
||||
bool ApplyAuthorStyles();
|
||||
void SetApplyAuthorStyles(bool aApplyAuthorStyles);
|
||||
StyleSheetList* StyleSheets()
|
||||
{
|
||||
return &DocumentOrShadowRoot::EnsureDOMStyleSheets();
|
||||
return &StyleScope::EnsureDOMStyleSheets();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -115,11 +123,15 @@ public:
|
|||
|
||||
static ShadowRoot* FromNode(nsINode* aNode);
|
||||
|
||||
void AddToIdTable(Element* aElement, nsAtom* aId);
|
||||
void RemoveFromIdTable(Element* aElement, nsAtom* aId);
|
||||
|
||||
// WebIDL methods.
|
||||
using mozilla::dom::DocumentOrShadowRoot::GetElementById;
|
||||
Element* GetElementById(const nsAString& aElementId);
|
||||
already_AddRefed<nsContentList>
|
||||
GetElementsByTagName(const nsAString& aNamespaceURI);
|
||||
already_AddRefed<nsContentList>
|
||||
GetElementsByTagNameNS(const nsAString& aNamespaceURI,
|
||||
const nsAString& aLocalName);
|
||||
already_AddRefed<nsContentList>
|
||||
GetElementsByClassName(const nsAString& aClasses);
|
||||
void GetInnerHTML(nsAString& aInnerHTML);
|
||||
void SetInnerHTML(const nsAString& aInnerHTML, ErrorResult& aError);
|
||||
void StyleSheetChanged();
|
||||
|
@ -141,6 +153,8 @@ protected:
|
|||
// the given name. The slots are stored as a weak pointer because the elements
|
||||
// are in the shadow tree and should be kept alive by its parent.
|
||||
nsClassHashtable<nsStringHashKey, nsTArray<mozilla::dom::HTMLSlotElement*>> mSlotMap;
|
||||
|
||||
nsTHashtable<nsIdentifierMapEntry> mIdentifierMap;
|
||||
nsXBLPrototypeBinding* mProtoBinding;
|
||||
|
||||
// It is necessary to hold a reference to the associated nsXBLBinding
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "StyleScope.h"
|
||||
#include "mozilla/dom/StyleSheetList.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
StyleScope::~StyleScope()
|
||||
{
|
||||
}
|
||||
|
||||
StyleSheetList&
|
||||
StyleScope::EnsureDOMStyleSheets()
|
||||
{
|
||||
if (!mDOMStyleSheets) {
|
||||
mDOMStyleSheets = new StyleSheetList(*this);
|
||||
}
|
||||
return *mDOMStyleSheets;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef mozilla_dom_StyleScope_h__
|
||||
#define mozilla_dom_StyleScope_h__
|
||||
|
||||
#include "nsTArray.h"
|
||||
|
||||
class nsINode;
|
||||
|
||||
namespace mozilla {
|
||||
class StyleSheet;
|
||||
|
||||
namespace dom {
|
||||
|
||||
class StyleSheetList;
|
||||
|
||||
/**
|
||||
* A class meant to be shared by ShadowRoot and Document, that holds a list of
|
||||
* stylesheets.
|
||||
*
|
||||
* TODO(emilio, bug 1418159): In the future this should hold most of the
|
||||
* relevant style state, this should allow us to fix bug 548397.
|
||||
*/
|
||||
class StyleScope
|
||||
{
|
||||
public:
|
||||
virtual nsINode& AsNode() = 0;
|
||||
|
||||
const nsINode& AsNode() const
|
||||
{
|
||||
return const_cast<StyleScope&>(*this).AsNode();
|
||||
}
|
||||
|
||||
StyleSheet* SheetAt(size_t aIndex) const
|
||||
{
|
||||
return mStyleSheets.SafeElementAt(aIndex);
|
||||
}
|
||||
|
||||
size_t SheetCount() const
|
||||
{
|
||||
return mStyleSheets.Length();
|
||||
}
|
||||
|
||||
int32_t IndexOfSheet(const StyleSheet& aSheet) const
|
||||
{
|
||||
return mStyleSheets.IndexOf(&aSheet);
|
||||
}
|
||||
|
||||
void InsertSheetAt(size_t aIndex, StyleSheet& aSheet)
|
||||
{
|
||||
mStyleSheets.InsertElementAt(aIndex, &aSheet);
|
||||
}
|
||||
|
||||
void RemoveSheet(StyleSheet& aSheet)
|
||||
{
|
||||
mStyleSheets.RemoveElement(&aSheet);
|
||||
}
|
||||
|
||||
void AppendStyleSheet(StyleSheet& aSheet)
|
||||
{
|
||||
mStyleSheets.AppendElement(&aSheet);
|
||||
}
|
||||
|
||||
StyleSheetList& EnsureDOMStyleSheets();
|
||||
|
||||
~StyleScope();
|
||||
|
||||
protected:
|
||||
nsTArray<RefPtr<mozilla::StyleSheet>> mStyleSheets;
|
||||
RefPtr<mozilla::dom::StyleSheetList> mDOMStyleSheets;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -48,19 +48,19 @@ StyleSheetList::SlowItem(uint32_t aIndex, nsIDOMStyleSheet** aItem)
|
|||
void
|
||||
StyleSheetList::NodeWillBeDestroyed(const nsINode* aNode)
|
||||
{
|
||||
mDocumentOrShadowRoot = nullptr;
|
||||
mStyleScope = nullptr;
|
||||
}
|
||||
|
||||
StyleSheetList::StyleSheetList(DocumentOrShadowRoot& aScope)
|
||||
: mDocumentOrShadowRoot(&aScope)
|
||||
StyleSheetList::StyleSheetList(StyleScope& aScope)
|
||||
: mStyleScope(&aScope)
|
||||
{
|
||||
mDocumentOrShadowRoot->AsNode().AddMutationObserver(this);
|
||||
mStyleScope->AsNode().AddMutationObserver(this);
|
||||
}
|
||||
|
||||
StyleSheetList::~StyleSheetList()
|
||||
{
|
||||
if (mDocumentOrShadowRoot) {
|
||||
mDocumentOrShadowRoot->AsNode().RemoveMutationObserver(this);
|
||||
if (mStyleScope) {
|
||||
mStyleScope->AsNode().RemoveMutationObserver(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#ifndef mozilla_dom_StyleSheetList_h
|
||||
#define mozilla_dom_StyleSheetList_h
|
||||
|
||||
#include "mozilla/dom/DocumentOrShadowRoot.h"
|
||||
#include "mozilla/dom/StyleScope.h"
|
||||
#include "nsIDOMStyleSheetList.h"
|
||||
#include "nsWrapperCache.h"
|
||||
#include "nsStubDocumentObserver.h"
|
||||
|
@ -31,28 +31,28 @@ public:
|
|||
|
||||
NS_DECL_NSIMUTATIONOBSERVER_NODEWILLBEDESTROYED
|
||||
|
||||
explicit StyleSheetList(DocumentOrShadowRoot& aScope);
|
||||
explicit StyleSheetList(StyleScope& aScope);
|
||||
|
||||
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override final;
|
||||
|
||||
nsINode* GetParentObject() const
|
||||
{
|
||||
return mDocumentOrShadowRoot ? &mDocumentOrShadowRoot->AsNode() : nullptr;
|
||||
return mStyleScope ? &mStyleScope->AsNode() : nullptr;
|
||||
}
|
||||
|
||||
uint32_t Length() const
|
||||
{
|
||||
return mDocumentOrShadowRoot ? mDocumentOrShadowRoot->SheetCount() : 0;
|
||||
return mStyleScope ? mStyleScope->SheetCount() : 0;
|
||||
}
|
||||
|
||||
StyleSheet* IndexedGetter(uint32_t aIndex, bool& aFound) const
|
||||
{
|
||||
if (!mDocumentOrShadowRoot) {
|
||||
if (!mStyleScope) {
|
||||
aFound = false;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
StyleSheet* sheet = mDocumentOrShadowRoot->SheetAt(aIndex);
|
||||
StyleSheet* sheet = mStyleScope->SheetAt(aIndex);
|
||||
aFound = !!sheet;
|
||||
return sheet;
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ public:
|
|||
protected:
|
||||
virtual ~StyleSheetList();
|
||||
|
||||
DocumentOrShadowRoot* mDocumentOrShadowRoot; // Weak, cleared on "NodeWillBeDestroyed".
|
||||
StyleScope* mStyleScope; // Weak, cleared on "NodeWillBeDestroyed".
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
|
|
@ -162,7 +162,6 @@ EXPORTS.mozilla.dom += [
|
|||
'DispatcherTrait.h',
|
||||
'DocGroup.h',
|
||||
'DocumentFragment.h',
|
||||
'DocumentOrShadowRoot.h',
|
||||
'DocumentType.h',
|
||||
'DOMCursor.h',
|
||||
'DOMError.h',
|
||||
|
@ -208,6 +207,7 @@ EXPORTS.mozilla.dom += [
|
|||
'StructuredCloneBlob.h',
|
||||
'StructuredCloneHolder.h',
|
||||
'StructuredCloneTags.h',
|
||||
'StyleScope.h',
|
||||
'StyleSheetList.h',
|
||||
'SubtleCrypto.h',
|
||||
'TabGroup.h',
|
||||
|
@ -241,7 +241,6 @@ UNIFIED_SOURCES += [
|
|||
'DispatcherTrait.cpp',
|
||||
'DocGroup.cpp',
|
||||
'DocumentFragment.cpp',
|
||||
'DocumentOrShadowRoot.cpp',
|
||||
'DocumentType.cpp',
|
||||
'DOMCursor.cpp',
|
||||
'DOMError.cpp',
|
||||
|
@ -352,6 +351,7 @@ UNIFIED_SOURCES += [
|
|||
'ShadowRoot.cpp',
|
||||
'StructuredCloneBlob.cpp',
|
||||
'StructuredCloneHolder.cpp',
|
||||
'StyleScope.cpp',
|
||||
'StyleSheetList.cpp',
|
||||
'SubtleCrypto.cpp',
|
||||
'TabGroup.cpp',
|
||||
|
|
|
@ -4108,14 +4108,6 @@ nsContentUtils::ReportToConsole(uint32_t aErrorFlags,
|
|||
aLineNumber, aColumnNumber);
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
nsContentUtils::ReportEmptyGetElementByIdArg(const nsIDocument* aDoc)
|
||||
{
|
||||
ReportToConsole(nsIScriptError::warningFlag,
|
||||
NS_LITERAL_CSTRING("DOM"), aDoc,
|
||||
nsContentUtils::eDOM_PROPERTIES,
|
||||
"EmptyGetElementByIdParam");
|
||||
}
|
||||
|
||||
/* static */ nsresult
|
||||
nsContentUtils::ReportToConsoleNonLocalized(const nsAString& aErrorText,
|
||||
|
|
|
@ -1090,8 +1090,6 @@ public:
|
|||
uint32_t aLineNumber = 0,
|
||||
uint32_t aColumnNumber = 0);
|
||||
|
||||
static void ReportEmptyGetElementByIdArg(const nsIDocument* aDoc);
|
||||
|
||||
static void LogMessageToConsole(const char* aMsg);
|
||||
|
||||
/**
|
||||
|
|
|
@ -385,24 +385,9 @@ private:
|
|||
|
||||
#define NAME_NOT_VALID ((nsSimpleContentList*)1)
|
||||
|
||||
nsIdentifierMapEntry::nsIdentifierMapEntry(const nsIdentifierMapEntry::AtomOrString& aKey)
|
||||
: mKey(aKey)
|
||||
{}
|
||||
|
||||
nsIdentifierMapEntry::nsIdentifierMapEntry(const nsIdentifierMapEntry::AtomOrString* aKey)
|
||||
: mKey(aKey ? *aKey : nullptr)
|
||||
{}
|
||||
|
||||
nsIdentifierMapEntry::~nsIdentifierMapEntry()
|
||||
{}
|
||||
|
||||
nsIdentifierMapEntry::nsIdentifierMapEntry(nsIdentifierMapEntry&& aOther)
|
||||
: mKey(mozilla::Move(aOther.mKey))
|
||||
, mIdContentList(mozilla::Move(aOther.mIdContentList))
|
||||
, mNameContentList(mozilla::Move(aOther.mNameContentList))
|
||||
, mChangeCallbacks(mozilla::Move(aOther.mChangeCallbacks))
|
||||
, mImageElement(mozilla::Move(aOther.mImageElement))
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
nsIdentifierMapEntry::Traverse(nsCycleCollectionTraversalCallback* aCallback)
|
||||
|
@ -426,12 +411,6 @@ nsIdentifierMapEntry::IsEmpty()
|
|||
!mChangeCallbacks && !mImageElement;
|
||||
}
|
||||
|
||||
bool
|
||||
nsIdentifierMapEntry::HasNameElement() const
|
||||
{
|
||||
return mNameContentList && mNameContentList->Length() != 0;
|
||||
}
|
||||
|
||||
Element*
|
||||
nsIdentifierMapEntry::GetIdElement()
|
||||
{
|
||||
|
@ -1425,7 +1404,6 @@ static already_AddRefed<mozilla::dom::NodeInfo> nullNodeInfo;
|
|||
// ==================================================================
|
||||
nsIDocument::nsIDocument()
|
||||
: nsINode(nullNodeInfo),
|
||||
DocumentOrShadowRoot(*this),
|
||||
mReferrerPolicySet(false),
|
||||
mReferrerPolicy(mozilla::net::RP_Unset),
|
||||
mBlockAllMixedContent(false),
|
||||
|
@ -3853,6 +3831,12 @@ nsDocument::GetElementsByClassName(const nsAString& aClasses,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
already_AddRefed<nsContentList>
|
||||
nsIDocument::GetElementsByClassName(const nsAString& aClasses)
|
||||
{
|
||||
return nsContentUtils::GetElementsByClassName(this, aClasses);
|
||||
}
|
||||
|
||||
void
|
||||
nsIDocument::ReleaseCapture() const
|
||||
{
|
||||
|
@ -4677,7 +4661,7 @@ nsDocument::InsertStyleSheetAt(StyleSheet* aSheet, size_t aIndex)
|
|||
MOZ_ASSERT(aSheet);
|
||||
MOZ_DIAGNOSTIC_ASSERT(aSheet->IsServo() == IsStyledByServo());
|
||||
|
||||
// FIXME(emilio): Stop touching DocumentOrShadowRoot's members directly, and use an
|
||||
// FIXME(emilio): Stop touching StyleScope's members directly, and use an
|
||||
// accessor.
|
||||
mStyleSheets.InsertElementAt(aIndex, aSheet);
|
||||
|
||||
|
@ -5392,7 +5376,32 @@ nsDocument::BeginLoad()
|
|||
void
|
||||
nsDocument::ReportEmptyGetElementByIdArg()
|
||||
{
|
||||
nsContentUtils::ReportEmptyGetElementByIdArg(this);
|
||||
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
|
||||
NS_LITERAL_CSTRING("DOM"), this,
|
||||
nsContentUtils::eDOM_PROPERTIES,
|
||||
"EmptyGetElementByIdParam");
|
||||
}
|
||||
|
||||
Element*
|
||||
nsDocument::GetElementById(const nsAString& aElementId)
|
||||
{
|
||||
if (!CheckGetElementByIdArg(aElementId)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsIdentifierMapEntry *entry = mIdentifierMap.GetEntry(aElementId);
|
||||
return entry ? entry->GetIdElement() : nullptr;
|
||||
}
|
||||
|
||||
const nsTArray<Element*>*
|
||||
nsDocument::GetAllElementsForId(const nsAString& aElementId) const
|
||||
{
|
||||
if (aElementId.IsEmpty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsIdentifierMapEntry *entry = mIdentifierMap.GetEntry(aElementId);
|
||||
return entry ? &entry->GetIdElements() : nullptr;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -6349,6 +6358,27 @@ nsDocument::BlockedTrackingNodes() const
|
|||
return list.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<nsContentList>
|
||||
nsIDocument::GetElementsByTagNameNS(const nsAString& aNamespaceURI,
|
||||
const nsAString& aLocalName,
|
||||
ErrorResult& aResult)
|
||||
{
|
||||
int32_t nameSpaceId = kNameSpaceID_Wildcard;
|
||||
|
||||
if (!aNamespaceURI.EqualsLiteral("*")) {
|
||||
aResult =
|
||||
nsContentUtils::NameSpaceManager()->RegisterNameSpace(aNamespaceURI,
|
||||
nameSpaceId);
|
||||
if (aResult.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
NS_ASSERTION(nameSpaceId != kNameSpaceID_Unknown, "Unexpected namespace ID!");
|
||||
|
||||
return NS_GetContentList(this, nameSpaceId, aLocalName);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocument::GetElementsByTagNameNS(const nsAString& aNamespaceURI,
|
||||
const nsAString& aLocalName,
|
||||
|
@ -6356,7 +6386,7 @@ nsDocument::GetElementsByTagNameNS(const nsAString& aNamespaceURI,
|
|||
{
|
||||
ErrorResult rv;
|
||||
RefPtr<nsContentList> list =
|
||||
GetElementsByTagNameNS(aNamespaceURI, aLocalName, rv);
|
||||
nsIDocument::GetElementsByTagNameNS(aNamespaceURI, aLocalName, rv);
|
||||
if (rv.Failed()) {
|
||||
return rv.StealNSResult();
|
||||
}
|
||||
|
|
|
@ -335,6 +335,7 @@ class nsDocument : public nsIDocument,
|
|||
|
||||
public:
|
||||
typedef mozilla::dom::Element Element;
|
||||
using nsIDocument::GetElementsByTagName;
|
||||
typedef mozilla::net::ReferrerPolicy ReferrerPolicy;
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
|
@ -644,11 +645,6 @@ public:
|
|||
// nsIDOMDocumentXBL
|
||||
NS_DECL_NSIDOMDOCUMENTXBL
|
||||
|
||||
using mozilla::dom::DocumentOrShadowRoot::GetElementById;
|
||||
using mozilla::dom::DocumentOrShadowRoot::GetElementsByTagName;
|
||||
using mozilla::dom::DocumentOrShadowRoot::GetElementsByTagNameNS;
|
||||
using mozilla::dom::DocumentOrShadowRoot::GetElementsByClassName;
|
||||
|
||||
// nsIDOMEventTarget
|
||||
virtual nsresult GetEventTargetParent(
|
||||
mozilla::EventChainPreVisitor& aVisitor) override;
|
||||
|
@ -818,7 +814,10 @@ public:
|
|||
virtual void ResetScrolledToRefAlready() override;
|
||||
virtual void SetChangeScrollPosWhenScrollingToRef(bool aValue) override;
|
||||
|
||||
virtual Element* LookupImageElement(const nsAString& aElementId) override;
|
||||
virtual Element *GetElementById(const nsAString& aElementId) override;
|
||||
virtual const nsTArray<Element*>* GetAllElementsForId(const nsAString& aElementId) const override;
|
||||
|
||||
virtual Element *LookupImageElement(const nsAString& aElementId) override;
|
||||
virtual void MozSetImageElement(const nsAString& aImageElementId,
|
||||
Element* aElement) override;
|
||||
|
||||
|
@ -1144,6 +1143,14 @@ public:
|
|||
RefPtr<nsDOMStyleSheetSetList> mStyleSheetSetList;
|
||||
RefPtr<mozilla::dom::ScriptLoader> mScriptLoader;
|
||||
nsDocHeaderData* mHeaderData;
|
||||
/* mIdentifierMap works as follows for IDs:
|
||||
* 1) Attribute changes affect the table immediately (removing and adding
|
||||
* entries as needed).
|
||||
* 2) Removals from the DOM affect the table immediately
|
||||
* 3) Additions to the DOM always update existing entries for names, and add
|
||||
* new ones for IDs.
|
||||
*/
|
||||
nsTHashtable<nsIdentifierMapEntry> mIdentifierMap;
|
||||
|
||||
nsClassHashtable<nsStringHashKey, nsRadioGroupStruct> mRadioGroups;
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include "nsClassHashtable.h"
|
||||
#include "mozilla/CORSMode.h"
|
||||
#include "mozilla/dom/DispatcherTrait.h"
|
||||
#include "mozilla/dom/DocumentOrShadowRoot.h"
|
||||
#include "mozilla/dom/StyleScope.h"
|
||||
#include "mozilla/LinkedList.h"
|
||||
#include "mozilla/NotNull.h"
|
||||
#include "mozilla/SegmentedVector.h"
|
||||
|
@ -216,7 +216,7 @@ class nsContentList;
|
|||
// Document interface. This is implemented by all document objects in
|
||||
// Gecko.
|
||||
class nsIDocument : public nsINode,
|
||||
public mozilla::dom::DocumentOrShadowRoot,
|
||||
public mozilla::dom::StyleScope,
|
||||
public mozilla::dom::DispatcherTrait
|
||||
{
|
||||
typedef mozilla::dom::GlobalObject GlobalObject;
|
||||
|
@ -572,7 +572,7 @@ public:
|
|||
* to remove it.
|
||||
*/
|
||||
typedef bool (* IDTargetObserver)(Element* aOldElement,
|
||||
Element* aNewelement, void* aData);
|
||||
Element* aNewelement, void* aData);
|
||||
|
||||
/**
|
||||
* Add an IDTargetObserver for a specific ID. The IDTargetObserver
|
||||
|
@ -1331,9 +1331,14 @@ public:
|
|||
*/
|
||||
virtual void EnsureOnDemandBuiltInUASheet(mozilla::StyleSheet* aSheet) = 0;
|
||||
|
||||
nsINode& AsNode() final
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
mozilla::dom::StyleSheetList* StyleSheets()
|
||||
{
|
||||
return &DocumentOrShadowRoot::EnsureDOMStyleSheets();
|
||||
return &StyleScope::EnsureDOMStyleSheets();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2640,10 +2645,19 @@ public:
|
|||
virtual void ResetScrolledToRefAlready() = 0;
|
||||
virtual void SetChangeScrollPosWhenScrollingToRef(bool aValue) = 0;
|
||||
|
||||
using mozilla::dom::DocumentOrShadowRoot::GetElementById;
|
||||
using mozilla::dom::DocumentOrShadowRoot::GetElementsByTagName;
|
||||
using mozilla::dom::DocumentOrShadowRoot::GetElementsByTagNameNS;
|
||||
using mozilla::dom::DocumentOrShadowRoot::GetElementsByClassName;
|
||||
/**
|
||||
* This method is similar to GetElementById() from nsIDOMDocument but it
|
||||
* returns a mozilla::dom::Element instead of a nsIDOMElement.
|
||||
* It prevents converting nsIDOMElement to mozilla::dom::Element which is
|
||||
* already converted from mozilla::dom::Element.
|
||||
*/
|
||||
virtual Element* GetElementById(const nsAString& aElementId) = 0;
|
||||
|
||||
/**
|
||||
* This method returns _all_ the elements in this document which
|
||||
* have id aElementId, if there are any. Otherwise it returns null.
|
||||
*/
|
||||
virtual const nsTArray<Element*>* GetAllElementsForId(const nsAString& aElementId) const = 0;
|
||||
|
||||
/**
|
||||
* Lookup an image element using its associated ID, which is usually provided
|
||||
|
@ -2840,6 +2854,18 @@ public:
|
|||
|
||||
nsIDocument* GetTopLevelContentDocument();
|
||||
|
||||
already_AddRefed<nsContentList>
|
||||
GetElementsByTagName(const nsAString& aTagName)
|
||||
{
|
||||
return NS_GetContentList(this, kNameSpaceID_Unknown, aTagName);
|
||||
}
|
||||
already_AddRefed<nsContentList>
|
||||
GetElementsByTagNameNS(const nsAString& aNamespaceURI,
|
||||
const nsAString& aLocalName,
|
||||
mozilla::ErrorResult& aResult);
|
||||
already_AddRefed<nsContentList>
|
||||
GetElementsByClassName(const nsAString& aClasses);
|
||||
// GetElementById defined above
|
||||
virtual already_AddRefed<Element>
|
||||
CreateElement(const nsAString& aTagName,
|
||||
const mozilla::dom::ElementCreationOptionsOrString& aOptions,
|
||||
|
|
|
@ -15,17 +15,18 @@
|
|||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Move.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/net/ReferrerPolicy.h"
|
||||
|
||||
#include "nsCOMArray.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsContentList.h"
|
||||
#include "nsAtom.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsTHashtable.h"
|
||||
|
||||
class nsIContent;
|
||||
class nsContentList;
|
||||
class nsBaseContentList;
|
||||
|
||||
/**
|
||||
* Right now our identifier map entries contain information for 'name'
|
||||
|
@ -41,15 +42,6 @@ class nsBaseContentList;
|
|||
*/
|
||||
class nsIdentifierMapEntry : public PLDHashEntryHdr
|
||||
{
|
||||
typedef mozilla::dom::Element Element;
|
||||
typedef mozilla::net::ReferrerPolicy ReferrerPolicy;
|
||||
|
||||
/**
|
||||
* @see nsIDocument::IDTargetObserver, this is just here to avoid include
|
||||
* hell.
|
||||
*/
|
||||
typedef bool (* IDTargetObserver)(Element* aOldElement,
|
||||
Element* aNewelement, void* aData);
|
||||
public:
|
||||
struct AtomOrString
|
||||
{
|
||||
|
@ -74,9 +66,25 @@ public:
|
|||
typedef const AtomOrString& KeyType;
|
||||
typedef const AtomOrString* KeyTypePointer;
|
||||
|
||||
explicit nsIdentifierMapEntry(const AtomOrString& aKey);
|
||||
explicit nsIdentifierMapEntry(const AtomOrString* aKey);
|
||||
nsIdentifierMapEntry(nsIdentifierMapEntry&& aOther);
|
||||
typedef mozilla::dom::Element Element;
|
||||
typedef mozilla::net::ReferrerPolicy ReferrerPolicy;
|
||||
|
||||
explicit nsIdentifierMapEntry(const AtomOrString& aKey)
|
||||
: mKey(aKey)
|
||||
{
|
||||
}
|
||||
explicit nsIdentifierMapEntry(const AtomOrString* aKey)
|
||||
: mKey(aKey ? *aKey : nullptr)
|
||||
{
|
||||
}
|
||||
nsIdentifierMapEntry(nsIdentifierMapEntry&& aOther) :
|
||||
mKey(mozilla::Move(aOther.mKey)),
|
||||
mIdContentList(mozilla::Move(aOther.mIdContentList)),
|
||||
mNameContentList(aOther.mNameContentList.forget()),
|
||||
mChangeCallbacks(aOther.mChangeCallbacks.forget()),
|
||||
mImageElement(aOther.mImageElement.forget())
|
||||
{
|
||||
}
|
||||
~nsIdentifierMapEntry();
|
||||
|
||||
nsString GetKeyAsString() const
|
||||
|
@ -121,7 +129,9 @@ public:
|
|||
nsBaseContentList* GetNameContentList() {
|
||||
return mNameContentList;
|
||||
}
|
||||
bool HasNameElement() const;
|
||||
bool HasNameElement() const {
|
||||
return mNameContentList && mNameContentList->Length() != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the element if we know the element associated with this
|
||||
|
@ -161,15 +171,15 @@ public:
|
|||
bool HasIdElementExposedAsHTMLDocumentProperty();
|
||||
|
||||
bool HasContentChangeCallback() { return mChangeCallbacks != nullptr; }
|
||||
void AddContentChangeCallback(IDTargetObserver aCallback,
|
||||
void AddContentChangeCallback(nsIDocument::IDTargetObserver aCallback,
|
||||
void* aData, bool aForImage);
|
||||
void RemoveContentChangeCallback(IDTargetObserver aCallback,
|
||||
void RemoveContentChangeCallback(nsIDocument::IDTargetObserver aCallback,
|
||||
void* aData, bool aForImage);
|
||||
|
||||
void Traverse(nsCycleCollectionTraversalCallback* aCallback);
|
||||
|
||||
struct ChangeCallback {
|
||||
IDTargetObserver mCallback;
|
||||
nsIDocument::IDTargetObserver mCallback;
|
||||
void* mData;
|
||||
bool mForImage;
|
||||
};
|
||||
|
|
|
@ -156,7 +156,11 @@ public:
|
|||
bool aPreallocateChildren) const override;
|
||||
|
||||
virtual void RemovedFromDocShell() override;
|
||||
using mozilla::dom::DocumentOrShadowRoot::GetElementById;
|
||||
|
||||
virtual mozilla::dom::Element *GetElementById(const nsAString& aElementId) override
|
||||
{
|
||||
return nsDocument::GetElementById(aElementId);
|
||||
}
|
||||
|
||||
virtual void DocAddSizeOfExcludingThis(nsWindowSizes& aWindowSizes) const override;
|
||||
// DocAddSizeOfIncludingThis is inherited from nsIDocument.
|
||||
|
|
|
@ -1599,13 +1599,24 @@ XULDocument::GetCommandDispatcher(nsIDOMXULCommandDispatcher** aTracker)
|
|||
}
|
||||
|
||||
Element*
|
||||
XULDocument::GetRefById(const nsAString& aID)
|
||||
XULDocument::GetElementById(const nsAString& aId)
|
||||
{
|
||||
if (nsRefMapEntry* refEntry = mRefMap.GetEntry(aID)) {
|
||||
MOZ_ASSERT(refEntry->GetFirstElement());
|
||||
return refEntry->GetFirstElement();
|
||||
if (!CheckGetElementByIdArg(aId))
|
||||
return nullptr;
|
||||
|
||||
nsIdentifierMapEntry *entry = mIdentifierMap.GetEntry(aId);
|
||||
if (entry) {
|
||||
Element* element = entry->GetIdElement();
|
||||
if (element)
|
||||
return element;
|
||||
}
|
||||
|
||||
nsRefMapEntry* refEntry = mRefMap.GetEntry(aId);
|
||||
if (refEntry) {
|
||||
NS_ASSERTION(refEntry->GetFirstElement(),
|
||||
"nsRefMapEntries should have nonempty content lists");
|
||||
return refEntry->GetFirstElement();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -149,7 +149,6 @@ public:
|
|||
using nsDocument::CreateElementNS;
|
||||
NS_FORWARD_NSIDOMDOCUMENT(XMLDocument::)
|
||||
// And explicitly import the things from nsDocument that we just shadowed
|
||||
using mozilla::dom::DocumentOrShadowRoot::GetElementById;
|
||||
using nsDocument::GetImplementation;
|
||||
using nsDocument::GetTitle;
|
||||
using nsDocument::SetTitle;
|
||||
|
@ -157,8 +156,8 @@ public:
|
|||
using nsDocument::MozSetImageElement;
|
||||
using nsIDocument::GetLocation;
|
||||
|
||||
// Helper for StyleScope::GetElementById.
|
||||
Element* GetRefById(const nsAString & elementId);
|
||||
// nsDocument interface overrides
|
||||
virtual Element* GetElementById(const nsAString & elementId) override;
|
||||
|
||||
// nsIDOMXULDocument interface
|
||||
NS_DECL_NSIDOMXULDOCUMENT
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "nsCharTraits.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsContentCID.h"
|
||||
#include "nsContentList.h"
|
||||
#include "nsCopySupport.h"
|
||||
#include "nsDebug.h"
|
||||
#include "nsDependentSubstring.h"
|
||||
|
|
Загрузка…
Ссылка в новой задаче