Bug 1450271 Make MediaQueryList bind to its document's inner window. r=baku
authorBen Kelly <ben@wanderview.com>
Mon, 02 Apr 2018 08:35:52 -0700
changeset 467423 59464153053d5bed2de923f3920720747fc48234
parent 467422 c22501d278b45f44f4133f1ea174ad0a2b006c87
child 467424 200f42e5b1e7115df9f1bcccfdf58880d7157765
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1450271
milestone61.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 1450271 Make MediaQueryList bind to its document's inner window. r=baku
layout/style/MediaQueryList.cpp
--- a/layout/style/MediaQueryList.cpp
+++ b/layout/style/MediaQueryList.cpp
@@ -18,17 +18,18 @@
 #define ONCHANGE_STRING NS_LITERAL_STRING("change")
 
 namespace mozilla {
 namespace dom {
 
 MediaQueryList::MediaQueryList(nsIDocument* aDocument,
                                const nsAString& aMediaQueryList,
                                CallerType aCallerType)
-  : mDocument(aDocument)
+  : DOMEventTargetHelper(aDocument->GetInnerWindow())
+  , mDocument(aDocument)
   , mMatches(false)
   , mMatchesValid(false)
 {
   mMediaList = MediaList::Create(aMediaQueryList, aCallerType);
 
   KeepAliveIfHasListenersFor(ONCHANGE_STRING);
 }