Closed
Bug 892760
Opened 13 years ago
Closed 12 years ago
Resolution media queries aren't right on Peak / new device
Categories
(Firefox OS Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: nick, Unassigned)
Details
(Whiteboard: [apps watch list])
Attachments
(1 file)
|
778 bytes,
application/zip
|
Details |
I'm trying to apply a different set of styles for a peak, but I don't think that the media queries are being followed correctly on the device. window.devicePixelRatio reports on the peak as being 1.6875 but rules applied for @media (min-resolution: 1.6dppx) are not applied. See the attached example that works on a retina MBP.
Comment 1•12 years ago
|
||
Using on 1.1 Peak the test case from bug 779527: http://lucasr.org/res.html returns incorrectly MDPI.
Comment 2•12 years ago
|
||
Same bad test report applies for a Nexus 4 with 1.2/mc.
Bug 779527 fixed resolution in Fennec.
Bug 830644 mentioned this: Gaia responsive UI work is not reflected on mediaquieries (min-resolution) or window.devicePixelRatio, both of them return static values right now (96 and 1), also our window.innerWidth & window.innerHeight will return device pixels instead of CSS pixels (scaled ones). That means we will have compatibilities problems with some websites/external apps.
Bug 845182 lands GetDefaultScaleInternal() support for Gonk.
Comment 3•12 years ago
|
||
Request that this is tested on a V1.1hd device.
blocking-b2g: --- → hd?
Summary: Resolution media queries aren't right on Peak → Resolution media queries aren't right on Peak / new device
Updated•12 years ago
|
Whiteboard: [apps watch list]
Comment 4•12 years ago
|
||
(In reply to Karen Ward [:kward] from comment #3)
> Request that this is tested on a V1.1hd device.
v1.1hd device comes with dppx=1.5, not 1.6875.
Comment 5•12 years ago
|
||
I tried to set |layout.css.devPixelsPerPx| to 1.6875 in Fx24 Mac and
|window.matchMedia('(min-resolution: 1.6dppx)').matches| returns true.
I am not entirely sure what's the version of Gecko Peak is using; if it's not at least b2g18_v1_1_0hd there is really nothing we could do on the Mozilla side.
blocking-b2g: hd? → ---
Flags: needinfo?(ndesaulniers)
Comment 7•12 years ago
|
||
"v1.1hd device comes with dppx=1.5, not 1.6875."
That's correct, and native Peak dpi is 1.68.
We publish our manifests. This is the last one and you can see the last revision. We are using v.1.1.0hd.
http://www.geeksphone.com/manifests/latest/source_peak-v1.1.0hd.xml
Flags: needinfo?(gp)
Comment 9•12 years ago
|
||
(In reply to Nick Desaulniers [:\n] from comment #8)
> Tim, did the info from GP help?
No. That simply means the cause is not found yet. However, when I post this bug to dev-gaia, someone told me that Peak should be configured to 1.5, not 1.6 nor 1.68. So you test app should work if you change the media query to 1.5.
BTW, the inline <script> will be blocked by CSP so to alert devicePixelRatio you should be using an external script, even if it's just one line...
Flags: needinfo?(nick)
| Reporter | ||
Comment 10•12 years ago
|
||
Nice I just upgraded to 1.1.0hd and get a devicePixelRatio of 1.7142857313156128 and a min-resolution of 1.7dppx works! Nice work!
Status: NEW → RESOLVED
Closed: 12 years ago
Flags: needinfo?(nick)
Resolution: --- → FIXED
Comment 11•12 years ago
|
||
(In reply to Nick Desaulniers [:\n] from comment #10)
> Nice I just upgraded to 1.1.0hd and get a devicePixelRatio of
> 1.7142857313156128 and a min-resolution of 1.7dppx works! Nice work!
Hi GP,
Please confirm this is the intended dppx for Peak. If not, please fix the bug on your side.
Any values other than 1.5 is sub-optimal to web developers. Do you really want to use that?
Flags: needinfo?(gp)
Comment 12•12 years ago
|
||
(In reply to Tim Guan-tin Chien [:timdream] (MoCo-TPE) from comment #11)
> (In reply to Nick Desaulniers [:\n] from comment #10)
> > Nice I just upgraded to 1.1.0hd and get a devicePixelRatio of
> > 1.7142857313156128 and a min-resolution of 1.7dppx works! Nice work!
>
> Hi GP,
>
> Please confirm this is the intended dppx for Peak. If not, please fix the
> bug on your side.
> Any values other than 1.5 is sub-optimal to web developers. Do you really
> want to use that?
Hi,
On our 1.1.0hd versions we hardcoded devicePixelRatio to 1.7 on widget/gonk/nsWindow.cpp because 1.5 devicePixelRatio is low for Peak and the correct Aspect ratio is 1.7
The best for us, is to have a way on widget/gonk/nsWindow.cpp to detect or set the correct devicePixelRatio on GetDefaultScaleInternal method.
For example, we can set a system prop (on build.prop) moz.custom.pixel.ratio=1.7 and load it on GetDefaultScaleInternal method. Or improve the method to calculate the correct Aspect ratio.
Regards.
Flags: needinfo?(gp)
You need to log in
before you can comment on or make changes to this bug.
Description
•