[iOS] Always include frames in the scrolling tree when async frame scrolling is enabled
authorfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Jun 2017 06:06:16 +0000 (06:06 +0000)
committerfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Jun 2017 06:06:16 +0000 (06:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=173405

Patch by Frederic Wang <fwang@igalia.com> on 2017-06-19
Reviewed by Simon Fraser.

Source/WebCore:

Currently "async frame scrolling" is ignored on iOS. This commit changes that behavior to
align on macOS and is a preliminary step to implement iframe scrolling on iOS (bug 149264).

Test: compositing/iframes/compositing-for-scrollable-iframe.html
      fast/scrolling/scrolling-tree-includes-frame.html

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame): Do not require
compositing when "async frame scrolling" is enabled on iOS.

Source/WebKit2:

* WebProcess/WebCoreSupport/WebChromeClient.h: Set the ScrollableNonMainFrameTrigger bit by
default on iOS too. RenderLayerCompositor::requiresCompositingForScrollableFrame will ignore
this change when async frame scrolling is disabled.

LayoutTests:

Add some new expectations for iOS/WK2 now that the "async frame scrolling" setting is taken
into account for the layer and scrolling trees.

* platform/ios-wk2/compositing/iframes/compositing-for-scrollable-iframe-expected.txt: Added.
A specific layer is created for the iframe.
* platform/ios-wk2/fast/scrolling/scrolling-tree-includes-frame-expected.txt: Added.
The frame appears in the scrolling tree.
* platform/ios/fast/scrolling/scrolling-tree-includes-frame-expected.txt: Renamed from LayoutTests/platform/ios-simulator/fast/scrolling/scrolling-tree-includes-frame-expected.txt.
Use this as a generic expectation for iOS.

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

LayoutTests/ChangeLog
LayoutTests/platform/ios-wk2/compositing/iframes/compositing-for-scrollable-iframe-expected.txt [new file with mode: 0644]
LayoutTests/platform/ios-wk2/fast/scrolling/scrolling-tree-includes-frame-expected.txt [new file with mode: 0644]
LayoutTests/platform/ios/fast/scrolling/scrolling-tree-includes-frame-expected.txt [moved from LayoutTests/platform/ios-simulator/fast/scrolling/scrolling-tree-includes-frame-expected.txt with 100% similarity]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h

index 4966e57..43fd704 100644 (file)
@@ -1,5 +1,22 @@
 2017-06-19  Frederic Wang  <fwang@igalia.com>
 
+        [iOS] Always include frames in the scrolling tree when async frame scrolling is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=173405
+
+        Reviewed by Simon Fraser.
+
+        Add some new expectations for iOS/WK2 now that the "async frame scrolling" setting is taken
+        into account for the layer and scrolling trees.
+
+        * platform/ios-wk2/compositing/iframes/compositing-for-scrollable-iframe-expected.txt: Added.
+        A specific layer is created for the iframe.
+        * platform/ios-wk2/fast/scrolling/scrolling-tree-includes-frame-expected.txt: Added.
+        The frame appears in the scrolling tree.
+        * platform/ios/fast/scrolling/scrolling-tree-includes-frame-expected.txt: Renamed from LayoutTests/platform/ios-simulator/fast/scrolling/scrolling-tree-includes-frame-expected.txt.
+        Use this as a generic expectation for iOS.
+
+2017-06-19  Frederic Wang  <fwang@igalia.com>
+
         [Mac] Add an experimental feature setting for async frame scrolling
         https://bugs.webkit.org/show_bug.cgi?id=173359
 
diff --git a/LayoutTests/platform/ios-wk2/compositing/iframes/compositing-for-scrollable-iframe-expected.txt b/LayoutTests/platform/ios-wk2/compositing/iframes/compositing-for-scrollable-iframe-expected.txt
new file mode 100644 (file)
index 0000000..f09337a
--- /dev/null
@@ -0,0 +1,14 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x223
+  RenderBlock {HTML} at (0,0) size 800x223
+    RenderBody {BODY} at (8,8) size 784x207
+      RenderText {#text} at (0,0) size 0x0
+layer at (8,8) size 102x202
+  RenderPartObject {IFRAME} at (0,0) size 102x202 [border: (1px solid #000000)]
+    layer at (0,0) size 308x416
+      RenderView at (0,0) size 100x200
+    layer at (0,0) size 100x416
+      RenderBlock {HTML} at (0,0) size 100x416
+        RenderBody {BODY} at (8,8) size 84x400
+          RenderBlock {DIV} at (0,0) size 300x400 [bgcolor=#808080]
diff --git a/LayoutTests/platform/ios-wk2/fast/scrolling/scrolling-tree-includes-frame-expected.txt b/LayoutTests/platform/ios-wk2/fast/scrolling/scrolling-tree-includes-frame-expected.txt
new file mode 100644 (file)
index 0000000..4b34bf6
--- /dev/null
@@ -0,0 +1,34 @@
+
+
+(Frame scrolling node
+  (scrollable area size 800 600)
+  (contents size 800 600)
+  (scrollable area parameters 
+    (horizontal scroll elasticity 1)
+    (vertical scroll elasticity 1)
+    (horizontal scrollbar mode 0)
+    (vertical scrollbar mode 0))
+  (visual viewport enabled 1)
+  (layout viewport at (0,0) size 800x600)
+  (min layout viewport origin (0,0))
+  (max layout viewport origin (0,0))
+  (behavior for fixed 0)
+  (children 1
+    (Frame scrolling node
+      (scrollable area size 100 200)
+      (contents size 308 416)
+      (scrollable area parameters 
+        (horizontal scroll elasticity 1)
+        (vertical scroll elasticity 1)
+        (horizontal scrollbar mode 0)
+        (vertical scrollbar mode 0))
+      (visual viewport enabled 1)
+      (layout viewport at (0,0) size 100x200)
+      (min layout viewport origin (0,0))
+      (max layout viewport origin (208,216))
+      (behavior for fixed 0)
+    )
+  )
+)
+
+
index c88f9b4..c021c2a 100644 (file)
@@ -1,5 +1,22 @@
 2017-06-19  Frederic Wang  <fwang@igalia.com>
 
+        [iOS] Always include frames in the scrolling tree when async frame scrolling is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=173405
+
+        Reviewed by Simon Fraser.
+
+        Currently "async frame scrolling" is ignored on iOS. This commit changes that behavior to
+        align on macOS and is a preliminary step to implement iframe scrolling on iOS (bug 149264).
+
+        Test: compositing/iframes/compositing-for-scrollable-iframe.html
+              fast/scrolling/scrolling-tree-includes-frame.html
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame): Do not require
+        compositing when "async frame scrolling" is enabled on iOS.
+
+2017-06-19  Frederic Wang  <fwang@igalia.com>
+
         [Mac] Add an experimental feature setting for async frame scrolling
         https://bugs.webkit.org/show_bug.cgi?id=173359
 
index 7749e93..2657957 100644 (file)
@@ -2468,7 +2468,7 @@ bool RenderLayerCompositor::requiresCompositingForScrollableFrame() const
     if (isMainFrameCompositor())
         return false;
 
-#if PLATFORM(MAC)
+#if PLATFORM(MAC) || PLATFORM(IOS)
     if (!m_renderView.settings().asyncFrameScrollingEnabled())
         return false;
 #endif
index 7707834..bfdeb3f 100644 (file)
@@ -1,3 +1,14 @@
+2017-06-19  Frederic Wang  <fwang@igalia.com>
+
+        [iOS] Always include frames in the scrolling tree when async frame scrolling is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=173405
+
+        Reviewed by Simon Fraser.
+
+        * WebProcess/WebCoreSupport/WebChromeClient.h: Set the ScrollableNonMainFrameTrigger bit by
+        default on iOS too. RenderLayerCompositor::requiresCompositingForScrollableFrame will ignore
+        this change when async frame scrolling is disabled.
+
 2017-06-19  Frederic Wang  <fred.wang@free.fr>
 
         [Mac] Add an experimental feature setting for async frame scrolling
index 9539c89..0288f8b 100644 (file)
@@ -221,7 +221,7 @@ private:
             VideoTrigger |
             PluginTrigger|
             CanvasTrigger |
-#if PLATFORM(MAC)
+#if PLATFORM(MAC) || PLATFORM(IOS)
             ScrollableNonMainFrameTrigger |
 #endif
 #if PLATFORM(IOS)