Require Layout Not Being Honored in Safari
What's the issue?
Requesting layoutCallback to be triggered does not appear to work on iOS Safari. This was discovered while trying to figure out why refresh for ads is not working on the same browser.
How do we reproduce the issue?
- Pull down the glevitzky-request-layout branch and run gulp.
- In Chrome with dev console open, navigate to localhost:8000/examples/refresh.amp.html and observe the following within amp-a4a.js:
a. Execution will pause due to debugger statement in
layoutCallback. Press resume. b. Execution will pause (after a second or two) inrefreshdue to debugger statement. Observe that the three lines following the debugger statement set up the call for the next layoutcallback. Press resume. c. Execution will pause (after another second or two) inlayoutCallback. This is the correct sequence of events. - Now repeat step 2 in Safari. Observe that execution never pauses in
layoutCallbackafterrefresh, as if therequireLayoutcall is simply not honored in Safari.
What browsers are affected?
Safari
Which AMP version is affected?
This is happening in the current version, 1524489706901, and at least the preceding two versions before it.
Dima, assigning this to you since you wrote the requireLayout code. Please reassign to someone more appropriate, if necessary.
@lannka, @jridgewell could you ptal or reassign?
This is not a Resources issue, I've verified everything inside Safari (it worked, once).
Rather, it appears to be a spotty keyset fetch. I can't understand it. It's literally a fetch('...keyset.json', opts) and it's never resolving.
Promoting this to a P0 because, frankly, it scares me that Safari would fail to resolve a fetch's promise. We really need to figure out what the hell is going on, and whether we need to fall back on Polyfills in Safari (which would be a major drag).
Not a P0, whoo.
This is looks to be because one of your timers trips due to the debugger call in layoutCallback. If I disable breakpoints, reload, then enable the breakpoints after the ad renders, it hits the debugger in refresh.
Back to ads.
It sounds like it still does not call layoutCallback a second time (which is the crux of the issue for me), is that correct? If so, do you have any ideas why that might be?
I hit it every time.
There's an issue with this.friendlyIframeEmbed_.destroy() throwing because the node isn't attached, but that's not the same issue.
Okay, that's good news. Thanks for testing, Justin.