REGRESSION (iOS 13): rAF stops firing when navigating away cross-origin and then...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Sep 2019 17:09:49 +0000 (17:09 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Sep 2019 17:09:49 +0000 (17:09 +0000)
commitd5e5c41b8b2f0446dff50a1e247b6d6c371318f7
treec78d3f658b2f67800024da6cf566a239e6c91de5
parent3d363b845d9146dfcc7be7027e6741d02443f3ec
REGRESSION (iOS 13): rAF stops firing when navigating away cross-origin and then back
https://bugs.webkit.org/show_bug.cgi?id=201767
<rdar://problem/55350854>

Reviewed by Geoffrey Garen.

Source/WebKit:

When navigating back and restoring a SuspendedPage, WebPage::reinitializeWebPage() ends up
reconstructing a new DrawingArea to match the identifier of the DrawingAreaProxy that the
UIProcess created. The issue is that when reconstructing the DrawingArea, we were losing
the DisplayRefreshMonitors that had been registered on the previous drawing area. To
address the issue, we now make sure to transfer the DisplayRefreshMonitors over from the
old to the new drawing area. This patch is kept as small as possible to faciliate cherry
picking to a branch. However, I think we should consider refactoring the code so that
we no longer need to re-create the DrawingArea in the WebProcess in this case.

* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::adoptDisplayRefreshMonitorsFromDrawingArea):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::adoptDisplayRefreshMonitorsFromDrawingArea):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):

LayoutTests:

Add layout test coverage.

* http/tests/navigation/page-cache-requestAnimationFrame-expected.txt: Added.
* http/tests/navigation/page-cache-requestAnimationFrame.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249961 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/navigation/page-cache-requestAnimationFrame-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/navigation/page-cache-requestAnimationFrame.html [new file with mode: 0644]
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebPage/DrawingArea.h
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Tools/DumpRenderTree/TestOptions.cpp
Tools/DumpRenderTree/TestOptions.h
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/DumpRenderTree/win/DumpRenderTree.cpp