Closed Bug 979924 Opened 11 years ago Closed 7 years ago

b2g-bin wrong min-device-height on CSS media queries

Categories

(Firefox OS Graveyard :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: mmedeiros, Unassigned)

Details

b2g reports the wrong device-height, it's using the host device-height instead of the window height. so media queries like `@media (min-device-height: 640px)` will be triggered when it shouldn't, which might cause errors on Travis/Marionette tests. - I had problems with the Calendar integration tests because of that.
Looks like this is likely impacted by the docshell.device_size_is_page_size pref. http://dxr.mozilla.org/mozilla-central/source/docshell/base/nsIDocShell.idl#950 We set this in the GAIA profile when DEBUG is set (in gaia/build/preferences.js). We check that this is the case for DEBUG in gaia/test/integration/build.test.js. This matters in: http://dxr.mozilla.org/mozilla-central/source/layout/style/nsMediaFeatures.cpp#113 If the pref is true, we use the nsPresContext's dimensions. If false, we use the device context's dimensions. This is probably the X server: http://dxr.mozilla.org/mozilla-central/source/gfx/src/nsDeviceContext.h#144 It seems like we/everyone probably always want this pref to be true when we are running in b2g-desktop. Which suggests we want to put it in an "#ifndef MOZ_WIDGET_GONK" section in http://dxr.mozilla.org/mozilla-central/source/b2g/app/b2g.js needinfo-ing Fabrice.
Flags: needinfo?(fabrice)
I'm probably an outlier there, but I don't want that in b2g desktop, not more than you want that in firefox desktop because of the potential impact on web sites.
Flags: needinfo?(fabrice)
(In reply to Fabrice Desré [:fabrice] from comment #2) > I'm probably an outlier there, but I don't want that in b2g desktop, not > more than you want that in firefox desktop because of the potential impact > on web sites. I'm having trouble parsing your meaning. I think I my have left some things implied so will re-state. Problem: Based on Miller's experience, media queries for device-height in our JS Marionette tests run on b2g-desktop seem to be using the dimensions of the X server. Possible solutions: * Don't use device-width/device-height in Gaia apps, just use width/height. * Address this directly in JS Marionette tests by either: ** forcing the xvfb we're running under to be our canonical device resolution ** explicitly setting the pref in our JS Marionette testing profile * Make b2g-desktop (aka b2g built with non-gonk bits) always do this. If we assume that b2g-desktop is always used in a simulator-type context, then the size of the b2g-desktop window is the size of the simulated device. As noted on bug 948045, the pref does fail to take into account the status-bar size, so it's also possible the most right fix is to make some other change to accomplish a similar effect. It sounds like you are saying that we are expecting people to use b2g-desktop to browse or test websites and that they will want to use it not as a device simulator, but as a variant of Firefox. But I could be misinterpreting. (Are you trying to get multiprocess Firefox by running b2g-desktop? :) cc'ing those involved in bug 948045 that introduced the pref to the gaia build step since we probably want more consistency here in general.
Flags: needinfo?(fabrice)
Also, I was generally asking in a "Fabrice knows lots of gecko internals, what would be the right way to fix this problem?", but I was assuming it's a problem and we agreed on the desired outcome. Totally fine to beg the question! :)
Ha ha, yes I'm probably one a the few that believe we should not set docshell.device_size_is_page_size to true by default on desktop builds. (In reply to Andrew Sutherland (:asuth) from comment #3) > > Possible solutions: > > * Don't use device-width/device-height in Gaia apps, just use width/height. Isn't that risky? > * Address this directly in JS Marionette tests by either: > ** forcing the xvfb we're running under to be our canonical device resolution > ** explicitly setting the pref in our JS Marionette testing profile That sounds reasonable to me. > * Make b2g-desktop (aka b2g built with non-gonk bits) always do this. If we > assume that b2g-desktop is always used in a simulator-type context, then the > size of the b2g-desktop window is the size of the simulated device. As > noted on bug 948045, the pref does fail to take into account the status-bar > size, so it's also possible the most right fix is to make some other change > to accomplish a similar effect. By status bar size, do you mean the xul chrome one from the simulator or gaia's top status bar? > It sounds like you are saying that we are expecting people to use > b2g-desktop to browse or test websites and that they will want to use it not > as a device simulator, but as a variant of Firefox. But I could be > misinterpreting. (Are you trying to get multiprocess Firefox by running > b2g-desktop? :) I totally think we should move to b2g-based products everywhere, but that's another debate as you can imagine ;)
Flags: needinfo?(fabrice)
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.