Bug 57408 - -webkit-min-device-pixel-ratio media query doesn't work post-SnowLeopard
Summary: -webkit-min-device-pixel-ratio media query doesn't work post-SnowLeopard
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Beth Dakin
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-03-29 17:39 PDT by Beth Dakin
Modified: 2011-06-18 11:59 PDT (History)
3 users (show)

See Also:


Attachments
Patch (15.68 KB, patch)
2011-03-29 18:00 PDT, Beth Dakin
no flags Details | Formatted Diff | Diff
New patch (15.69 KB, patch)
2011-03-29 18:08 PDT, Beth Dakin
no flags Details | Formatted Diff | Diff
Way cooler patch (15.53 KB, patch)
2011-03-29 23:29 PDT, Beth Dakin
mjs: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Beth Dakin 2011-03-29 17:39:28 PDT
Post-SnowLeopard, typing "javascript:alert(window.devicePixelRatio)" into the URL field always returns 1 regardless of the actual device pixel ratio.

<rdar://problem/8665411>
Comment 1 Beth Dakin 2011-03-29 18:00:26 PDT
Created attachment 87445 [details]
Patch

The new and the old APIs are implemented on both NSWindow and NSScreen. The call sites that used to have to nil-check NSWindow now just default to NSScreen.
Comment 2 WebKit Review Bot 2011-03-29 18:03:05 PDT
Attachment 87445 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebKit2/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Source/WebKit/mac/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Source/WebCore/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Total errors found: 3 in 19 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Beth Dakin 2011-03-29 18:08:28 PDT
Created attachment 87447 [details]
New patch
Comment 4 Beth Dakin 2011-03-29 18:08:58 PDT
(In reply to comment #2)
> Attachment 87445 [details] did not pass style-queue:
> 
> Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
> 
> Source/WebKit2/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
> Source/WebKit/mac/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
> Source/WebCore/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
> Total errors found: 3 in 19 files
> 
> 
> If any of these errors are false positives, please file a bug against check-webkit-style.

You lie style bot. You lie.
Comment 5 WebKit Review Bot 2011-03-29 18:10:05 PDT
Attachment 87447 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebKit2/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Source/WebKit/mac/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Source/WebCore/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Total errors found: 3 in 19 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Beth Dakin 2011-03-29 18:11:47 PDT
(In reply to comment #5)
> Attachment 87447 [details] did not pass style-queue:
> 
> Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
> 
> Source/WebKit2/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
> Source/WebKit/mac/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
> Source/WebCore/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
> Total errors found: 3 in 19 files
> 
> 
> If any of these errors are false positives, please file a bug against check-webkit-style.

Whatevs. Known liar.
Comment 7 Darin Adler 2011-03-29 18:11:54 PDT
Comment on attachment 87447 [details]
New patch

I’d probably use 72 instead of 72.0 in all those places. If this really is the best practice, then lets land this. I’m kind of surprised, though, because I’d think that we might want a different value if the HI scale factor of the window the view is being displayed in was 2X.
Comment 8 Beth Dakin 2011-03-29 23:29:33 PDT
Created attachment 87469 [details]
Way cooler patch

Thanks for the review Darin, but I take it back! deviceDescription is so two weeks ago. backingScaleFactor is all the rage these days.
Comment 9 WebKit Review Bot 2011-03-29 23:31:59 PDT
Attachment 87469 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebKit2/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Source/WebKit/mac/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Source/WebCore/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Total errors found: 3 in 19 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 10 Beth Dakin 2011-03-29 23:32:43 PDT
(In reply to comment #9)
> Attachment 87469 [details] did not pass style-queue:
> 
> Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
> 
> Source/WebKit2/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
> Source/WebKit/mac/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
> Source/WebCore/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
> Total errors found: 3 in 19 files
> 
> 
> If any of these errors are false positives, please file a bug against check-webkit-style.

Oh shush, you.
Comment 11 Maciej Stachowiak 2011-03-29 23:35:35 PDT
Comment on attachment 87469 [details]
Way cooler patch

r=me

Style checker's lies are probably because the usual style is to put the bugzilla number on a separate line after the bug title. Suggest making that change.
Comment 12 Beth Dakin 2011-03-29 23:44:11 PDT
(In reply to comment #11)
> (From update of attachment 87469 [details])
> r=me
> 
> Style checker's lies are probably because the usual style is to put the bugzilla number on a separate line after the bug title. Suggest making that change.

Thanks Maciej! I begrudgingly submit my ChangeLog individuality to the style bot overlords. 

Committed with revision 82398.
Comment 13 Eric Seidel (no email) 2011-04-06 10:46:31 PDT
Comment on attachment 87447 [details]
New patch

Cleared Darin Adler's review+ from obsolete attachment 87447 [details] so that this bug does not appear in http://webkit.org/pending-commit.