mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #13453 - metajack:media-query-list, r=jdm
Implement matchMedia and MediaQueryList <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #13376 (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Fixes #13376. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13453) <!-- Reviewable:end -->
This commit is contained in:
commit
6ef46ab9e4
22 changed files with 500 additions and 20 deletions
14
components/script/dom/webidls/MediaQueryList.webidl
Normal file
14
components/script/dom/webidls/MediaQueryList.webidl
Normal 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;
|
||||
};
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue