Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSupport @supports #14789
Support @supports #14789
Conversation
highfive
commented
Dec 30, 2016
highfive
commented
Dec 30, 2016
|
|
||
| if let Ok(first_cond) = input.try(SupportsCondition::parse_with_parens) { | ||
| if input.is_exhausted() { | ||
| // nested parens |
This comment has been minimized.
This comment has been minimized.
Manishearth
Dec 30, 2016
Author
Member
This is sort of wrong. Spec says we must preserve parens for serialization. Such rules should either be represented as a Single(Box<SupportsRule>) or just an And rule with a single element. Not sure which I should use.
This comment has been minimized.
This comment has been minimized.
Manishearth
Dec 31, 2016
Author
Member
Made it explicitly handle parenthesized cases, which fixes a couple tests.
@heycam suggested never storing it in a structured form in the first place, since we only need it for ToCssing -- we can just evaluate whilst parsing. However, the spec suggests we also clean up the whitespace and such, and it's better to store it in the structured form for that.
(Also, I bet eventually there will be more structured CSSOM access to this like we have for media queries)
|
@bors-servo try |
|
|
Support @supports fixes #14786 cc @heycam @upsuper r? @SimonSapin <!-- 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/14789) <!-- Reviewable:end -->
|
|
|
wpt at http://build.servo.org/builders/linux-rel-wpt/builds/1637 css at http://build.servo.org/builders/linux-rel-css/builds/1630 looks like geckolib hasn't been rustupped yet. Not sure if I should. |
|
@bors-servo try |
Support @supports fixes #14786 cc @heycam @upsuper r? @SimonSapin <!-- 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/14789) <!-- Reviewable:end -->
|
|
| @@ -859,6 +892,10 @@ impl<'a, 'b> AtRuleParser for NestedRuleParser<'a, 'b> { | |||
| let media_queries = parse_media_query_list(input); | |||
| Ok(AtRuleType::WithBlock(AtRulePrelude::Media(Arc::new(RwLock::new(media_queries))))) | |||
| }, | |||
| "supports" => { | |||
| let cond = SupportsCondition::parse(input, true)?; | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| match *self { | ||
| SupportsCondition::Not(ref cond) => !cond.eval(cx), | ||
| SupportsCondition::And(ref vec) => vec.iter().all(|c| c.eval(cx)), | ||
| SupportsCondition::Or(ref vec) => !vec.iter().all(|c| !c.eval(cx)), |
This comment has been minimized.
This comment has been minimized.
| ExperimentalProperty => false, // only happens for experimental props | ||
| // that haven't been enabled | ||
| InvalidValue => false, | ||
| AnimationPropertyInKeyframeBlock => false, // should never happen |
This comment has been minimized.
This comment has been minimized.
|
Bumping rust-stable-version to 1.13 should be fine - the Gecko builders were updated in https://bugzilla.mozilla.org/show_bug.cgi?id=1316751 |
|
@bors-servo try |
Support @supports fixes #14786 cc @heycam @upsuper r? @SimonSapin <!-- 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/14789) <!-- Reviewable:end -->
|
Updated, fixed tests. Thanks for the fixups! |
|
|
|
@bors-servo try |
Support @supports fixes #14786 cc @heycam @upsuper r? @SimonSapin <!-- 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/14789) <!-- Reviewable:end -->
|
|
|
@bors-servo r=SimonSapin |
|
|
|
Reviewed 1 of 96 files at r15, 5 of 96 files at r20, 12 of 12 files at r21, 74 of 74 files at r22, 3 of 3 files at r23, 2 of 2 files at r24, 2 of 93 files at r25, 12 of 12 files at r26, 74 of 74 files at r27, 3 of 3 files at r28, 2 of 2 files at r29. Comments from Reviewable |
Support @supports fixes #14786 cc @heycam @upsuper r? @SimonSapin <!-- 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/14789) <!-- Reviewable:end -->
|
|
Manishearth commentedDec 30, 2016
•
edited
fixes #14786
cc @heycam @upsuper
r? @SimonSapin
This change is