REGRESSION: editing/async-clipboard/clipboard-interfaces.html is failing in WebKit1
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Oct 2019 18:38:00 +0000 (18:38 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Oct 2019 18:38:00 +0000 (18:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=202940
<rdar://problem/56262298>

Reviewed by Ryosuke Niwa.

Source/WebKitLegacy/win:

Add support for the asyncClipboardAPIEnabled feature flag in legacy WebKit on Windows.

* Interfaces/IWebPreferencesPrivate.idl:
* WebPreferenceKeysPrivate.h:
* WebPreferences.cpp:
(WebPreferences::initializeDefaultSettings):
(WebPreferences::asyncClipboardAPIEnabled):
(WebPreferences::setAsyncClipboardAPIEnabled):
* WebPreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged):

Tools:

Add some plumbing to support the async clipboard API experimental test option in Windows.

* DumpRenderTree/win/DumpRenderTree.cpp:
(setWebPreferencesForTestOptions):

LayoutTests:

* editing/async-clipboard/clipboard-interfaces.html:
* editing/async-clipboard/clipboard-item-basic.html:
* editing/async-clipboard/clipboard-wrapper-stays-alive.html:

Tweak a few layout tests to actually turn the experimental feature on (this previously worked because
experimental feature flags are already on by default in WebKit2).

* platform/ios-wk1/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

Unskip and unmark these layout tests as failing in WebKit1 on iOS, macOS, and Windows.

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

22 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/async-clipboard/clipboard-interfaces.html
LayoutTests/editing/async-clipboard/clipboard-item-basic.html
LayoutTests/editing/async-clipboard/clipboard-wrapper-stays-alive.html
LayoutTests/platform/ios-wk1/TestExpectations
LayoutTests/platform/mac-wk1/TestExpectations
LayoutTests/platform/win/TestExpectations
Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKitLegacy/mac/WebView/WebPreferences.mm
Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h
Source/WebKitLegacy/mac/WebView/WebView.mm
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl
Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h
Source/WebKitLegacy/win/WebPreferences.cpp
Source/WebKitLegacy/win/WebPreferences.h
Source/WebKitLegacy/win/WebView.cpp
Tools/ChangeLog
Tools/DumpRenderTree/TestOptions.cpp
Tools/DumpRenderTree/TestOptions.h
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/DumpRenderTree/win/DumpRenderTree.cpp

index d99cc8c..0eb924f 100644 (file)
@@ -1,3 +1,24 @@
+2019-10-15  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        REGRESSION: editing/async-clipboard/clipboard-interfaces.html is failing in WebKit1
+        https://bugs.webkit.org/show_bug.cgi?id=202940
+        <rdar://problem/56262298>
+
+        Reviewed by Ryosuke Niwa.
+
+        * editing/async-clipboard/clipboard-interfaces.html:
+        * editing/async-clipboard/clipboard-item-basic.html:
+        * editing/async-clipboard/clipboard-wrapper-stays-alive.html:
+
+        Tweak a few layout tests to actually turn the experimental feature on (this previously worked because
+        experimental feature flags are already on by default in WebKit2).
+
+        * platform/ios-wk1/TestExpectations:
+        * platform/mac-wk1/TestExpectations:
+        * platform/win/TestExpectations:
+
+        Unskip and unmark these layout tests as failing in WebKit1 on iOS, macOS, and Windows.
+
 2019-10-15  Dean Jackson  <dino@apple.com>
 
         Reset maxCanvasPixelMemory between tests
index 75a2676..f5c3c84 100644 (file)
@@ -1,4 +1,4 @@
-<!DOCTYPE html> <!-- webkit-test-runner [ experimental:asyncClipboardAPIEnabled=true ] -->
+<!DOCTYPE html> <!-- webkit-test-runner [ experimental:AsyncClipboardAPIEnabled=true ] -->
 <html>
     <head>
         <script src="../../resources/js-test.js"></script>
index fdebdb3..1a3b62d 100644 (file)
@@ -1,4 +1,4 @@
-<!DOCTYPE html> <!-- webkit-test-runner [ experimental:asyncClipboardAPIEnabled=true ] -->
+<!DOCTYPE html> <!-- webkit-test-runner [ experimental:AsyncClipboardAPIEnabled=true ] -->
 <html>
     <meta charset="utf8">
     <head>
index c1f5618..170cdf9 100644 (file)
@@ -1,4 +1,4 @@
-<!DOCTYPE html> <!-- webkit-test-runner [ experimental:asyncClipboardAPIEnabled=true ] -->
+<!DOCTYPE html> <!-- webkit-test-runner [ experimental:AsyncClipboardAPIEnabled=true ] -->
 <html>
     <head>
         <script src="../../resources/js-test.js"></script>
index 8a56f87..3cbeffb 100644 (file)
@@ -16,9 +16,6 @@ http/tests/navigation/page-cache-domcachestorage-pending-promise.html [ Skip ]
 imported/w3c/web-platform-tests/fetch/api/request/destination [ Skip ]
 imported/w3c/web-platform-tests/fetch/cross-origin-resource-policy [ Skip ]
 
-# Async Clipboard API is not supported in WebKit1 yet.
-webkit.org/b/202654 editing/async-clipboard [ Skip ]
-
 # Skip WebRTC for now in WK1
 imported/w3c/web-platform-tests/webrtc [ Skip ]
 webrtc [ Skip ]
index ba1aa40..8678d6d 100644 (file)
@@ -44,9 +44,6 @@ css-custom-properties-api [ Skip ]
 css-typedom [ Skip ]
 css-dark-mode [ Skip ]
 
-# Async Clipboard API is not supported in WebKit1 yet.
-webkit.org/b/202654 editing/async-clipboard [ Skip ]
-
 webgpu [ Skip ]
 inspector/canvas/create-context-webgpu.html [ Skip ]
 inspector/canvas/requestClientNodes-webgpu.html [ Skip ]
index ec2cf5c..4b58a8f 100644 (file)
@@ -4470,9 +4470,6 @@ webkit.org/b/202938 fast/images/reset-image-animation.html [ Failure Pass ]
 
 webkit.org/b/202939 fast/workers/worker-exception-during-navigation.html [ Failure Pass ]
 
-webkit.org/b/202940 editing/async-clipboard/clipboard-interfaces.html [ Failure ]
-webkit.org/b/202940 editing/async-clipboard/clipboard-item-basic.html [ Failure ]
-
 webkit.org/b/202945 fast/css/invalidation-errors-2.html [ Failure ]
 webkit.org/b/202945 fast/css/invalidation-errors.html [ Failure ]
 
@@ -4488,8 +4485,6 @@ webkit.org/b/202949 http/tests/websocket/tests/hybi/non-document-mixed-content-b
 
 webkit.org/b/202954 http/wpt/resource-timing/rt-resources-per-worker.html [ Failure ]
 
-webkit.org/b/202950 editing/async-clipboard/clipboard-wrapper-stays-alive.html [ Timeout ]
-
 webkit.org/b/202951 fast/canvas/drawImage-animated-gif-draws-first-frame-and-no-reset-image.html [ Timeout ]
 
 webkit.org/b/202952 http/tests/security/navigate-when-restoring-cached-page.html [ Timeout ]
index 2358eef..7ace802 100644 (file)
 #define WebKitResizeObserverEnabledPreferenceKey @"WebKitResizeObserverEnabled"
 #define WebKitCoreMathMLEnabledPreferenceKey @"WebKitCoreMathMLEnabled"
 #define WebKitRequestIdleCallbackEnabledPreferenceKey @"WebKitRequestIdleCallbackEnabled"
+#define WebKitAsyncClipboardAPIEnabledPreferenceKey @"WebKitAsyncClipboardAPIEnabled"
 #define WebKitLinkPreloadResponsiveImagesEnabledPreferenceKey @"WebKitLinkPreloadResponsiveImagesEnabled"
 
index 940de36..1104f5a 100644 (file)
@@ -691,6 +691,7 @@ public:
 #endif
         @NO, WebKitCoreMathMLEnabledPreferenceKey,
         @NO, WebKitRequestIdleCallbackEnabledPreferenceKey,
+        @NO, WebKitAsyncClipboardAPIEnabledPreferenceKey,
         @NO, WebKitLinkPreloadResponsiveImagesEnabledPreferenceKey,
         @YES, WebKitCSSShadowPartsEnabledPreferenceKey,
         nil];
@@ -3509,6 +3510,16 @@ static NSString *classIBCreatorID = nil;
     [self _setBoolValue:flag forKey:WebKitRequestIdleCallbackEnabledPreferenceKey];
 }
 
+- (BOOL)asyncClipboardAPIEnabled
+{
+    return [self _boolValueForKey:WebKitAsyncClipboardAPIEnabledPreferenceKey];
+}
+
+- (void)setAsyncClipboardAPIEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitAsyncClipboardAPIEnabledPreferenceKey];
+}
+
 - (BOOL)linkPreloadResponsiveImagesEnabled
 {
     return [self _boolValueForKey:WebKitLinkPreloadResponsiveImagesEnabledPreferenceKey];
index 41d5591..da5d04e 100644 (file)
@@ -615,6 +615,9 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification WEBKIT_DEPR
 - (void)setRequestIdleCallbackEnabled:(BOOL)flag;
 - (BOOL)requestIdleCallbackEnabled;
 
+- (void)setAsyncClipboardAPIEnabled:(BOOL)flag;
+- (BOOL)asyncClipboardAPIEnabled;
+
 - (void)setLinkPreloadResponsiveImagesEnabled:(BOOL)flag;
 - (BOOL)linkPreloadResponsiveImagesEnabled;
 
@@ -656,6 +659,7 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification WEBKIT_DEPR
 @property (nonatomic) BOOL resizeObserverEnabled;
 @property (nonatomic) BOOL coreMathMLEnabled;
 @property (nonatomic) BOOL requestIdleCallbackEnabled;
+@property (nonatomic) BOOL asyncClipboardAPIEnabled;
 @property (nonatomic) BOOL linkPreloadResponsiveImagesEnabled;
 
 #if TARGET_OS_IPHONE
index 61dbc93..ee67b5b 100644 (file)
@@ -3236,6 +3236,7 @@ static bool needsSelfRetainWhileLoadingQuirk()
 
     settings.setCoreMathMLEnabled([preferences coreMathMLEnabled]);
     settings.setRequestIdleCallbackEnabled([preferences requestIdleCallbackEnabled]);
+    settings.setAsyncClipboardAPIEnabled(preferences.asyncClipboardAPIEnabled);
 
     RuntimeEnabledFeatures::sharedFeatures().setServerTimingEnabled([preferences serverTimingEnabled]);
 
index fff92a0..3497e48 100644 (file)
@@ -1,3 +1,23 @@
+2019-10-15  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        REGRESSION: editing/async-clipboard/clipboard-interfaces.html is failing in WebKit1
+        https://bugs.webkit.org/show_bug.cgi?id=202940
+        <rdar://problem/56262298>
+
+        Reviewed by Ryosuke Niwa.
+
+        Add support for the asyncClipboardAPIEnabled feature flag in legacy WebKit on Windows.
+
+        * Interfaces/IWebPreferencesPrivate.idl:
+        * WebPreferenceKeysPrivate.h:
+        * WebPreferences.cpp:
+        (WebPreferences::initializeDefaultSettings):
+        (WebPreferences::asyncClipboardAPIEnabled):
+        (WebPreferences::setAsyncClipboardAPIEnabled):
+        * WebPreferences.h:
+        * WebView.cpp:
+        (WebView::notifyPreferencesChanged):
+
 2019-10-14  Chris Dumez  <cdumez@apple.com>
 
         [WK2] Have WebBackForwardCache class coordinate page caching in all WebProcesses
index fffde8a..1f07581 100644 (file)
@@ -246,4 +246,6 @@ interface IWebPreferencesPrivate7 : IWebPreferencesPrivate6
     HRESULT setCoreMathMLEnabled([in] BOOL enabled);
     HRESULT requestIdleCallbackEnabled([out, retval] BOOL* enabled);
     HRESULT setRequestIdleCallbackEnabled([in] BOOL enabled);
+    HRESULT asyncClipboardAPIEnabled([out, retval] BOOL* enabled);
+    HRESULT setAsyncClipboardAPIEnabled([in] BOOL enabled);
 }
index ad8b95a..447fd9f 100644 (file)
 #define WebKitCoreMathMLEnabledPreferenceKey "WebKitCoreMathMLEnabled"
 
 #define WebKitRequestIdleCallbackEnabledPreferenceKey "WebKitRequestIdleCallbackEnabled"
+
+#define WebKitAsyncClipboardAPIEnabledPreferenceKey "WebKitAsyncClipboardAPIEnabled"
index 3be14de..9a78426 100644 (file)
@@ -341,6 +341,8 @@ void WebPreferences::initializeDefaultSettings()
 
     CFDictionaryAddValue(defaults, CFSTR(WebKitRequestIdleCallbackEnabledPreferenceKey), kCFBooleanFalse);
 
+    CFDictionaryAddValue(defaults, CFSTR(WebKitAsyncClipboardAPIEnabledPreferenceKey), kCFBooleanFalse);
+
     defaultSettings = defaults;
 #endif
 }
@@ -2293,6 +2295,20 @@ HRESULT WebPreferences::setRequestIdleCallbackEnabled(BOOL enabled)
     return S_OK;
 }
 
+HRESULT WebPreferences::asyncClipboardAPIEnabled(_Out_ BOOL* enabled)
+{
+    if (!enabled)
+        return E_POINTER;
+    *enabled = boolValueForKey(WebKitAsyncClipboardAPIEnabledPreferenceKey);
+    return S_OK;
+}
+
+HRESULT WebPreferences::setAsyncClipboardAPIEnabled(BOOL enabled)
+{
+    setBoolValue(WebKitAsyncClipboardAPIEnabledPreferenceKey, enabled);
+    return S_OK;
+}
+
 HRESULT WebPreferences::setApplicationId(BSTR applicationId)
 {
 #if USE(CF)
index fec573f..22bb1b3 100644 (file)
@@ -291,6 +291,8 @@ public:
     virtual HRESULT STDMETHODCALLTYPE setCoreMathMLEnabled(BOOL);
     virtual HRESULT STDMETHODCALLTYPE requestIdleCallbackEnabled(_Out_ BOOL*);
     virtual HRESULT STDMETHODCALLTYPE setRequestIdleCallbackEnabled(BOOL);
+    virtual HRESULT STDMETHODCALLTYPE asyncClipboardAPIEnabled(_Out_ BOOL*);
+    virtual HRESULT STDMETHODCALLTYPE setAsyncClipboardAPIEnabled(BOOL);
 
     // WebPreferences
 
index f7b5c86..790c1a1 100644 (file)
@@ -5614,6 +5614,11 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
         return hr;
     settings.setRequestIdleCallbackEnabled(!!enabled);
 
+    hr = prefsPrivate->asyncClipboardAPIEnabled(&enabled);
+    if (FAILED(hr))
+        return hr;
+    settings.setAsyncClipboardAPIEnabled(!!enabled);
+
     return S_OK;
 }
 
index c7c72e4..348fede 100644 (file)
@@ -1,3 +1,16 @@
+2019-10-15  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        REGRESSION: editing/async-clipboard/clipboard-interfaces.html is failing in WebKit1
+        https://bugs.webkit.org/show_bug.cgi?id=202940
+        <rdar://problem/56262298>
+
+        Reviewed by Ryosuke Niwa.
+
+        Add some plumbing to support the async clipboard API experimental test option in Windows.
+
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (setWebPreferencesForTestOptions):
+
 2019-10-15  Jiewen Tan  <jiewen_tan@apple.com>
 
         [WebAuthn] Write more tests for _WKWebAuthenticationPanel
index 6282d72..1ff849e 100644 (file)
@@ -125,6 +125,8 @@ TestOptions::TestOptions(const std::string& pathOrURL, const std::string& absolu
             enableCoreMathML = parseBooleanTestHeaderValue(value);
         else if (key == "experimental:RequestIdleCallbackEnabled")
             enableRequestIdleCallback = parseBooleanTestHeaderValue(value);
+        else if (key == "experimental:AsyncClipboardAPIEnabled")
+            enableAsyncClipboardAPI = parseBooleanTestHeaderValue(value);
         pairStart = pairEnd + 1;
     }
 }
index 37a3b4b..0969b18 100644 (file)
@@ -52,6 +52,7 @@ struct TestOptions {
     bool enableResizeObserver { false };
     bool enableCoreMathML { false };
     bool enableRequestIdleCallback { false };
+    bool enableAsyncClipboardAPI { false };
     std::string jscOptions;
     std::string additionalSupportedImageTypes;
 
index 84d3bc7..14f820f 100644 (file)
@@ -1029,6 +1029,7 @@ static void setWebPreferencesForTestOptions(const TestOptions& options)
     preferences.resizeObserverEnabled = options.enableResizeObserver;
     preferences.coreMathMLEnabled = options.enableCoreMathML;
     preferences.requestIdleCallbackEnabled = options.enableRequestIdleCallback;
+    preferences.asyncClipboardAPIEnabled = options.enableAsyncClipboardAPI;
     preferences.privateBrowsingEnabled = options.useEphemeralSession;
     preferences.usesPageCache = options.enablePageCache;
 }
index 99773d3..a2deb81 100644 (file)
@@ -912,6 +912,7 @@ static void setWebPreferencesForTestOptions(IWebPreferences* preferences, const
     prefsPrivate->setIsSecureContextAttributeEnabled(options.enableIsSecureContextAttribute);
     prefsPrivate->setInspectorAdditionsEnabled(options.enableInspectorAdditions);
     prefsPrivate->setRequestIdleCallbackEnabled(options.enableRequestIdleCallback);
+    prefsPrivate->setAsyncClipboardAPIEnabled(options.enableAsyncClipboardAPI);
     preferences->setPrivateBrowsingEnabled(options.useEphemeralSession);
     preferences->setUsesPageCache(options.enablePageCache);
 }