Bug 201767 - REGRESSION (iOS 13): rAF stops firing when navigating away cross-origin and then back
Summary: REGRESSION (iOS 13): rAF stops firing when navigating away cross-origin and t...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-09-13 11:55 PDT by Ali Juma
Modified: 2019-09-20 16:46 PDT (History)
10 users (show)

See Also:


Attachments
Test case (564 bytes, text/html)
2019-09-13 11:55 PDT, Ali Juma
no flags Details
Test case (563 bytes, text/html)
2019-09-13 12:03 PDT, Ali Juma
no flags Details
Patch (9.02 KB, patch)
2019-09-16 15:50 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews214 for win-future (13.72 MB, application/zip)
2019-09-16 17:25 PDT, EWS Watchlist
no flags Details
Patch (11.77 KB, patch)
2019-09-17 08:32 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (5.54 KB, patch)
2019-09-20 15:29 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ali Juma 2019-09-13 11:55:52 PDT
Created attachment 378740 [details]
Test case

Steps to reproduce (from https://bugs.chromium.org/p/chromium/issues/detail?id=1003803):
1) Visit the attached test page. Notice the counter gets updated once every 10 frames using rAF.
2) Navigate away, either by clicking on the button or just by typing a URL in the usual way.
3) Go back to the first page.

Expected result:
The counter resumes updating.

Actual result:
The counter is either frozen or updates very slowly (e.g., only updates while pinch-zooming and then stops again).

This seems to be related to the fact the test case only updates the page once every 10 rAF callbacks; if I change this to update the page on every rAF, the bug no longer repros.
Comment 1 Ali Juma 2019-09-13 12:03:12 PDT
Created attachment 378742 [details]
Test case

It also seems important that the URL used in Step 2 is cross-origin wrt the URL from step 1.
Comment 2 Simon Fraser (smfr) 2019-09-13 13:43:46 PDT
That suggests that it's PSON-related.
Comment 3 Radar WebKit Bug Importer 2019-09-13 13:44:07 PDT
<rdar://problem/55350854>
Comment 4 Antoine Quint 2019-09-16 01:16:31 PDT
Can you confirm this is with an iOS 13.1 beta? This is what I can gather from the Chromium bug but it would be nice for this bug to contain the configuration.
Comment 5 Ali Juma 2019-09-16 05:53:34 PDT
(In reply to Antoine Quint from comment #4)
> Can you confirm this is with an iOS 13.1 beta? This is what I can gather
> from the Chromium bug but it would be nice for this bug to contain the
> configuration.

This reproduces in iOS 13.1 beta 3, but also reproduces in iOS 13.0. However, it does not reproduce in iOS 12.4.
Comment 6 Ali Juma 2019-09-16 08:33:58 PDT
Debugging this a bit, we're stuck in a state where RenderingUpdateScheduler::isScheduled is true, but RenderingUpdateScheduler::displayRefreshFired never gets called.
Comment 7 Chris Dumez 2019-09-16 13:46:22 PDT
Ok, I can reproduce with the test case attached, thanks. I will investigate.
It does not likely related to PSON although, PSON really did not change much in iOS 13.
Comment 8 Chris Dumez 2019-09-16 14:34:07 PDT
I have a fix, working on an automated test.
Comment 9 Chris Dumez 2019-09-16 15:50:38 PDT
Created attachment 378904 [details]
Patch
Comment 10 Geoffrey Garen 2019-09-16 16:07:34 PDT
Comment on attachment 378904 [details]
Patch

r=me
Comment 11 EWS Watchlist 2019-09-16 17:24:48 PDT
Comment on attachment 378904 [details]
Patch

Attachment 378904 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/13037841

New failing tests:
http/tests/navigation/page-cache-requestAnimationFrame.html
Comment 12 EWS Watchlist 2019-09-16 17:25:03 PDT
Created attachment 378918 [details]
Archive of layout-test-results from ews214 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews214  Port: win-future  Platform: CYGWIN_NT-10.0-17763-3.0.5-338.x86_64-x86_64-64bit
Comment 13 Chris Dumez 2019-09-17 08:30:56 PDT
Comment on attachment 378904 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=378904&action=review

> LayoutTests/http/tests/navigation/page-cache-requestAnimationFrame.html:1
> +<!-- webkit-test-runner [ enablePageCache=true ] -->

I need to add support for this to DRT so the test passes for WebKit1. Will do so before landing.
Comment 14 Chris Dumez 2019-09-17 08:32:33 PDT
Created attachment 378966 [details]
Patch
Comment 15 Chris Dumez 2019-09-17 10:09:55 PDT
Comment on attachment 378966 [details]
Patch

Clearing flags on attachment: 378966

Committed r249961: <https://trac.webkit.org/changeset/249961>
Comment 16 Chris Dumez 2019-09-17 10:09:57 PDT
All reviewed patches have been landed.  Closing bug.
Comment 17 Chris Dumez 2019-09-20 15:00:53 PDT
Reopening for follow-up since this introduced crashes.
Comment 18 Chris Dumez 2019-09-20 15:29:37 PDT
Created attachment 379276 [details]
Patch
Comment 19 Tim Horton 2019-09-20 15:35:10 PDT
Comment on attachment 379276 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=379276&action=review

> LayoutTests/http/tests/navigation/page-cache-requestAnimationFrame.html:42
> +        }, 100);

This is ... not ideal, but OK
Comment 20 Chris Dumez 2019-09-20 16:46:49 PDT
Comment on attachment 379276 [details]
Patch

Clearing flags on attachment: 379276

Committed r250165: <https://trac.webkit.org/changeset/250165>
Comment 21 Chris Dumez 2019-09-20 16:46:51 PDT
All reviewed patches have been landed.  Closing bug.