matchMedia() returns invalid results if called too early

RESOLVED WORKSFORME

Status

()

RESOLVED WORKSFORME
4 years ago
2 years ago

People

(Reporter: maxaks, Unassigned)

Tracking

(Depends on: 1 bug)

32 Branch
ARM
Android
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

4 years ago
Device screen is 720x1280 pixels.

If you call window.matchMedia('(max-width: 480px)').matches on DOMContentLoaded, it will return false.
Calling it 1 second later properly returns true.

It started to happen in FF 32. FF 31 and latest mobile Chrome seem to work fine (the linked test page properly displays "true, true", while Fennec 32 shows "false, true".
Should this be moved to Core::CSS Parsing & Computation?
Component: General → Graphics, Panning and Zooming
The test case linked from this bug works fine now in the latest Nightly. It was probably fixed by bug 1180267 which landed yesterday.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 3 years ago
Depends on: 1180267
Resolution: --- → WORKSFORME
(I tested on a Nexus 4, for the record)
You need to log in before you can comment on or make changes to this bug.