Bug 1516366 - Move EventTarget methods to nsIDocument. r=smaug
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 26 Dec 2018 03:34:20 +0100
changeset 509248 0afa3b75fd66e774d04ea8245614c7d351d5ee0e
parent 509247 2909ddd2f7b19f80a75cc0869dfc42d05887a761
child 509249 57acc0f12815af2b4742c29cefba5ed69ed85f50
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1516366
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1516366 - Move EventTarget methods to nsIDocument. r=smaug Differential Revision: https://phabricator.services.mozilla.com/D15360
dom/base/nsDocument.cpp
dom/base/nsDocument.h
dom/base/nsIDocument.h
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -6977,31 +6977,31 @@ void nsIDocument::UpdateViewportOverflow
     if (aScrolledWidth * minScale.scale < aScrollportWidth) {
       mViewportOverflowType = ViewportOverflowType::ButNotMinScaleSize;
     } else {
       mViewportOverflowType = ViewportOverflowType::MinScaleSize;
     }
   }
 }
 
-EventListenerManager* nsDocument::GetOrCreateListenerManager() {
+EventListenerManager* nsIDocument::GetOrCreateListenerManager() {
   if (!mListenerManager) {
     mListenerManager =
         new EventListenerManager(static_cast<EventTarget*>(this));
     SetFlags(NODE_HAS_LISTENERMANAGER);
   }
 
   return mListenerManager;
 }
 
-EventListenerManager* nsDocument::GetExistingListenerManager() const {
+EventListenerManager* nsIDocument::GetExistingListenerManager() const {
   return mListenerManager;
 }
 
-void nsDocument::GetEventTargetParent(EventChainPreVisitor& aVisitor) {
+void nsIDocument::GetEventTargetParent(EventChainPreVisitor& aVisitor) {
   if (mDocGroup && aVisitor.mEvent->mMessage != eVoidEvent &&
       !mIgnoreDocGroupMismatches) {
     mDocGroup->ValidateAccess();
   }
 
   aVisitor.mCanHandle = true;
   // FIXME! This is a hack to make middle mouse paste working also in Editor.
   // Bug 329119
--- a/dom/base/nsDocument.h
+++ b/dom/base/nsDocument.h
@@ -102,22 +102,16 @@ class nsDocument : public nsIDocument {
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
  public:
   using mozilla::dom::DocumentOrShadowRoot::GetElementById;
   using mozilla::dom::DocumentOrShadowRoot::GetElementsByClassName;
   using mozilla::dom::DocumentOrShadowRoot::GetElementsByTagName;
   using mozilla::dom::DocumentOrShadowRoot::GetElementsByTagNameNS;
 
-  // EventTarget
-  void GetEventTargetParent(mozilla::EventChainPreVisitor& aVisitor) override;
-  virtual mozilla::EventListenerManager* GetOrCreateListenerManager() override;
-  virtual mozilla::EventListenerManager* GetExistingListenerManager()
-      const override;
-
   virtual nsresult Init();
 
   virtual void Destroy() override;
   virtual void RemovedFromDocShell() override;
 
   virtual void BlockOnload() override;
   virtual void UnblockOnload(bool aFireSync) override;
 
--- a/dom/base/nsIDocument.h
+++ b/dom/base/nsIDocument.h
@@ -513,16 +513,21 @@ class nsIDocument : public nsINode,
   }
   void SetValueMissingState(const nsAString& aName, bool aValue) final {
     return DocumentOrShadowRoot::SetValueMissingState(aName, aValue);
   }
 
   // nsIScriptObjectPrincipal
   nsIPrincipal* GetPrincipal() final { return NodePrincipal(); }
 
+  // EventTarget
+  void GetEventTargetParent(mozilla::EventChainPreVisitor& aVisitor) override;
+  mozilla::EventListenerManager* GetOrCreateListenerManager() override;
+  mozilla::EventListenerManager* GetExistingListenerManager() const override;
+
   // This helper class must be set when we dispatch beforeunload and unload
   // events in order to avoid unterminate sync XHRs.
   class MOZ_RAII PageUnloadingEventTimeStamp {
     nsCOMPtr<nsIDocument> mDocument;
     bool mSet;
 
    public:
     explicit PageUnloadingEventTimeStamp(nsIDocument* aDocument)