[Webkit-unassigned] [Bug 170595] window.innerWidth/innerHeight are bogus after both resize AND orientationchange events

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 11 11:22:32 PDT 2017


https://bugs.webkit.org/show_bug.cgi?id=170595

--- Comment #5 from ae at instinctive.de ---
If anyone is interested and/or trying to find a workaround for their situation: Both events are completely useless right now, as they never get called with the correct values for innerWidth/Height in place.

The quick fix I immediately deployed in my production apps was to just introduce a timeout in the orientationchange handler (0.7s), as I hoped that after 0.7 seconds, the values are finally correct (seems to be the case).

The "real" fix was to constantly check both innerWidth and innerHeight (say, 10 times per second) and if any of them changes, generate a "fake" resize event. That works, but is of course a waste of CPU and battery.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170411/2e87088d/attachment.html>


More information about the webkit-unassigned mailing list