Implement matchMedia and MediaQueryList

Fixes #13376.
This commit is contained in:
Jack Moffitt 2016-09-26 02:41:09 -06:00
parent 99ad3678fa
commit 138a0480fe
22 changed files with 500 additions and 20 deletions

View file

@ -0,0 +1,14 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// https://drafts.csswg.org/cssom-view/#mediaquerylist
[Exposed=(Window)]
interface MediaQueryList : EventTarget {
readonly attribute DOMString media;
readonly attribute boolean matches;
void addListener(EventListener? listener);
void removeListener(EventListener? listener);
attribute EventHandler onchange;
};

View file

@ -120,7 +120,7 @@ dictionary ScrollToOptions : ScrollOptions {
// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-window-interface
partial interface Window {
//MediaQueryList matchMedia(DOMString query);
[Exposed=(Window), NewObject] MediaQueryList matchMedia(DOMString query);
[SameObject] readonly attribute Screen screen;
// browsing context