The resize event on mobile
Last week I did some research on the resize event on mobile and tablet browsers. Executive summary: it’s a mess. And the best browser, surprisingly, is Samsung’s Dolfin.
My conclusions are, summarised:
- Many browsers agree the resize event should be fired when the dimensions of the visual viewport, the layout viewport, or the HTML element change.
- If a browser can change the size of the layout viewport, it fires a resize event.
- Slightly more than half of the tested browsers fire a resize event when the HTML element’s dimensions change.
- Browsers are confused about the visual viewport. Only Android up to 2.3 and BlackBerry fire the event in all tested cases.
- Android 3.2 is worse in firing the resize event than 2.3.
- My test page does not work at all in Opera Mobile, so I have no results for that browser.
Read the rest for yourself. Here is the test page.