- Revision
- 210142
- Author
- [email protected]
- Date
- 2016-12-23 16:23:37 -0800 (Fri, 23 Dec 2016)
Log Message
REGRESSION(r209865): Crash when navigating back to some pages with compositing layers.
<https://webkit.org/b/166469>
<rdar://problem/29109053>
Reviewed by Darin Adler.
Source/WebCore:
Remove the old WK1-era clear/restoreBackingStores optimization from the page cache.
When enabling it on non-iOS platforms, we started hitting lots of assertions,
and none of our memory tests showed any significant improvement anyway.
Test: compositing/page-cache-back-crash.html
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::CachedFrameBase):
(WebCore::CachedFrameBase::restore):
(WebCore::CachedFrame::CachedFrame):
* history/CachedFrame.h:
* page/FrameView.cpp:
(WebCore::FrameView::restoreBackingStores): Deleted.
* page/FrameView.h:
LayoutTests:
Add a smoke test for the crashes we were seeing. Thanks to Zalán for the reduction.
* compositing/page-cache-back-crash-expected.txt: Added.
* compositing/page-cache-back-crash.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (210141 => 210142)
--- trunk/LayoutTests/ChangeLog 2016-12-23 22:13:29 UTC (rev 210141)
+++ trunk/LayoutTests/ChangeLog 2016-12-24 00:23:37 UTC (rev 210142)
@@ -1,3 +1,16 @@
+2016-12-23 Andreas Kling <[email protected]>
+
+ REGRESSION(r209865): Crash when navigating back to some pages with compositing layers.
+ <https://webkit.org/b/166469>
+ <rdar://problem/29109053>
+
+ Reviewed by Darin Adler.
+
+ Add a smoke test for the crashes we were seeing. Thanks to Zalán for the reduction.
+
+ * compositing/page-cache-back-crash-expected.txt: Added.
+ * compositing/page-cache-back-crash.html: Added.
+
2016-12-22 Sam Weinig <[email protected]>
[WebIDL] Remove custom bindings for WebSQL code
Added: trunk/LayoutTests/compositing/page-cache-back-crash-expected.txt (0 => 210142)
--- trunk/LayoutTests/compositing/page-cache-back-crash-expected.txt (rev 0)
+++ trunk/LayoutTests/compositing/page-cache-back-crash-expected.txt 2016-12-24 00:23:37 UTC (rev 210142)
@@ -0,0 +1 @@
+- Test passes if it doesn't crash.
Added: trunk/LayoutTests/compositing/page-cache-back-crash.html (0 => 210142)
--- trunk/LayoutTests/compositing/page-cache-back-crash.html (rev 0)
+++ trunk/LayoutTests/compositing/page-cache-back-crash.html 2016-12-24 00:23:37 UTC (rev 210142)
@@ -0,0 +1,25 @@
+<style>
+.outer { position: fixed; }
+.inner { position: absolute; }
+</style>
+<div class=outer>-<div class=inner></div></div>
+Test passes if it doesn't crash.
+<script>
+if (window.testRunner) {
+ window.testRunner.dumpAsText();
+ window.testRunner.waitUntilDone();
+ window.testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
+}
+
+window.addEventListener("pageshow", function(event) {
+ if (event.persisted)
+ testRunner.notifyDone();
+}, false);
+
+window.addEventListener("load", function() {
+ setTimeout(function() {
+ // Navigate to a helper page that will immediately navigate back here after loading.
+ window.location.href = ""
+ }, 0);
+});
+</script>
Modified: trunk/Source/WebCore/ChangeLog (210141 => 210142)
--- trunk/Source/WebCore/ChangeLog 2016-12-23 22:13:29 UTC (rev 210141)
+++ trunk/Source/WebCore/ChangeLog 2016-12-24 00:23:37 UTC (rev 210142)
@@ -1,3 +1,26 @@
+2016-12-23 Andreas Kling <[email protected]>
+
+ REGRESSION(r209865): Crash when navigating back to some pages with compositing layers.
+ <https://webkit.org/b/166469>
+ <rdar://problem/29109053>
+
+ Reviewed by Darin Adler.
+
+ Remove the old WK1-era clear/restoreBackingStores optimization from the page cache.
+ When enabling it on non-iOS platforms, we started hitting lots of assertions,
+ and none of our memory tests showed any significant improvement anyway.
+
+ Test: compositing/page-cache-back-crash.html
+
+ * history/CachedFrame.cpp:
+ (WebCore::CachedFrameBase::CachedFrameBase):
+ (WebCore::CachedFrameBase::restore):
+ (WebCore::CachedFrame::CachedFrame):
+ * history/CachedFrame.h:
+ * page/FrameView.cpp:
+ (WebCore::FrameView::restoreBackingStores): Deleted.
+ * page/FrameView.h:
+
2016-12-23 Sam Weinig <[email protected]>
Add missing std::optional to ApplePayPaymentRequest.lineItems
Modified: trunk/Source/WebCore/history/CachedFrame.cpp (210141 => 210142)
--- trunk/Source/WebCore/history/CachedFrame.cpp 2016-12-23 22:13:29 UTC (rev 210141)
+++ trunk/Source/WebCore/history/CachedFrame.cpp 2016-12-24 00:23:37 UTC (rev 210142)
@@ -63,7 +63,6 @@
, m_view(frame.view())
, m_url(frame.document()->url())
, m_isMainFrame(!frame.tree().parent())
- , m_isComposited(frame.view()->hasCompositedContent())
{
}
@@ -97,9 +96,6 @@
// cached page.
frame.script().updatePlatformScriptObjects();
- if (m_isComposited)
- frame.view()->restoreBackingStores();
-
frame.loader().client().didRestoreFromPageCache();
// Reconstruct the FrameTree. And open the child CachedFrames in their respective FrameLoaders.
@@ -164,9 +160,6 @@
frame.loader().client().savePlatformDataToCachedFrame(this);
- if (m_isComposited)
- frame.view()->clearBackingStores();
-
// documentWillSuspendForPageCache() can set up a layout timer on the FrameView, so clear timers after that.
frame.clearTimers();
Modified: trunk/Source/WebCore/history/CachedFrame.h (210141 => 210142)
--- trunk/Source/WebCore/history/CachedFrame.h 2016-12-23 22:13:29 UTC (rev 210141)
+++ trunk/Source/WebCore/history/CachedFrame.h 2016-12-24 00:23:37 UTC (rev 210142)
@@ -60,7 +60,6 @@
std::unique_ptr<ScriptCachedFrameData> m_cachedFrameScriptData;
std::unique_ptr<CachedFramePlatformData> m_cachedFramePlatformData;
bool m_isMainFrame;
- bool m_isComposited;
std::optional<HasInsecureContent> m_hasInsecureContent;
Vector<std::unique_ptr<CachedFrame>> m_childFrames;
Modified: trunk/Source/WebCore/page/FrameView.cpp (210141 => 210142)
--- trunk/Source/WebCore/page/FrameView.cpp 2016-12-23 22:13:29 UTC (rev 210141)
+++ trunk/Source/WebCore/page/FrameView.cpp 2016-12-24 00:23:37 UTC (rev 210142)
@@ -879,17 +879,6 @@
compositor.clearBackingForAllLayers();
}
-void FrameView::restoreBackingStores()
-{
- RenderView* renderView = this->renderView();
- if (!renderView)
- return;
-
- RenderLayerCompositor& compositor = renderView->compositor();
- compositor.enableCompositingMode(true);
- compositor.updateCompositingLayers(CompositingUpdateAfterLayout);
-}
-
GraphicsLayer* FrameView::layerForScrolling() const
{
RenderView* renderView = this->renderView();
Modified: trunk/Source/WebCore/page/FrameView.h (210141 => 210142)
--- trunk/Source/WebCore/page/FrameView.h 2016-12-23 22:13:29 UTC (rev 210141)
+++ trunk/Source/WebCore/page/FrameView.h 2016-12-24 00:23:37 UTC (rev 210142)
@@ -154,7 +154,6 @@
void updateCompositingLayersAfterLayout();
void clearBackingStores();
- void restoreBackingStores();
// Called when changes to the GraphicsLayer hierarchy have to be synchronized with
// content rendered via the normal painting path.