innerWidth on android without <meta name=viewport> doesn't return the proper value if you query it early enough
Categories
(Core :: Layout, defect)
Tracking
()
People
(Reporter: emilio, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
If you load https://crisal.io/tmp/screen-desktop-viewport.html on Android nightly, you get something like:
innerWidth: 414
innerHeight: 802
outerWidth: 411
outerHeight: 797
screen.width: 414
screen.height: 874
You get different results if you dump the values after load, with innerWidth=980
, which is the right viewport value because this page has no <meta viewport>
all along.
I think this is because we haven't sized the layout viewport yet by the time this happens. But Chrome and Safari do manage to show the right size, so this looks like a potential interop issue.
Another really odd thing is that outerWidth is smaller than innerWidth, that does look like a clear bug too.
Comment 1•4 years ago
|
||
We don't yet return the layout viewport for window.{innerWidth,innerHeight}.
Reporter | ||
Comment 2•4 years ago
|
||
How not? We return the right number after load, where does it come from?
Comment 3•4 years ago
|
||
So, in this case, the value is the visual viewport size, and at the moment we get the correct value the visual viewport size == the layout viewport size. I am not saying bug 1598487 fixes this issue, it's just a "SeeAlso" bug.
Comment 4•4 years ago
|
||
Oh, maybe bug 1598487 will fix this, if, when we get the wrong value the layout size is the correct one. I am not sure though.
Comment 5•4 years ago
•
|
||
Boo, my memory was totally out-dated. We haven't returned the visual viewport size for window.{innerWidth, innerHeight) for a while.
Updated•4 years ago
|
Comment 6•4 years ago
|
||
Updated•4 years ago
|
Comment 7•4 years ago
•
|
||
I have a fairly straightforward fix for this, but note that it does not fix the related case where there is a meta-viewport tag with an explicit width. In that case, innerWidth
may be evaluated before the DOMMetaAdded
event for the meta-viewport tag arrives, in which case the info from the tag isn't available yet.
Comment 9•4 years ago
|
||
Backed out for perma failures.
Log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=315511888&repo=autoland&lineNumber=2620
Backout: https://hg.mozilla.org/integration/autoland/rev/6f8fba6924200eec39bc335d84ebed3a822301cb
Comment 10•4 years ago
|
||
There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:botond, could you have a look please?
For more information, please visit auto_nag documentation.
Comment 11•4 years ago
|
||
The patch caused a test failure that requires investigation before I can re-land.
I will take a look when I get a chance, but I have higher priority things to look at right now.
Comment 12•3 years ago
|
||
Not sure when I'll get a chance to get back to this.
Description
•