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:
bors-servo 2016-11-02 14:51:12 -05:00 committed by GitHub
commit 6ef46ab9e4
22 changed files with 500 additions and 20 deletions

View file

@ -14,12 +14,16 @@
DOMInterfaces = {
'MediaQueryList': {
'weakReferenceable': True,
},
'Promise': {
'spiderMonkeyInterface': True,
},
'Range': {
'weakReferenceable': True,
'weakReferenceable': True,
},
#FIXME(jdm): This should be 'register': False, but then we don't generate enum types

View file

@ -91,6 +91,7 @@ use std::time::{SystemTime, Instant};
use string_cache::{Atom, Namespace, QualName};
use style::attr::{AttrIdentifier, AttrValue, LengthOrPercentageOrAuto};
use style::element_state::*;
use style::media_queries::MediaQueryList;
use style::properties::PropertyDeclarationBlock;
use style::selector_impl::{ElementSnapshot, PseudoElement};
use style::values::specified::Length;
@ -367,7 +368,7 @@ no_jsmanaged_fields!(WebGLProgramId);
no_jsmanaged_fields!(WebGLRenderbufferId);
no_jsmanaged_fields!(WebGLShaderId);
no_jsmanaged_fields!(WebGLTextureId);
no_jsmanaged_fields!(MediaQueryList);
impl JSTraceable for Box<ScriptChan + Send> {
#[inline]