Auto merge of #14433 - canaltinova:medialist, r=Manishearth

Implement MediaList interface

<!-- Please describe your changes on the following line: -->
Added MediaList interface and implemented `mediaText`, `length` and `index` attributes.
r? @Manishearth

---
<!-- 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

<!-- Either: -->
- [x] There are tests for these changes

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/14433)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-12-02 12:53:57 -08:00 committed by GitHub
commit 106a538e7e
10 changed files with 207 additions and 32 deletions

View file

@ -85,7 +85,7 @@ pub enum Qualifier {
Not,
}
#[derive(Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct MediaQuery {
pub qualifier: Option<Qualifier>,
@ -206,7 +206,7 @@ impl Expression {
}
impl MediaQuery {
fn parse(input: &mut Parser) -> Result<MediaQuery, ()> {
pub fn parse(input: &mut Parser) -> Result<MediaQuery, ()> {
let mut expressions = vec![];
let qualifier = if input.try(|input| input.expect_ident_matching("only")).is_ok() {