Title: [228920] trunk/Source/WebKit
Revision
228920
Author
jlew...@apple.com
Date
2018-02-22 10:01:08 -0800 (Thu, 22 Feb 2018)

Log Message

Unreviewed, rolling out r228902.

This broke internal builds.

Reverted changeset:

"[Cocoa] Web Automation: provide a way to ask clients the type
of a _javascript_ dialog"
https://bugs.webkit.org/show_bug.cgi?id=182660
https://trac.webkit.org/changeset/228902

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (228919 => 228920)


--- trunk/Source/WebKit/ChangeLog	2018-02-22 16:55:53 UTC (rev 228919)
+++ trunk/Source/WebKit/ChangeLog	2018-02-22 18:01:08 UTC (rev 228920)
@@ -1,3 +1,16 @@
+2018-02-22  Matt Lewis  <jlew...@apple.com>
+
+        Unreviewed, rolling out r228902.
+
+        This broke internal builds.
+
+        Reverted changeset:
+
+        "[Cocoa] Web Automation: provide a way to ask clients the type
+        of a _javascript_ dialog"
+        https://bugs.webkit.org/show_bug.cgi?id=182660
+        https://trac.webkit.org/changeset/228902
+
 2018-02-22  Youenn Fablet  <you...@apple.com>
 
         Add release asserts for service worker fetch and postMessage events

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h (228919 => 228920)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h	2018-02-22 16:55:53 UTC (rev 228919)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h	2018-02-22 18:01:08 UTC (rev 228920)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -33,13 +33,6 @@
 @class WKWebView;
 @class _WKAutomationSession;
 
-typedef NS_ENUM(NSInteger, _WKAutomationSessionJavaScriptDialogType) {
-    _WKAutomationSessionJavaScriptDialogTypeNone = 1,
-    _WKAutomationSessionJavaScriptDialogTypeAlert,
-    _WKAutomationSessionJavaScriptDialogTypeConfirm,
-    _WKAutomationSessionJavaScriptDialogTypePrompt,
-} WK_API_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
-
 @protocol _WKAutomationSessionDelegate <NSObject>
 @optional
 
@@ -51,17 +44,15 @@
 - (void)_automationSession:(_WKAutomationSession *)automationSession acceptCurrentJavaScriptDialogForWebView:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.13), ios(11.0));
 - (NSString *)_automationSession:(_WKAutomationSession *)automationSession messageOfCurrentJavaScriptDialogForWebView:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.13), ios(11.0));
 - (void)_automationSession:(_WKAutomationSession *)automationSession setUserInput:(NSString *)value forCurrentJavaScriptDialogForWebView:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.13), ios(11.0));
-- (_WKAutomationSessionJavaScriptDialogType)_automationSession:(_WKAutomationSession *)automationSession typeOfCurrentJavaScriptDialogForWebView:(WKWebView *)webView WK_API_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
 
-// FIXME 37408718: Objective-C delegate methods shouldn't use C API types like WKPageRef. We need to
+// FIXME: Objective-C delegate methods shouldn't use C API types like WKPageRef. We need to
 // migrate clients to use WKWebView, or expose the same behavior via a C SPI for those clients.
-- (WKPageRef)_automationSessionDidRequestNewWindow:(_WKAutomationSession *)automationSession WK_API_AVAILABLE(macosx(10.13), ios(11.0));
-- (BOOL)_automationSession:(_WKAutomationSession *)automationSession isShowingJavaScriptDialogOnPage:(WKPageRef)page WK_API_AVAILABLE(macosx(10.13), ios(11.0));
-- (void)_automationSession:(_WKAutomationSession *)automationSession dismissCurrentJavaScriptDialogOnPage:(WKPageRef)page WK_API_AVAILABLE(macosx(10.13), ios(11.0));
-- (void)_automationSession:(_WKAutomationSession *)automationSession acceptCurrentJavaScriptDialogOnPage:(WKPageRef)page WK_API_AVAILABLE(macosx(10.13), ios(11.0));
-- (NSString *)_automationSession:(_WKAutomationSession *)automationSession messageOfCurrentJavaScriptDialogOnPage:(WKPageRef)page WK_API_AVAILABLE(macosx(10.13), ios(11.0));
-- (void)_automationSession:(_WKAutomationSession *)automationSession setUserInput:(NSString *)value forCurrentJavaScriptDialogOnPage:(WKPageRef)page WK_API_AVAILABLE(macosx(10.13), ios(11.0));
-- (_WKAutomationSessionJavaScriptDialogType)_automationSession:(_WKAutomationSession *)automationSession typeOfCurrentJavaScriptDialogOnPage:(WKPageRef)page WK_API_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
+- (WKPageRef)_automationSessionDidRequestNewWindow:(_WKAutomationSession *)automationSession;
+- (BOOL)_automationSession:(_WKAutomationSession *)automationSession isShowingJavaScriptDialogOnPage:(WKPageRef)page;
+- (void)_automationSession:(_WKAutomationSession *)automationSession dismissCurrentJavaScriptDialogOnPage:(WKPageRef)page;
+- (void)_automationSession:(_WKAutomationSession *)automationSession acceptCurrentJavaScriptDialogOnPage:(WKPageRef)page;
+- (NSString *)_automationSession:(_WKAutomationSession *)automationSession messageOfCurrentJavaScriptDialogOnPage:(WKPageRef)page;
+- (void)_automationSession:(_WKAutomationSession *)automationSession setUserInput:(NSString *)value forCurrentJavaScriptDialogOnPage:(WKPageRef)page;
 @end
 
 #endif // WK_API_ENABLED

Modified: trunk/Source/WebKit/UIProcess/Cocoa/AutomationSessionClient.h (228919 => 228920)


--- trunk/Source/WebKit/UIProcess/Cocoa/AutomationSessionClient.h	2018-02-22 16:55:53 UTC (rev 228919)
+++ trunk/Source/WebKit/UIProcess/Cocoa/AutomationSessionClient.h	2018-02-22 18:01:08 UTC (rev 228920)
@@ -64,9 +64,8 @@
         bool acceptCurrentJavaScriptDialogForWebView : 1;
         bool messageOfCurrentJavaScriptDialogForWebView : 1;
         bool setUserInputForCurrentJavaScriptPromptForWebView : 1;
-        bool typeOfCurrentJavaScriptDialogForWebView : 1;
 
-        // FIXME 37408718: these delegate methods should be removed.
+        // FIXME 28524687: these delegate methods should be removed.
         bool didRequestNewWindow : 1;
         bool isShowingJavaScriptDialogOnPage : 1;
         bool dismissCurrentJavaScriptDialogOnPage : 1;
@@ -73,7 +72,6 @@
         bool acceptCurrentJavaScriptDialogOnPage : 1;
         bool messageOfCurrentJavaScriptDialogOnPage : 1;
         bool setUserInputForCurrentJavaScriptPromptOnPage : 1;
-        bool typeOfCurrentJavaScriptDialogOnPage : 1;
     } m_delegateMethods;
 };
 

Modified: trunk/Source/WebKit/UIProcess/Cocoa/AutomationSessionClient.mm (228919 => 228920)


--- trunk/Source/WebKit/UIProcess/Cocoa/AutomationSessionClient.mm	2018-02-22 16:55:53 UTC (rev 228919)
+++ trunk/Source/WebKit/UIProcess/Cocoa/AutomationSessionClient.mm	2018-02-22 18:01:08 UTC (rev 228920)
@@ -48,9 +48,8 @@
     m_delegateMethods.acceptCurrentJavaScriptDialogForWebView = [delegate respondsToSelector:@selector(_automationSession:acceptCurrentJavaScriptDialogForWebView:)];
     m_delegateMethods.messageOfCurrentJavaScriptDialogForWebView = [delegate respondsToSelector:@selector(_automationSession:messageOfCurrentJavaScriptDialogForWebView:)];
     m_delegateMethods.setUserInputForCurrentJavaScriptPromptForWebView = [delegate respondsToSelector:@selector(_automationSession:setUserInput:forCurrentJavaScriptDialogForWebView:)];
-    m_delegateMethods.typeOfCurrentJavaScriptDialogForWebView = [delegate respondsToSelector:@selector(_automationSession:typeOfCurrentJavaScriptDialogForWebView:)];
 
-    // FIXME 37408718: these delegate methods should be removed.
+    // FIXME 28524687: these delegate methods should be removed.
     m_delegateMethods.didRequestNewWindow = [delegate respondsToSelector:@selector(_automationSessionDidRequestNewWindow:)];
     m_delegateMethods.isShowingJavaScriptDialogOnPage = [delegate respondsToSelector:@selector(_automationSession:isShowingJavaScriptDialogOnPage:)];
     m_delegateMethods.dismissCurrentJavaScriptDialogOnPage = [delegate respondsToSelector:@selector(_automationSession:dismissCurrentJavaScriptDialogOnPage:)];
@@ -57,7 +56,6 @@
     m_delegateMethods.acceptCurrentJavaScriptDialogOnPage = [delegate respondsToSelector:@selector(_automationSession:acceptCurrentJavaScriptDialogOnPage:)];
     m_delegateMethods.messageOfCurrentJavaScriptDialogOnPage = [delegate respondsToSelector:@selector(_automationSession:messageOfCurrentJavaScriptDialogOnPage:)];
     m_delegateMethods.setUserInputForCurrentJavaScriptPromptOnPage = [delegate respondsToSelector:@selector(_automationSession:setUserInput:forCurrentJavaScriptDialogOnPage:)];
-    m_delegateMethods.typeOfCurrentJavaScriptDialogOnPage = [delegate respondsToSelector:@selector(_automationSession:typeOfCurrentJavaScriptDialogOnPage:)];
 }
 
 void AutomationSessionClient::didDisconnectFromRemote(WebAutomationSession& session)
@@ -66,7 +64,7 @@
         [m_delegate.get() _automationSessionDidDisconnectFromRemote:wrapper(session)];
 }
 
-// FIXME 37408718: support for WKPageRef-based delegate methods should be removed.
+// FIXME 28524687: support for WKPageRef-based delegate methods should be removed.
 // Until these are removed, prefer to use the WKWebView delegate methods if implemented.
 WebPageProxy* AutomationSessionClient::didRequestNewWindow(WebAutomationSession& session)
 {
@@ -125,27 +123,10 @@
         [m_delegate.get() _automationSession:wrapper(session) setUserInput:value forCurrentJavaScriptDialogOnPage:toAPI(&page)];
 }
 
-static std::optional<API::AutomationSessionClient::_javascript_DialogType> toImpl(_WKAutomationSessionJavaScriptDialogType type)
+std::optional<API::AutomationSessionClient::_javascript_DialogType> AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage(WebAutomationSession&, WebPageProxy&)
 {
-    switch (type) {
-    case _WKAutomationSessionJavaScriptDialogTypeNone:
-        return std::nullopt;
-    case _WKAutomationSessionJavaScriptDialogTypePrompt:
-        return API::AutomationSessionClient::_javascript_DialogType::Prompt;
-    case _WKAutomationSessionJavaScriptDialogTypeConfirm:
-        return API::AutomationSessionClient::_javascript_DialogType::Confirm;
-    case _WKAutomationSessionJavaScriptDialogTypeAlert:
-        return API::AutomationSessionClient::_javascript_DialogType::Alert;
-    }
-}
-
-std::optional<API::AutomationSessionClient::_javascript_DialogType> AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage(WebAutomationSession& session, WebPageProxy& page)
-{
-    if (m_delegateMethods.typeOfCurrentJavaScriptDialogForWebView)
-        return toImpl([m_delegate.get() _automationSession:wrapper(session) typeOfCurrentJavaScriptDialogForWebView:fromWebPageProxy(page)]);
-    if (m_delegateMethods.typeOfCurrentJavaScriptDialogOnPage)
-        return toImpl([m_delegate.get() _automationSession:wrapper(session) typeOfCurrentJavaScriptDialogOnPage:toAPI(&page)]);
-
+    // FIXME: Implement it. This is only used in WebAutomationSession::setUserInputForCurrentJavaScriptPrompt() so for now we return
+    // always Prompt type for compatibility.
     return API::AutomationSessionClient::_javascript_DialogType::Prompt;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to