Enabling/disabling delegates scrolling when page has no composited content asserts...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Apr 2012 11:11:59 +0000 (11:11 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Apr 2012 11:11:59 +0000 (11:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=83860

Patch by Zalan Bujtas <zbujtas@gmail.com> on 2012-04-13
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

WK2 has compositing mode on all the time, while Wk1 turns it on only when
the page has composited content. This patch ensures that, when delegates scrolling behavior
is changed, backing stores are cleared only when there's an actual composition,
similarly to what CachedFrame does.

Test: fast/viewport/scroll-delegates-switch-on-page-with-no-composition-mode-asserts.html

* page/FrameView.cpp:
(WebCore::FrameView::delegatesScrollingDidChange):

LayoutTests:

* fast/viewport/scroll-delegates-switch-on-page-with-no-composition-mode-asserts-expected.txt: Added.
* fast/viewport/scroll-delegates-switch-on-page-with-no-composition-mode-asserts.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/viewport/scroll-delegates-switch-on-page-with-no-composition-mode-asserts-expected.txt [new file with mode: 0644]
LayoutTests/fast/viewport/scroll-delegates-switch-on-page-with-no-composition-mode-asserts.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp

index c0b6698..f6251a1 100644 (file)
@@ -1,3 +1,13 @@
+2012-04-13  Zalan Bujtas  <zbujtas@gmail.com>
+
+        Enabling/disabling delegates scrolling when page has no composited content asserts on WK1.
+        https://bugs.webkit.org/show_bug.cgi?id=83860
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        * fast/viewport/scroll-delegates-switch-on-page-with-no-composition-mode-asserts-expected.txt: Added.
+        * fast/viewport/scroll-delegates-switch-on-page-with-no-composition-mode-asserts.html: Added.
+
 2012-04-13  Philippe Normand  <pnormand@igalia.com>
 
         Unreviewed, GTK baselines for tests now being runned since the
diff --git a/LayoutTests/fast/viewport/scroll-delegates-switch-on-page-with-no-composition-mode-asserts-expected.txt b/LayoutTests/fast/viewport/scroll-delegates-switch-on-page-with-no-composition-mode-asserts-expected.txt
new file mode 100644 (file)
index 0000000..695d2e9
--- /dev/null
@@ -0,0 +1,3 @@
+This test verifies that switching delegates scrolling on a page with no composition does not assert.
+
+PASS if no crash or assert in debug.
diff --git a/LayoutTests/fast/viewport/scroll-delegates-switch-on-page-with-no-composition-mode-asserts.html b/LayoutTests/fast/viewport/scroll-delegates-switch-on-page-with-no-composition-mode-asserts.html
new file mode 100644 (file)
index 0000000..72d2d9c
--- /dev/null
@@ -0,0 +1,13 @@
+<html>
+<body>
+    <p>This test verifies that switching delegates scrolling on a page with no composition does not assert.</p>
+    <p>PASS if no crash or assert in debug.</p>
+
+<script>
+if (window.layoutTestController && window.internals && internals.setDelegatesScrolling) {
+    layoutTestController.dumpAsText();
+    internals.setDelegatesScrolling(true, document);
+}
+</script>
+</body>
+</html>
index f3e410e..b95f30c 100644 (file)
@@ -1,3 +1,20 @@
+2012-04-13  Zalan Bujtas  <zbujtas@gmail.com>
+
+        Enabling/disabling delegates scrolling when page has no composited content asserts on WK1.
+        https://bugs.webkit.org/show_bug.cgi?id=83860
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        WK2 has compositing mode on all the time, while Wk1 turns it on only when
+        the page has composited content. This patch ensures that, when delegates scrolling behavior
+        is changed, backing stores are cleared only when there's an actual composition,
+        similarly to what CachedFrame does.
+
+        Test: fast/viewport/scroll-delegates-switch-on-page-with-no-composition-mode-asserts.html
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::delegatesScrollingDidChange):
+
 2012-04-13  Vivek Galatage  <vivekgalatage@gmail.com>
 
         Web Inspector: Line number is not displayed while debugging javascript
index d8b4b4d..931e68a 100644 (file)
@@ -1694,7 +1694,8 @@ void FrameView::delegatesScrollingDidChange()
 {
 #if USE(ACCELERATED_COMPOSITING)
     // When we switch to delgatesScrolling mode, we should destroy the scrolling/clipping layers in RenderLayerCompositor.
-    clearBackingStores();
+    if (hasCompositedContent())
+        clearBackingStores();
 #endif
 }