summaryrefslogtreecommitdiff
path: root/dom
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-07-12 02:56:48 +0000
committerMoonchild <moonchild@palemoon.org>2021-07-12 02:56:48 +0000
commitea0e4de698ec2f983cfb0a6f758a41a15bccba5a (patch)
tree8320918deef75bf20ca35abb965d30337cd19be6 /dom
parent6e7adbe74d3034407e583187aef8d64026ba2b67 (diff)
downloaduxp-ea0e4de698ec2f983cfb0a6f758a41a15bccba5a.tar.gz
Issue #1792 - Part 2: Move GetParentObject() to EventTarget.h for re-use.
Diffstat (limited to 'dom')
-rw-r--r--dom/events/DOMEventTargetHelper.h5
-rw-r--r--dom/events/EventTarget.h6
2 files changed, 7 insertions, 4 deletions
diff --git a/dom/events/DOMEventTargetHelper.h b/dom/events/DOMEventTargetHelper.h
index 63f3598048..9a1938078d 100644
--- a/dom/events/DOMEventTargetHelper.h
+++ b/dom/events/DOMEventTargetHelper.h
@@ -146,10 +146,7 @@ public:
void BindToOwner(nsPIDOMWindowInner* aOwner);
void BindToOwner(DOMEventTargetHelper* aOther);
virtual void DisconnectFromOwner();
- nsIGlobalObject* GetParentObject() const
- {
- return GetOwnerGlobal();
- }
+ using EventTarget::GetParentObject;
virtual nsIGlobalObject* GetOwnerGlobal() const override
{
nsCOMPtr<nsIGlobalObject> parentObject = do_QueryReferent(mParentObject);
diff --git a/dom/events/EventTarget.h b/dom/events/EventTarget.h
index c64296993b..9e5d1e7653 100644
--- a/dom/events/EventTarget.h
+++ b/dom/events/EventTarget.h
@@ -26,6 +26,7 @@ class Event;
class EventListener;
class EventListenerOptionsOrBoolean;
class EventHandlerNonNull;
+class GlobalObject;
template <class T> struct Nullable;
@@ -55,6 +56,11 @@ public:
ErrorResult& aRv);
bool DispatchEvent(JSContext* aCx, Event& aEvent, ErrorResult& aRv);
+ nsIGlobalObject* GetParentObject() const
+ {
+ return GetOwnerGlobal();
+ }
+
// Note, this takes the type in onfoo form!
EventHandlerNonNull* GetEventHandler(const nsAString& aType)
{