diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-06-13 08:21:48 -0400 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2020-06-13 08:21:48 -0400 |
commit | 43725c7264ca3f63de348d1d1596ce1fe9e64d2d (patch) | |
tree | e1ff1b11cc54e63b665aab1aa3776a62ee56250d /dom/base/ShadowRoot.h | |
parent | 35754dd1af72abcae49edd2eeb76855d999a4e6d (diff) | |
download | UXP-43725c7264ca3f63de348d1d1596ce1fe9e64d2d.tar UXP-43725c7264ca3f63de348d1d1596ce1fe9e64d2d.tar.gz UXP-43725c7264ca3f63de348d1d1596ce1fe9e64d2d.tar.lz UXP-43725c7264ca3f63de348d1d1596ce1fe9e64d2d.tar.xz UXP-43725c7264ca3f63de348d1d1596ce1fe9e64d2d.zip |
Bug 1426494 - Share more code between nsIDocument and ShadowRoot
Tag #1375
Diffstat (limited to 'dom/base/ShadowRoot.h')
-rw-r--r-- | dom/base/ShadowRoot.h | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/dom/base/ShadowRoot.h b/dom/base/ShadowRoot.h index 21c6e1733..eb772d49a 100644 --- a/dom/base/ShadowRoot.h +++ b/dom/base/ShadowRoot.h @@ -8,7 +8,7 @@ #define mozilla_dom_shadowroot_h__ #include "mozilla/dom/DocumentFragment.h" -#include "mozilla/dom/StyleScope.h" +#include "mozilla/dom/DocumentOrShadowRoot.h" #include "nsCOMPtr.h" #include "nsCycleCollectionParticipant.h" #include "nsIContentInlines.h" @@ -29,7 +29,7 @@ namespace dom { class Element; class ShadowRoot final : public DocumentFragment, - public StyleScope, + public DocumentOrShadowRoot, public nsStubMutationObserver { public: @@ -57,22 +57,14 @@ public: return mMode == ShadowRootMode::Closed; } - // StyleScope. - nsINode& AsNode() final - { - return *this; - } - // [deprecated] Shadow DOM v0 - void AddToIdTable(Element* aElement, nsIAtom* aId); - void RemoveFromIdTable(Element* aElement, nsIAtom* aId); void InsertSheet(StyleSheet* aSheet, nsIContent* aLinkingContent); void RemoveSheet(StyleSheet* aSheet); bool ApplyAuthorStyles(); void SetApplyAuthorStyles(bool aApplyAuthorStyles); StyleSheetList* StyleSheets() { - return &StyleScope::EnsureDOMStyleSheets(); + return &DocumentOrShadowRoot::EnsureDOMStyleSheets(); } /** @@ -123,15 +115,11 @@ public: static ShadowRoot* FromNode(nsINode* aNode); + void AddToIdTable(Element* aElement, nsIAtom* aId); + void RemoveFromIdTable(Element* aElement, nsIAtom* aId); + // WebIDL methods. - 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); + using mozilla::dom::DocumentOrShadowRoot::GetElementById; void GetInnerHTML(nsAString& aInnerHTML); void SetInnerHTML(const nsAString& aInnerHTML, ErrorResult& aError); void StyleSheetChanged(); @@ -154,7 +142,6 @@ protected: // 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 |