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
This commit is contained in:
Gregory Pappas 2023-10-17 11:52:54 +00:00
parent d42e0c1758
commit 96f4cc4e59

View File

@ -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(