Bug 1426494 - Share more code between nsIDocument and ShadowRoot

Tag #1375
This commit is contained in:
Matt A. Tobin 2020-06-13 08:21:48 -04:00 committed by Roy Tam
commit db72493615
23 changed files with 369 additions and 335 deletions

View file

@ -333,7 +333,6 @@ class nsDocument : public nsIDocument,
public:
typedef mozilla::dom::Element Element;
using nsIDocument::GetElementsByTagName;
typedef mozilla::net::ReferrerPolicy ReferrerPolicy;
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
@ -631,6 +630,11 @@ 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;
@ -819,10 +823,7 @@ public:
virtual void ResetScrolledToRefAlready() override;
virtual void SetChangeScrollPosWhenScrollingToRef(bool aValue) 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 Element* LookupImageElement(const nsAString& aElementId) override;
virtual void MozSetImageElement(const nsAString& aImageElementId,
Element* aElement) override;
@ -1206,14 +1207,6 @@ public:
RefPtr<nsDOMStyleSheetSetList> mStyleSheetSetList;
RefPtr<nsScriptLoader> 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;