When I run the b2g desktop client, it now displays a 320x480 window by default, but it does not correctly trigger my CSS media queries that test for that resolution. If I run b2g with --screen=320x480, media queries work as expected. The attached patch fixes the problem. I don't know if this is a minimal fix or not. Note that I'm patching shell.js not screen.js here, which means that this code affects actual devices as well as the desktop client. I have only tested it on the desktop, not on an actual device yet. I could move the patch so it is in screen.js and only runs on the desktop. But that seems like it might be unnecessary divergence between what runs on the phone and what runs on the desktop. So I'm thinking it is better (is slightly more risky) in shell.js.
Created attachment 636364 [details] [diff] [review] change shell.js to set dimensions of shell <html:iframe>
Hmm. I worry now that this change will break orientation changes. Starting a lengthy rebuild to test it on a phone.
Okay, so that attachment doesn't work on a phone that can actually rotate. So ignore it. I'll attach a patch to screen.js that only runs on the desktop instead. It feels like it might just be a workaround to an underlying bug, but I want to get this fixed soon for HVGA testing of our apps.
Created attachment 636398 [details] [diff] [review] Another fix that only modifies screen.js, and is desktop-only. This patch just modifies screen.js so it will never affect what's on the phone. I'd consider this a workaround rather than a fix, since I don't really understand why CSS media queries fail without it. But its pretty high-priority to be able to correctly test Gaia apps in b2g desktop, so I think it is worth landing even if it is just a workaround.
Attachment #636398 - Flags: review?(21) → review+
Status: NEW → ASSIGNED
Target Milestone: --- → DeveloperPhone
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.