Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support @supports #14789

Merged
merged 7 commits into from Jan 9, 2017
Merged

Support @supports #14789

merged 7 commits into from Jan 9, 2017

Conversation

@Manishearth
Copy link
Member

Manishearth commented Dec 30, 2016

fixes #14786

cc @heycam @upsuper
r? @SimonSapin


This change is Reviewable

@highfive
Copy link

highfive commented Dec 30, 2016

Heads up! This PR modifies the following files:

  • @bholley: components/style/supports.rs, components/style/lib.rs, components/style/stylesheets.rs, components/style/stylist.rs
  • @emilio: components/style/supports.rs, components/style/lib.rs, components/style/stylesheets.rs, components/style/stylist.rs
@highfive
Copy link

highfive commented Dec 30, 2016

warning Warning warning

  • These commits modify style code, but no tests are modified. Please consider adding a test!
@Manishearth Manishearth force-pushed the Manishearth:supports branch from 06f4544 to af4d5d6 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.

Copy link
@Manishearth

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.

Copy link
@Manishearth

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)

@Manishearth Manishearth changed the title Support @supports (fixes #14786) Support @supports Dec 30, 2016
@Manishearth
Copy link
Member Author

Manishearth commented Dec 30, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Dec 30, 2016

Trying commit af4d5d6 with merge 9e93ba5...

bors-servo added a commit that referenced this pull request Dec 30, 2016
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
Copy link
Contributor

bors-servo commented Dec 30, 2016

💔 Test failed - linux-dev

@Manishearth
Copy link
Member Author

Manishearth commented Dec 30, 2016

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.

@Manishearth Manishearth force-pushed the Manishearth:supports branch from af4d5d6 to 68abf3d Dec 30, 2016
@Manishearth Manishearth force-pushed the Manishearth:supports branch from 68abf3d to 67c2ae6 Dec 30, 2016
@Manishearth
Copy link
Member Author

Manishearth commented Dec 30, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Dec 30, 2016

Trying commit 67c2ae6 with merge 7ae880f...

bors-servo added a commit that referenced this pull request Dec 30, 2016
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
Copy link
Contributor

bors-servo commented Dec 30, 2016

💔 Test failed - linux-dev

@@ -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.

Copy link
@emilio

emilio Dec 30, 2016

Member

Is ? in stable rust? Can we use it in stylo?

This comment has been minimized.

Copy link
@Manishearth

Manishearth Dec 30, 2016

Author Member

Yes, but stylo's Rust isn't new enough.

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.

Copy link
@emilio

emilio Dec 30, 2016

Member

vec.iter().any().(|c| c.eval(cx))?

ExperimentalProperty => false, // only happens for experimental props
// that haven't been enabled
InvalidValue => false,
AnimationPropertyInKeyframeBlock => false, // should never happen

This comment has been minimized.

Copy link
@emilio

emilio Dec 30, 2016

Member

Mark as unreachable!.

@bholley
Copy link
Contributor

bholley commented Dec 30, 2016

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

@Manishearth Manishearth force-pushed the Manishearth:supports branch from 67c2ae6 to 070283f Dec 30, 2016
@Manishearth Manishearth force-pushed the Manishearth:supports branch from 070283f to db3e018 Dec 31, 2016
@Manishearth
Copy link
Member Author

Manishearth commented Dec 31, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Dec 31, 2016

Trying commit db3e018 with merge 865242d...

bors-servo added a commit that referenced this pull request Dec 31, 2016
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
Copy link
Member Author

Manishearth commented Jan 6, 2017

Updated, fixed tests. Thanks for the fixups!

@bors-servo
Copy link
Contributor

bors-servo commented Jan 8, 2017

The latest upstream changes (presumably #14712) made this pull request unmergeable. Please resolve the merge conflicts.

@Manishearth Manishearth force-pushed the Manishearth:supports branch from 0485864 to dbc35f4 Jan 8, 2017
@Manishearth
Copy link
Member Author

Manishearth commented Jan 9, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Jan 9, 2017

Trying commit dbc35f4 with merge 1fc9b6b...

bors-servo added a commit that referenced this pull request Jan 9, 2017
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
Copy link
Member Author

Manishearth commented Jan 9, 2017

@bors-servo r=SimonSapin

@bors-servo
Copy link
Contributor

bors-servo commented Jan 9, 2017

📌 Commit 93f66ab has been approved by SimonSapin

@SimonSapin
Copy link
Member

SimonSapin commented Jan 9, 2017

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.
Review status: all files reviewed at latest revision, 7 unresolved discussions, some commit checks failed.


Comments from Reviewable

@bors-servo
Copy link
Contributor

bors-servo commented Jan 9, 2017

Testing commit 93f66ab with merge 50bba77...

bors-servo added a commit that referenced this pull request Jan 9, 2017
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 bors-servo merged commit 93f66ab into servo:master Jan 9, 2017
3 of 4 checks passed
3 of 4 checks passed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
dependency-ci Dependencies checked
Details
homu Test successful
Details
@Manishearth Manishearth deleted the Manishearth:supports branch May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

9 participants
You can’t perform that action at this time.