NEW217949
resize event is not fired while the page is still loading
https://bugs.webkit.org/show_bug.cgi?id=217949
Summary resize event is not fired while the page is still loading
Maxim Tsoy
Reported 2020-10-20 05:25:08 PDT
It seems like Safari on iOS/iPadOS does not trigger resize events until all the page resources are loaded. Steps to reproduce: 1. Open http://x.zok.pw/ios-iframe-resize/parent.html 2. Press the "open slowchild" button 3. Observe that there is no messages about resize events inside the iframe Expected behaviour: there should be a resize event detected at step 3. The test page contains the second button "open child", which opens a similar frame without slow resources. In this case, `onload` event is fired before the resize, and resize event is correctly fired inside the frame. Notes: I could reproduce this bug only on iOS. Desktop Safari, Chrome and Firefox trigger the resize vent as expected. According to the HTML spec (Step 4 of https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering), user agent can decide to skip the resize steps, but in this case the viewport has actually changed. This is also detected in the test page.
Attachments
Maxim Tsoy
Comment 1 2020-10-20 08:21:47 PDT
After some more testing, I could reproduce the issue even after the iframe reached the `complete` document state, so I'm not sure if it's related to the DOM ready state. It seems to reproduce reliably on the provided test page, so hopefully it will be helpful to find the root cause.
Alexey Proskuryakov
Comment 2 2020-10-21 17:33:04 PDT
I can reproduce. The resize event also fails to trigger when rotating. See this code in FrameView.cpp: #if PLATFORM(IOS_FAMILY) // Don't send the resize event if the document is loading. Some pages automatically reload // when the window is resized; Safari on iOS often resizes the window while setting up its // viewport. This obviously can cause problems. if (DocumentLoader* documentLoader = frame().loader().documentLoader()) { if (documentLoader->isLoadingInAPISense()) return; } #endif
Radar WebKit Bug Importer
Comment 3 2020-10-22 10:29:12 PDT
Simon Fraser (smfr)
Comment 4 2020-10-22 11:11:22 PDT
That's on old change from iOS WebKit upstreaming. Could potentially be re-visited.
Ahmad Saleem
Comment 5 2022-09-12 14:43:42 PDT
I am able to reproduce this on iOS 16 (Safari 16) as well. >> Safari Desktop: I'm a slow child window Mon Sep 12 2022 22:41:23 GMT+0100 (British Summer Time) resize event fired Broken Image icon >> Safari iOS: I'm a slow child window Broken Image icon
Note You need to log in before you can comment on or make changes to this bug.