Simple iframe scrolling test fails to get a composited scrolling frame in WebKitTestR...
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Apr 2019 06:42:05 +0000 (06:42 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Apr 2019 06:42:05 +0000 (06:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196635

Reviewed by Antti Koivisto.
Source/WebKit:

Remove WKBundleSetAsyncFrameScrollingEnabled().

* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleSetAsyncFrameScrollingEnabled): Deleted.
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:

Tools:

InjectedBundle::beginTesting() calling WKBundleSetAsyncFrameScrollingEnabled() makes it impossible
for a test to enable async frame scrolling via:
    <!-- webkit-test-runner [ internal:AsyncFrameScrollingEnabled=true ] -->
so remove it and have TestController::resetPreferencesToConsistentValues() set the default value.

Test: scrollingcoordinator/ios/programmatic-frame-scroll.html

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

LayoutTests:

* scrollingcoordinator/ios/programmatic-frame-scroll-expected.html: Added.
* scrollingcoordinator/ios/programmatic-frame-scroll.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/scrollingcoordinator/ios/programmatic-frame-scroll-expected.html [new file with mode: 0644]
LayoutTests/scrollingcoordinator/ios/programmatic-frame-scroll.html [new file with mode: 0644]
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp
Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
Tools/WebKitTestRunner/TestController.cpp

index 258959f..4022faa 100644 (file)
@@ -1,5 +1,15 @@
 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
 
+        Simple iframe scrolling test fails to get a composited scrolling frame in WebKitTestRunnerApp
+        https://bugs.webkit.org/show_bug.cgi?id=196635
+
+        Reviewed by Antti Koivisto.
+
+        * scrollingcoordinator/ios/programmatic-frame-scroll-expected.html: Added.
+        * scrollingcoordinator/ios/programmatic-frame-scroll.html: Added.
+
+2019-04-04  Simon Fraser  <simon.fraser@apple.com>
+
         [iOS WK2] REGRESSION (r242687): Programmatic scroll of overflow scroll results in bad rendering
         https://bugs.webkit.org/show_bug.cgi?id=195584
 
diff --git a/LayoutTests/scrollingcoordinator/ios/programmatic-frame-scroll-expected.html b/LayoutTests/scrollingcoordinator/ios/programmatic-frame-scroll-expected.html
new file mode 100644 (file)
index 0000000..a227e6f
--- /dev/null
@@ -0,0 +1,32 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true internal:AsyncFrameScrollingEnabled=true ] -->
+<html>
+<head>
+    <meta name="viewport" content="width=device-width">
+    <style>
+        iframe {
+            position: relative;
+            border: 1px solid black;
+            width: 300px;
+            height: 300px;
+        }
+    </style>
+</head>
+<body>
+    <iframe id="test-frame" srcdoc="
+        <style>
+            body {
+                height: 2000px;
+                margin: 0;
+            }
+            .box {
+                width: 300px;
+                height: 300px;
+                background-color: green;
+            }
+        </style>
+        <body>
+            <div class='box'></div>
+        </body>
+    ">
+</body>
+</html>
diff --git a/LayoutTests/scrollingcoordinator/ios/programmatic-frame-scroll.html b/LayoutTests/scrollingcoordinator/ios/programmatic-frame-scroll.html
new file mode 100644 (file)
index 0000000..4783826
--- /dev/null
@@ -0,0 +1,42 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true internal:AsyncFrameScrollingEnabled=true ] -->
+<html>
+<head>
+    <meta name="viewport" content="width=device-width">
+    <style>
+        iframe {
+            position: relative;
+            border: 1px solid black;
+            width: 300px;
+            height: 300px;
+        }
+    </style>
+    <script>
+        function doTest()
+        {
+            let iframe = document.getElementById('test-frame');
+            iframe.contentDocument.scrollingElement.scrollTop = 300;
+        }
+        
+        window.addEventListener('load', doTest, false);
+    </script>
+</head>
+<body>
+    <iframe id="test-frame" srcdoc="
+        <style>
+            body {
+                height: 2000px;
+                margin: 0;
+            }
+            .box {
+                margin-top: 300px;
+                width: 300px;
+                height: 300px;
+                background-color: green;
+            }
+        </style>
+        <body>
+            <div class='box'></div>
+        </body>
+    ">
+</body>
+</html>
index e3cf044..8d40730 100644 (file)
@@ -1,5 +1,18 @@
 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
 
+        Simple iframe scrolling test fails to get a composited scrolling frame in WebKitTestRunnerApp
+        https://bugs.webkit.org/show_bug.cgi?id=196635
+
+        Reviewed by Antti Koivisto.
+
+        Remove WKBundleSetAsyncFrameScrollingEnabled().
+
+        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
+        (WKBundleSetAsyncFrameScrollingEnabled): Deleted.
+        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
+
+2019-04-04  Simon Fraser  <simon.fraser@apple.com>
+
         [iOS WK2] REGRESSION (r242687): Programmatic scroll of overflow scroll results in bad rendering
         https://bugs.webkit.org/show_bug.cgi?id=195584
 
index c2d5de6..f6106a3 100644 (file)
@@ -161,11 +161,6 @@ void WKBundleSetFrameFlatteningEnabled(WKBundleRef bundleRef, WKBundlePageGroupR
     WebKit::toImpl(bundleRef)->setFrameFlatteningEnabled(WebKit::toImpl(pageGroupRef), enabled);
 }
 
-void WKBundleSetAsyncFrameScrollingEnabled(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled)
-{
-    WebKit::toImpl(bundleRef)->setAsyncFrameScrollingEnabled(WebKit::toImpl(pageGroupRef), enabled);
-}
-
 void WKBundleSetJavaScriptCanAccessClipboard(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled)
 {
     WebKit::toImpl(bundleRef)->setJavaScriptCanAccessClipboard(WebKit::toImpl(pageGroupRef), enabled);
index ecf329d..f648d8a 100644 (file)
@@ -48,7 +48,6 @@ WK_EXPORT void WKBundleSetAllowFileAccessFromFileURLs(WKBundleRef bundle, WKBund
 WK_EXPORT void WKBundleSetAllowStorageAccessFromFileURLS(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool needsQuirk);
 WK_EXPORT void WKBundleSetMinimumLogicalFontSize(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, int size);
 WK_EXPORT void WKBundleSetFrameFlatteningEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
-WK_EXPORT void WKBundleSetAsyncFrameScrollingEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
 WK_EXPORT void WKBundleSetJavaScriptCanAccessClipboard(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
 WK_EXPORT void WKBundleSetPrivateBrowsingEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
 WK_EXPORT void WKBundleSetUseDashboardCompatibilityMode(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
index 9c8da23..015a7ed 100644 (file)
@@ -1,3 +1,22 @@
+2019-04-04  Simon Fraser  <simon.fraser@apple.com>
+
+        Simple iframe scrolling test fails to get a composited scrolling frame in WebKitTestRunnerApp
+        https://bugs.webkit.org/show_bug.cgi?id=196635
+
+        Reviewed by Antti Koivisto.
+        
+        InjectedBundle::beginTesting() calling WKBundleSetAsyncFrameScrollingEnabled() makes it impossible
+        for a test to enable async frame scrolling via:
+            <!-- webkit-test-runner [ internal:AsyncFrameScrollingEnabled=true ] -->
+        so remove it and have TestController::resetPreferencesToConsistentValues() set the default value.
+        
+        Test: scrollingcoordinator/ios/programmatic-frame-scroll.html
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+        (WTR::InjectedBundle::beginTesting):
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::resetPreferencesToConsistentValues):
+
 2019-04-04  Alexey Proskuryakov  <ap@apple.com>
 
         Use a correct LC_RPATH when building with ASan
index b90dbd9..49cdcf8 100644 (file)
@@ -477,13 +477,13 @@ void InjectedBundle::beginTesting(WKDictionaryRef settings, BegingTestingMode te
     m_accessibilityController = AccessibilityController::create();
 #endif
 
+    // Don't change experimental or internal features here; those should be set in TestController::resetPreferencesToConsistentValues().
     WKBundleSetAllowUniversalAccessFromFileURLs(m_bundle, m_pageGroup, true);
     WKBundleSetJavaScriptCanAccessClipboard(m_bundle, m_pageGroup, true);
     WKBundleSetPrivateBrowsingEnabled(m_bundle, m_pageGroup, false);
     WKBundleSetUseDashboardCompatibilityMode(m_bundle, m_pageGroup, false);
     WKBundleSetAuthorAndUserStylesEnabled(m_bundle, m_pageGroup, true);
     WKBundleSetFrameFlatteningEnabled(m_bundle, m_pageGroup, false);
-    WKBundleSetAsyncFrameScrollingEnabled(m_bundle, m_pageGroup, false);
     WKBundleSetMinimumLogicalFontSize(m_bundle, m_pageGroup, 9);
     WKBundleSetSpatialNavigationEnabled(m_bundle, m_pageGroup, false);
     WKBundleSetAllowFileAccessFromFileURLs(m_bundle, m_pageGroup, true);
index 501a90f..3e9eeb6 100644 (file)
@@ -755,10 +755,14 @@ void TestController::resetPreferencesToConsistentValues(const TestOptions& optio
         WKPreferencesSetExperimentalFeatureForKey(preferences, experimentalFeature.value, toWK(experimentalFeature.key).get());
 
     WKPreferencesResetAllInternalDebugFeatures(preferences);
+
     // Set internal features that have different default values for testing.
     static WKStringRef asyncOverflowScrollingFeature = WKStringCreateWithUTF8CString("AsyncOverflowScrollingEnabled");
     WKPreferencesSetInternalDebugFeatureForKey(preferences, false, asyncOverflowScrollingFeature);
 
+    static WKStringRef asyncFrameScrollingFeature = WKStringCreateWithUTF8CString("AsyncFrameScrollingEnabled");
+    WKPreferencesSetInternalDebugFeatureForKey(preferences, false, asyncFrameScrollingFeature);
+
     for (const auto& internalDebugFeature : options.internalDebugFeatures)
         WKPreferencesSetInternalDebugFeatureForKey(preferences, internalDebugFeature.value, toWK(internalDebugFeature.key).get());