Title: [250165] trunk
Revision
250165
Author
cdu...@apple.com
Date
2019-09-20 16:46:45 -0700 (Fri, 20 Sep 2019)

Log Message

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 Tim Horton.

Source/WebKit:

This is a follow-up to r249961 to address crashes when navigating back cross-origin to a page
that uses requestAnimationFrame. r249961 took care of moving RemoteLayerTreeDisplayRefreshMonitor
objects from one RemoteLayerTreeDrawingArea to another but failed to tell those monitors
about their new drawingArea. As a result, RemoteLayerTreeDrawingArea::willDestroyDisplayRefreshMonitor()
would not get called on the new drawing area when it should have.

* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
(WebKit::RemoteLayerTreeDisplayRefreshMonitor::updateDrawingArea):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::adoptDisplayRefreshMonitorsFromDrawingArea):

LayoutTests:

Call finishJSTest() on a timer to make it more likely to reproduce the bug.

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

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (250164 => 250165)


--- trunk/LayoutTests/ChangeLog	2019-09-20 23:18:30 UTC (rev 250164)
+++ trunk/LayoutTests/ChangeLog	2019-09-20 23:46:45 UTC (rev 250165)
@@ -1,3 +1,15 @@
+2019-09-20  Chris Dumez  <cdu...@apple.com>
+
+        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 Tim Horton.
+
+        Call finishJSTest() on a timer to make it more likely to reproduce the bug.
+
+        * http/tests/navigation/page-cache-requestAnimationFrame.html:
+
 2019-09-20  Devin Rousso  <drou...@apple.com>
 
         Web Inspector: HTML Formatter - better indentation/newline handling for self closing tags

Modified: trunk/LayoutTests/http/tests/navigation/page-cache-requestAnimationFrame.html (250164 => 250165)


--- trunk/LayoutTests/http/tests/navigation/page-cache-requestAnimationFrame.html	2019-09-20 23:18:30 UTC (rev 250164)
+++ trunk/LayoutTests/http/tests/navigation/page-cache-requestAnimationFrame.html	2019-09-20 23:46:45 UTC (rev 250165)
@@ -37,7 +37,9 @@
     if (i % 10 == 0 && restoredFromPageCache) {
         testPassed("requestAnimationFrame is running after restoring from PageCache.");
         clearTimeout(timerHandle);
-        finishJSTest();
+        setTimeout(() => {
+            finishJSTest();
+        }, 100);
     } else
         requestAnimationFrame(step);
 }

Modified: trunk/Source/WebKit/ChangeLog (250164 => 250165)


--- trunk/Source/WebKit/ChangeLog	2019-09-20 23:18:30 UTC (rev 250164)
+++ trunk/Source/WebKit/ChangeLog	2019-09-20 23:46:45 UTC (rev 250165)
@@ -1,3 +1,23 @@
+2019-09-20  Chris Dumez  <cdu...@apple.com>
+
+        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 Tim Horton.
+
+        This is a follow-up to r249961 to address crashes when navigating back cross-origin to a page
+        that uses requestAnimationFrame. r249961 took care of moving RemoteLayerTreeDisplayRefreshMonitor
+        objects from one RemoteLayerTreeDrawingArea to another but failed to tell those monitors
+        about their new drawingArea. As a result, RemoteLayerTreeDrawingArea::willDestroyDisplayRefreshMonitor()
+        would not get called on the new drawing area when it should have.
+
+        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h:
+        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
+        (WebKit::RemoteLayerTreeDisplayRefreshMonitor::updateDrawingArea):
+        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
+        (WebKit::RemoteLayerTreeDrawingArea::adoptDisplayRefreshMonitorsFromDrawingArea):
+
 2019-09-20  Keith Rollin  <krol...@apple.com>
 
         Remove some support for < iOS 13

Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h (250164 => 250165)


--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h	2019-09-20 23:18:30 UTC (rev 250164)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h	2019-09-20 23:46:45 UTC (rev 250165)
@@ -44,6 +44,7 @@
     bool requestRefreshCallback() override;
 
     void didUpdateLayers();
+    void updateDrawingArea(RemoteLayerTreeDrawingArea&);
 
 private:
     explicit RemoteLayerTreeDisplayRefreshMonitor(WebCore::PlatformDisplayID, RemoteLayerTreeDrawingArea&);

Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm (250164 => 250165)


--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm	2019-09-20 23:18:30 UTC (rev 250164)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm	2019-09-20 23:46:45 UTC (rev 250165)
@@ -67,6 +67,11 @@
     handleDisplayRefreshedNotificationOnMainThread(this);
 }
 
+void RemoteLayerTreeDisplayRefreshMonitor::updateDrawingArea(RemoteLayerTreeDrawingArea& drawingArea)
+{
+    m_drawingArea = makeWeakPtr(drawingArea);
 }
 
+}
+
 #endif // USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)

Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm (250164 => 250165)


--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm	2019-09-20 23:18:30 UTC (rev 250164)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm	2019-09-20 23:46:45 UTC (rev 250165)
@@ -121,7 +121,8 @@
     if (is<RemoteLayerTreeDrawingArea>(drawingArea)) {
         auto& otherDrawingArea = downcast<RemoteLayerTreeDrawingArea>(drawingArea);
         m_displayRefreshMonitors = WTFMove(otherDrawingArea.m_displayRefreshMonitors);
-        otherDrawingArea.m_displayRefreshMonitorsToNotify = nullptr;
+        for (auto* monitor : m_displayRefreshMonitors)
+            monitor->updateDrawingArea(*this);
     }
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to