-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Implement Media Queries Level 4 #5265
Conversation
Critic review: https://critic.hoppipolla.co.uk/r/4294 This is an external review system which you may optionally use for the code review of your pull request. In order to help critic track your changes, please do not make in-place history rewrites (e.g. via |
Not going to lie, this is a pretty fantastic PR. |
Whoa. |
This looks great! I’ll take the review (on Critic). One thing is that the MQ4 spec (as opposed to 3) has not been reviewed a lot yet, and so our implementation should probably be behind the I’ll leave it to you to decide how to do that: either have conditional code paths in the new code or restore the old code ( By the way, as the Critic bot said, please avoid rebasing, rewriting, or squashing already-pushed commits until the review is done, as that makes it hard for the review tool to keep tracking comments made on specific diff lines. |
Also implement MQ 3 details, such as optional whitespace before/after 'and'
I've added two new commits that:
media_features! {
// MQ 4 § 4. Screen/Device Dimensions
// MQ 4 § 4.1
Width(name: "width",
value: Length,
type: range,
availability: {
since: SpecificationLevel::MEDIAQ3
},
impl: {
context: Au,
zero: Au(0),
compute: compute_length
}),
...
// MQ 4 § 5.4
UpdateFrequency(name: "update-frequency",
value: {
"none" => None,
"slow" => Slow,
"normal" => Normal
},
type: discrete,
availability: {
since: SpecificationLevel::MEDIAQ4
}),
...
}
|
😍 |
@SimonSapin How goes the review? It appears at 0% in Critic. |
@luniv Sorry for the delays. I’ve submitted a partial review on Critic, but: While it’s very cool to have a MQ4 implementation for Servo, it has very little practical impact in the near term. The MQ4 spec itself is not very stable yet, and no shipping browser implements it. (It’s not even listed on caniuse or MDN.) So I’m confident that practically no website relies on it. There’s also a risk that the spec still changes significantly from under us. I’m really grateful for this work you did, but this is why it’s relatively low priority and it may be a while still before I finish the review. |
Fair enough. Would it make sense to split out the parts that are in MQ3 (e.g. the other On Mon, Apr 20, 2015 at 10:14 AM, Simon Sapin notifications@github.com
|
One of my review comments is that I’d rather not parse at all media features for which we don’t have any meaningful support. (Those that have But yes, adding meaningful support for more level 3 media features would be good. |
@luniv Still hacking on this? |
I was, but I’ve relocated internationally, so haven’t had time to work on it. I’ll close this PR and revisit it when the dust from moving settles.
|
Spec: http://drafts.csswg.org/mediaqueries/#media-types