Unreviewed, rolling out r223984.
authorryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Oct 2017 18:44:08 +0000 (18:44 +0000)
committerryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Oct 2017 18:44:08 +0000 (18:44 +0000)
Caused LayoutTest assertion failures.

Reverted changeset:

"When navigating back to a page, compositing layers may not
use accelerated drawing"
https://bugs.webkit.org/show_bug.cgi?id=178749
https://trac.webkit.org/changeset/223984

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224032 268f45cc-cd09-0410-ab3c-d52691b4dbfc

20 files changed:
LayoutTests/ChangeLog
LayoutTests/compositing/accelerated-layers-after-back-expected.txt [deleted file]
LayoutTests/compositing/accelerated-layers-after-back.html [deleted file]
LayoutTests/compositing/iframes/page-cache-layer-tree.html
LayoutTests/compositing/iframes/resources/page-cache-helper.html [moved from LayoutTests/compositing/resources/go-back.html with 100% similarity]
LayoutTests/compositing/page-cache-back-crash.html
LayoutTests/platform/ios/compositing/accelerated-layers-after-back-expected.txt [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm
Tools/ChangeLog
Tools/DumpRenderTree/TestOptions.h
Tools/DumpRenderTree/TestOptions.mm
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/WebKitTestRunner/TestController.cpp
Tools/WebKitTestRunner/TestOptions.h

index 54bde02..e9696e2 100644 (file)
@@ -1,3 +1,16 @@
+2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r223984.
+
+        Caused LayoutTest assertion failures.
+
+        Reverted changeset:
+
+        "When navigating back to a page, compositing layers may not
+        use accelerated drawing"
+        https://bugs.webkit.org/show_bug.cgi?id=178749
+        https://trac.webkit.org/changeset/223984
+
 2017-10-25  Alex Christensen  <achristensen@webkit.org>
 
         Rebase contentextensions test expectations
diff --git a/LayoutTests/compositing/accelerated-layers-after-back-expected.txt b/LayoutTests/compositing/accelerated-layers-after-back-expected.txt
deleted file mode 100644 (file)
index 6a741ce..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-This layer should use 'acceleratesDrawing' after going back to this page.
-
-Before:
-
-(GraphicsLayer
-  (anchor 0.00 0.00)
-  (bounds 800.00 600.00)
-  (children 1
-    (GraphicsLayer
-      (bounds 800.00 600.00)
-      (contentsOpaque 1)
-      (acceleratesDrawing 1)
-      (children 1
-        (GraphicsLayer
-          (position 18.00 10.00)
-          (bounds 222.00 222.00)
-          (drawsContent 1)
-          (acceleratesDrawing 1)
-        )
-      )
-    )
-  )
-)
-After:
-
-(GraphicsLayer
-  (anchor 0.00 0.00)
-  (bounds 785.00 653.00)
-  (children 1
-    (GraphicsLayer
-      (bounds 785.00 653.00)
-      (contentsOpaque 1)
-      (acceleratesDrawing 1)
-      (children 1
-        (GraphicsLayer
-          (position 18.00 10.00)
-          (bounds 222.00 222.00)
-          (drawsContent 1)
-          (acceleratesDrawing 1)
-        )
-      )
-    )
-  )
-)
-
diff --git a/LayoutTests/compositing/accelerated-layers-after-back.html b/LayoutTests/compositing/accelerated-layers-after-back.html
deleted file mode 100644 (file)
index 7785473..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE html> <!-- webkit-test-runner [ useAcceleratedDrawing=true ] -->
-
-<html>
-<head>
-    <style>
-        .container {
-            position: relative;
-            height: 200px;
-            width: 200px;
-            margin: 10px;
-            padding: 10px;
-            border: 1px solid black;
-            will-change: transform;
-        }
-    </style>
-    <script>
-        var jsTestIsAsync = true;
-
-        if (window.testRunner) {
-            testRunner.dumpAsText();
-            testRunner.waitUntilDone();
-            window.testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-        }
-        
-        function doOnFirstLoad()
-        {
-            if (window.internals)
-                document.getElementById('layers-before-navigate').innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_ACCELERATES_DRAWING);
-            
-            setTimeout(function() {
-                window.location.href = 'resources/go-back.html';
-            }, 0);
-        }
-
-        function doAfterBack()
-        {
-            if (window.internals)
-                document.getElementById('layers-after-back').innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_ACCELERATES_DRAWING);
-
-            if (window.testRunner)
-                testRunner.notifyDone();
-        }
-
-        window.addEventListener("pageshow", function(event) {
-            if (event.persisted)
-                setTimeout(doAfterBack, 0);
-        }, false);
-
-        function doTest()
-        {
-            doOnFirstLoad();
-        }
-        
-        window.addEventListener('load', doTest, false);
-    </script>
-</head>
-<body>
-<div class="container">
-    <p>This layer should use 'acceleratesDrawing' after going back to this page.</p>
-</div>
-<h2>Before:</h2>
-<pre id="layers-before-navigate"></pre>
-<h2>After:</h2>
-<pre id="layers-after-back"></pre>
-
-</body>
-</html>
index 423dcc3..826cc06 100644 (file)
@@ -73,7 +73,7 @@
     // Force a back navigation back to this page.
     window.addEventListener("load", function(event) {
         setTimeout(function() {
-            window.location.href = "../resources/go-back.html";
+            window.location.href = "resources/page-cache-helper.html";
         }, 0);
     }, false);
     </script>
index 1460e76..511bdbf 100644 (file)
@@ -19,7 +19,7 @@ window.addEventListener("pageshow", function(event) {
 window.addEventListener("load", function() {
     setTimeout(function() {
         // Navigate to a helper page that will immediately navigate back here after loading.
-        window.location.href = "resources/go-back.html";
+        window.location.href = "iframes/resources/page-cache-helper.html";
     }, 0);
 });
 </script>
diff --git a/LayoutTests/platform/ios/compositing/accelerated-layers-after-back-expected.txt b/LayoutTests/platform/ios/compositing/accelerated-layers-after-back-expected.txt
deleted file mode 100644 (file)
index bbdd166..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-This layer should use 'acceleratesDrawing' after going back to this page.
-
-Before:
-
-(GraphicsLayer
-  (anchor 0.00 0.00)
-  (bounds 800.00 600.00)
-  (children 1
-    (GraphicsLayer
-      (bounds 800.00 600.00)
-      (contentsOpaque 1)
-      (acceleratesDrawing 1)
-      (children 1
-        (GraphicsLayer
-          (position 18.00 10.00)
-          (bounds 222.00 222.00)
-          (drawsContent 1)
-          (acceleratesDrawing 1)
-        )
-      )
-    )
-  )
-)
-After:
-
-(GraphicsLayer
-  (anchor 0.00 0.00)
-  (bounds 800.00 638.00)
-  (children 1
-    (GraphicsLayer
-      (bounds 800.00 638.00)
-      (contentsOpaque 1)
-      (acceleratesDrawing 1)
-      (children 1
-        (GraphicsLayer
-          (position 18.00 10.00)
-          (bounds 222.00 222.00)
-          (drawsContent 1)
-          (acceleratesDrawing 1)
-        )
-      )
-    )
-  )
-)
-
index 16c9bb1..01a4f65 100644 (file)
@@ -1,3 +1,16 @@
+2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r223984.
+
+        Caused LayoutTest assertion failures.
+
+        Reverted changeset:
+
+        "When navigating back to a page, compositing layers may not
+        use accelerated drawing"
+        https://bugs.webkit.org/show_bug.cgi?id=178749
+        https://trac.webkit.org/changeset/223984
+
 2017-10-26  Youenn Fablet  <youenn@apple.com>
 
         Add inspector logging for MediaElementSession autoplay
index ef0e81b..fe4a3ef 100644 (file)
@@ -892,6 +892,8 @@ void FrameView::updateCompositingLayersAfterLayout()
     if (!renderView)
         return;
 
+    // This call will make sure the cached hasAcceleratedCompositing is updated from the pref
+    renderView->compositor().cacheAcceleratedCompositingFlags();
     renderView->compositor().updateCompositingLayers(CompositingUpdateType::AfterLayout);
 }
 
index b49b36e..7fdb8c1 100644 (file)
@@ -1753,9 +1753,6 @@ void GraphicsLayerCA::commitLayerChangesBeforeSublayers(CommitState& commitState
     if (m_uncommittedChanges & CoverageRectChanged)
         updateCoverage(commitState);
 
-    if (m_uncommittedChanges & AcceleratesDrawingChanged) // Needs to happen before TilingAreaChanged.
-        updateAcceleratesDrawing();
-
     if (m_uncommittedChanges & TilingAreaChanged) // Needs to happen after CoverageRectChanged, ContentsScaleChanged
         updateTiles();
 
@@ -1778,6 +1775,9 @@ void GraphicsLayerCA::commitLayerChangesBeforeSublayers(CommitState& commitState
     if (m_uncommittedChanges & ContentsNeedsDisplay)
         updateContentsNeedsDisplay();
     
+    if (m_uncommittedChanges & AcceleratesDrawingChanged)
+        updateAcceleratesDrawing();
+
     if (m_uncommittedChanges & SupportsSubpixelAntialiasedTextChanged)
         updateSupportsSubpixelAntialiasedText();
 
index 913f4d2..bfca5ab 100644 (file)
@@ -362,7 +362,6 @@ void RenderLayerCompositor::setCompositingLayersNeedRebuild(bool needRebuild)
 
 void RenderLayerCompositor::willRecalcStyle()
 {
-    cacheAcceleratedCompositingFlags();
     m_layerNeedsCompositingUpdate = false;
 }
 
@@ -371,6 +370,7 @@ bool RenderLayerCompositor::didRecalcStyleWithNoPendingLayout()
     if (!m_layerNeedsCompositingUpdate)
         return false;
     
+    cacheAcceleratedCompositingFlags();
     return updateCompositingLayers(CompositingUpdateType::AfterStyleChange);
 }
 
@@ -634,9 +634,6 @@ bool RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update
 {
     LOG_WITH_STREAM(Compositing, stream << "RenderLayerCompositor " << this << " updateCompositingLayers " << updateType << " root " << updateRoot);
 
-    if (updateType == CompositingUpdateType::AfterLayout)
-        cacheAcceleratedCompositingFlags(); // Some flags (e.g. forceCompositingMode) depend on layout.
-
     m_updateCompositingLayersTimer.stop();
 
     ASSERT(m_renderView.document().pageCacheState() == Document::NotInPageCache);
index ee2f29a..ac26b22 100644 (file)
@@ -110,6 +110,9 @@ public:
 
     bool canRender3DTransforms() const;
 
+    // Copy the accelerated compositing related flags from Settings
+    void cacheAcceleratedCompositingFlags();
+
     // Called when the layer hierarchy needs to be updated (compositing layers have been
     // created, destroyed or re-parented).
     void setCompositingLayersNeedRebuild(bool needRebuild = true);
@@ -357,9 +360,7 @@ private:
 
     void clearBackingForLayerIncludingDescendants(RenderLayer&);
 
-    void cacheAcceleratedCompositingFlags();
-
-    // Repaint the given layer and its descendants.
+    // Repaint this and its child layers.
     void recursiveRepaintLayer(RenderLayer&);
 
     void computeExtent(const OverlapMap&, const RenderLayer&, OverlapExtent&) const;
index a1c41aa..7a59459 100644 (file)
@@ -1,3 +1,16 @@
+2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r223984.
+
+        Caused LayoutTest assertion failures.
+
+        Reverted changeset:
+
+        "When navigating back to a page, compositing layers may not
+        use accelerated drawing"
+        https://bugs.webkit.org/show_bug.cgi?id=178749
+        https://trac.webkit.org/changeset/223984
+
 2017-10-26  Megan Gardner  <megan_gardner@apple.com>
 
         Remove code to update block selection
index 19d2232..2a5d2ec 100644 (file)
@@ -72,9 +72,6 @@ RemoteLayerBackingStore::~RemoteLayerBackingStore()
 
 void RemoteLayerBackingStore::ensureBackingStore(FloatSize size, float scale, bool acceleratesDrawing, bool deepColor, bool isOpaque)
 {
-#if !USE(IOSURFACE)
-    acceleratesDrawing = false;
-#endif
     if (m_size == size && m_scale == scale && m_deepColor == deepColor && m_acceleratesDrawing == acceleratesDrawing && m_isOpaque == isOpaque)
         return;
 
index b46cf7c..688fbb6 100644 (file)
@@ -1,3 +1,16 @@
+2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r223984.
+
+        Caused LayoutTest assertion failures.
+
+        Reverted changeset:
+
+        "When navigating back to a page, compositing layers may not
+        use accelerated drawing"
+        https://bugs.webkit.org/show_bug.cgi?id=178749
+        https://trac.webkit.org/changeset/223984
+
 2017-10-26  Christopher Reid  <chris.reid@sony.com>
 
         Remove scopeguard from platform
index 89de43b..04df4cc 100644 (file)
@@ -30,7 +30,6 @@
 
 struct TestOptions {
     bool enableAttachmentElement { false };
-    bool useAcceleratedDrawing { false };
     bool enableIntersectionObserver { false };
     bool enableModernMediaControls { true };
     bool enablePointerLock { false };
index 438539b..e978367 100644 (file)
@@ -80,8 +80,6 @@ TestOptions::TestOptions(NSURL *testURL, const TestCommand& command)
         auto value = pairString.substr(equalsLocation + 1, pairEnd - (equalsLocation + 1));
         if (key == "enableAttachmentElement")
             this->enableAttachmentElement = parseBooleanTestHeaderValue(value);
-        if (key == "useAcceleratedDrawing")
-            this->useAcceleratedDrawing = parseBooleanTestHeaderValue(value);
         else if (key == "enableIntersectionObserver")
             this->enableIntersectionObserver = parseBooleanTestHeaderValue(value);
         else if (key == "enableModernMediaControls")
index 31b199a..7132a45 100644 (file)
@@ -982,7 +982,6 @@ static void setWebPreferencesForTestOptions(const TestOptions& options)
     WebPreferences *preferences = [WebPreferences standardPreferences];
 
     preferences.attachmentElementEnabled = options.enableAttachmentElement;
-    preferences.acceleratedDrawingEnabled = options.useAcceleratedDrawing;
     preferences.intersectionObserverEnabled = options.enableIntersectionObserver;
     preferences.modernMediaControlsEnabled = options.enableModernMediaControls;
     preferences.credentialManagementEnabled = options.enableCredentialManagement;
index 2b1a130..801be72 100644 (file)
@@ -719,7 +719,7 @@ void TestController::resetPreferencesToConsistentValues(const TestOptions& optio
     WKPreferencesSetHiddenPageDOMTimerThrottlingEnabled(preferences, false);
     WKPreferencesSetHiddenPageCSSAnimationSuspensionEnabled(preferences, false);
 
-    WKPreferencesSetAcceleratedDrawingEnabled(preferences, m_shouldUseAcceleratedDrawing || options.useAcceleratedDrawing);
+    WKPreferencesSetAcceleratedDrawingEnabled(preferences, m_shouldUseAcceleratedDrawing);
     // FIXME: We should be testing the default.
     WKPreferencesSetStorageBlockingPolicy(preferences, kWKAllowAllStorage);
 
@@ -1025,8 +1025,6 @@ static void updateTestOptionsFromTestHeader(TestOptions& testOptions, const std:
             String(value.c_str()).split(",", false, testOptions.overrideLanguages);
         if (key == "useThreadedScrolling")
             testOptions.useThreadedScrolling = parseBooleanTestHeaderValue(value);
-        if (key == "useAcceleratedDrawing")
-            testOptions.useAcceleratedDrawing = parseBooleanTestHeaderValue(value);
         if (key == "useFlexibleViewport")
             testOptions.useFlexibleViewport = parseBooleanTestHeaderValue(value);
         if (key == "useDataDetection")
index e9e2fee..f60951b 100644 (file)
@@ -33,7 +33,6 @@ namespace WTR {
 
 struct TestOptions {
     bool useThreadedScrolling { false };
-    bool useAcceleratedDrawing { false };
     bool useRemoteLayerTree { false };
     bool shouldShowWebView { false };
     bool useFlexibleViewport { false };
@@ -66,7 +65,6 @@ struct TestOptions {
     bool hasSameInitializationOptions(const TestOptions& options) const
     {
         if (useThreadedScrolling != options.useThreadedScrolling
-            || useAcceleratedDrawing != options.useAcceleratedDrawing
             || overrideLanguages != options.overrideLanguages
             || useMockScrollbars != options.useMockScrollbars
             || needsSiteSpecificQuirks != options.needsSiteSpecificQuirks