b2g desktop client default size not exposed by CSS media queries

RESOLVED FIXED in DeveloperPhone

Status

Firefox OS
General
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: djf, Assigned: djf)

Tracking

unspecified
DeveloperPhone
x86
Mac OS X

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

6 years ago
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.
(Assignee)

Comment 1

6 years ago
Created attachment 636364 [details] [diff] [review]
change shell.js to set dimensions of shell <html:iframe>
Attachment #636364 - Flags: review?(21)
(Assignee)

Comment 2

6 years ago
Hmm.  I worry now that this change will break orientation changes.  Starting a lengthy rebuild to test it on a phone.
(Assignee)

Comment 3

6 years ago
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.
(Assignee)

Comment 4

6 years ago
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.
Assignee: nobody → dflanagan
Attachment #636364 - Attachment is obsolete: true
Attachment #636364 - Flags: review?(21)
Attachment #636398 - Flags: review?(21)
(Assignee)

Updated

6 years ago
Keywords: checkin-needed

Comment 6

6 years ago
https://hg.mozilla.org/mozilla-central/rev/8a0a36ccc830
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.