-
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
High Res device test re: #441 #443
Conversation
This'll need to go into a new file in the feature-detects folder using the i'd also love if you could drop in a few of the links found here https://www.google.com/?q=%22devicePixelRatio%22 probably including brads. thxx |
This reverts commit 5f111d8.
I'm happy to do that...but I don't really understand how a test file is added. I don't think it works in its current state, something must be missing. I would suggest a quick How To Contribute wiki page. It can't be more than 4 or 5 steps, but I'm just not seeing it. |
One thing you may want to test is firefox mobile which doesn't support So you could use |
aww dang. I'll be flying/coding blind for FF mobile. I'll try to cook up a |
I can doublecheck FF mobile when this is updated. |
okie doke. got @ryanve 's better version in there. Sadly now I am not the author of this test. Curator at best :( |
@matthewlein Inspired by at least ;) |
OK duders, let's focus on getting this released to the eager masses, then you guys can golf it down to your heart's content. Can someone confirm FF mobile and, if good, merge? |
if someone can make jsbin with this test i can look at it on ff mobile |
done and done |
@paulirish @matthewlein Here try this jsbin.com/elogax/11/edit. I haven't done any sites where I based anything on |
@matthewlein I didn't see that you just done'd it ;) |
with the ipad high res buzz...it might be nice to roll this in soonish (when you get back from SXSW). |
FF mobile betahttp://jsbin.com/oziboj/4 :
|
http://jsbin.com/oziboj/4 is true on the 3rd ipad |
@matthewlein plz verify the above results are correct. also what's with if these results are good, we'll pull this (minus that whack style :) |
OK, so here's what I learned today. FF mobile gives these: Opera Mini uses ratios only like 3/2 (not numbers like 1.5), and fails 3/2 but passes 2.99/2: Bin with that test info: So my latest version uses only media queries, and sets the number = 1.499 and ratio = 2.99/2 to cover inconsistancies with matching. I can verify these: iPod Safari: true And here's a bin with the latest code for testing other devices http://jsbin.com/oziboj/25/ |
@paulirish The technical name for that is Autonomous Semicolon Assertion. ; ) It can be useful if you don't want to put semicolons at the end of a line and also don't want code checking tools to complain. |
@ryanve what tools parse |
@paulirish Oh I just meant the The only checkers I know about are the compiler, jslint and jshint. You know any others? From the web I find jslint easier to use than jshint. One day I should figure out how to use jshint better. |
i see. you're just using //var as a way to indicate you've finished a long that's it. hmmm.. what do you think is easier about jslint vs jshint? |
Theoretically jshint is awesomer but I think it takes too long to set the options. There's also something traumatizing about the red bar that appears when there are errors. The new jslint has that too but it doesn't have the same effect. I wish both of them had links next to the errors to let you "ignore errors like these" rather than having to figure out which option pertains to which error, and they should group the errors by severity rather than line so that it'd be easier to scan. |
over in h5bp/html5-boilerplate#1127 this discussion continues |
Based on http://www.w3.org/blog/CSS/2012/06/14/unprefix-webkit-device-pixel-ratio/ I'm not convinced we are testing the right thing here. |
Here's a fiddle that I think tests the different options http://jsfiddle.net/matthewlein/MRy33/ I'm seeing some undesirable results on desktops. Webkit fails (as expected), FF doesn't seem to accept dppx (and dpi might introduce more problems, as cited in article), Opera gives false positives. FF: Opera: on my iPod, webkit failing as expected. Opera Mini: Did I mess something up? Can anyone find an example of dppx working? If not, the current test might be as good as we can do for now, then you can roll in resolution as when it works as expected. |
relevant from ppk: http://www.quirksmode.org/blog/archives/2012/07/more_about_devi.html |
As of ff16 they've dropped the silly https://developer-new.mozilla.org/en-US/docs/CSS/Media_queries#-moz-device-pixel-ratio I'd say a good test would be to first check |
What happened with this? Has the idea been abandoned? |
I don't have the means (aka phones) to test it thoroughly on my own so I couldn't finish it up. I have seen much simpler versions recently. These 2 are recent and similar Modifying my original one, this might work for you. Its based on a 1.5 as the threshold for hi res. Even if its not pulled into the repo, you can still drop it into your code and it might solve all your problems. Or most of them, or enough for now. |
Might be easier to raise a new PR if we do want to include this – the codebase has changed quite a lot and it would need to be in the v3 format. A few thoughts:
|
Yea, it probably should not be rolled in. At the time it made sense since things were 1x or 2x, and now its the wild west and that won't change until everything is beyond the human eye's capacity. Agreed that 1.5 is arbitrary and over time will become the norm and will be perceived as low res. Although I hate the idea, some people might want low, medium, high, and more resolution break points, so hi/low isn't enough. And I don't see much of a reason to use a class instead of a dedicated media query in your stylesheets. In fact I would probably prefer to have all the 1.5 or 2 or 3.0 res styles together in once place instead of scattered all over. It's mildly useful for someone as a reference point if they want to make their own test(s) to include custom classes. But I say...close'r down. |
Cool, thanks Matthew. |
Test for high res devices
I don't have a slew of devices, but fails my desktop and passes on my iPod touch.
For doing fancy css like this:
http://bradbirdsall.com/mobile-web-in-high-resolution