From 96f4cc4e590a783bba6aeec95711c7bead91722a Mon Sep 17 00:00:00 2001 From: Gregory Pappas Date: Tue, 17 Oct 2023 11:52:54 +0000 Subject: [PATCH] Bug 1859236 - Use IsSecureContextOrObjectIsFromSecureContext to decide if we want to expose getCoalescedEvents r=smaug Otherwise, it will not be exposed to WebExtension content scripts. Differential Revision: https://phabricator.services.mozilla.com/D191145 --- dom/events/PointerEvent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom/events/PointerEvent.cpp b/dom/events/PointerEvent.cpp index 2d82a2f8347e..4df6eb8bbc59 100644 --- a/dom/events/PointerEvent.cpp +++ b/dom/events/PointerEvent.cpp @@ -210,7 +210,7 @@ bool PointerEvent::IsPrimary() { return mEvent->AsPointerEvent()->mIsPrimary; } bool PointerEvent::EnableGetCoalescedEvents(JSContext* aCx, JSObject* aGlobal) { return !StaticPrefs:: dom_w3c_pointer_events_getcoalescedevents_only_in_securecontext() || - JS::GetIsSecureContext(js::GetContextRealm(aCx)); + IsSecureContextOrObjectIsFromSecureContext(aCx, aGlobal); } void PointerEvent::GetCoalescedEvents(