[Webkit-unassigned] [Bug 154819] WebGL canvas resumes at incorrect size/scale

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 26 10:38:57 PDT 2016


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

--- Comment #4 from David <david+webkit at limnu.com> ---
For what it's worth - I'm not sure if extra detail is helpful, but here are a few things I've tried & seen.

- If the canvas size is specified in px in the html document, then this problem doesn't occur. When the canvas size is specified in percent units, then the problem does happen, even if the canvas.style.{width,height} are later set to px units in javascript.

- If the canvas CSS width/height is set to '100%', and it resizes incorrectly, then changing the size to 99% and back to 100% after a small delay causes a reflow that restores the correct canvas layout size. Toggling visibility also works. But this isn't generally a practical workaround.

- I don't get a resize event when the app is resumed from sleep. I do see 2 resize events when the app is suspended. Perhaps this is a separate bug?

- The two resize events I get have strange sizes, for example in landscape orientation with Safari on an iPad Pro (iOS 9.3.1), my initial window size is 980x665. When I hit the home button and log the window size from inside onWindowResize(), I see two resize events back to back, and the first one has an incorrect size & aspect.

[Log] onWindowResize – Event {clipboardData: undefined, type: "resize", target: Window, …} (fix.js, line 106)
[Log] window.innerWidth=980 window.innerHeight=1215 (fix.js, line 109)

[Log] onWindowResize – Event {clipboardData: undefined, type: "resize", target: Window, …} (fix.js, line 106)
[Log] window.innerWidth=980 window.innerHeight=665 (fix.js, line 109)

- When the canvas resizes to be incorrectly large, the canvas style.width and style.height attributes reported are the original, correct values, so I can't detect when things have gone bad. I don't see changes to window.innerWidth during suspend/resume either, so the workaround Ashley mentioned doesn't seem to work for me.

-- 
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/20160426/a8d41341/attachment-0001.html>


More information about the webkit-unassigned mailing list