Changeset 228920 in webkit


Ignore:
Timestamp:
Feb 22, 2018 10:01:08 AM (6 years ago)
Author:
Matt Lewis
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

Location:
trunk/Source/WebKit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r228919 r228920  
     12018-02-22  Matt Lewis  <jlewis3@apple.com>
     2
     3        Unreviewed, rolling out r228902.
     4
     5        This broke internal builds.
     6
     7        Reverted changeset:
     8
     9        "[Cocoa] Web Automation: provide a way to ask clients the type
     10        of a JavaScript dialog"
     11        https://bugs.webkit.org/show_bug.cgi?id=182660
     12        https://trac.webkit.org/changeset/228902
     13
    1142018-02-22  Youenn Fablet  <youenn@apple.com>
    215
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h

    r228902 r228920  
    11/*
    2  * Copyright (C) 2016, 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2016 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3434@class _WKAutomationSession;
    3535
    36 typedef NS_ENUM(NSInteger, _WKAutomationSessionJavaScriptDialogType) {
    37     _WKAutomationSessionJavaScriptDialogTypeNone = 1,
    38     _WKAutomationSessionJavaScriptDialogTypeAlert,
    39     _WKAutomationSessionJavaScriptDialogTypeConfirm,
    40     _WKAutomationSessionJavaScriptDialogTypePrompt,
    41 } WK_API_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
    42 
    4336@protocol _WKAutomationSessionDelegate <NSObject>
    4437@optional
     
    5245- (NSString *)_automationSession:(_WKAutomationSession *)automationSession messageOfCurrentJavaScriptDialogForWebView:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.13), ios(11.0));
    5346- (void)_automationSession:(_WKAutomationSession *)automationSession setUserInput:(NSString *)value forCurrentJavaScriptDialogForWebView:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.13), ios(11.0));
    54 - (_WKAutomationSessionJavaScriptDialogType)_automationSession:(_WKAutomationSession *)automationSession typeOfCurrentJavaScriptDialogForWebView:(WKWebView *)webView WK_API_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
    5547
    56 // FIXME 37408718: Objective-C delegate methods shouldn't use C API types like WKPageRef. We need to
     48// FIXME: Objective-C delegate methods shouldn't use C API types like WKPageRef. We need to
    5749// migrate clients to use WKWebView, or expose the same behavior via a C SPI for those clients.
    58 - (WKPageRef)_automationSessionDidRequestNewWindow:(_WKAutomationSession *)automationSession WK_API_AVAILABLE(macosx(10.13), ios(11.0));
    59 - (BOOL)_automationSession:(_WKAutomationSession *)automationSession isShowingJavaScriptDialogOnPage:(WKPageRef)page WK_API_AVAILABLE(macosx(10.13), ios(11.0));
    60 - (void)_automationSession:(_WKAutomationSession *)automationSession dismissCurrentJavaScriptDialogOnPage:(WKPageRef)page WK_API_AVAILABLE(macosx(10.13), ios(11.0));
    61 - (void)_automationSession:(_WKAutomationSession *)automationSession acceptCurrentJavaScriptDialogOnPage:(WKPageRef)page WK_API_AVAILABLE(macosx(10.13), ios(11.0));
    62 - (NSString *)_automationSession:(_WKAutomationSession *)automationSession messageOfCurrentJavaScriptDialogOnPage:(WKPageRef)page WK_API_AVAILABLE(macosx(10.13), ios(11.0));
    63 - (void)_automationSession:(_WKAutomationSession *)automationSession setUserInput:(NSString *)value forCurrentJavaScriptDialogOnPage:(WKPageRef)page WK_API_AVAILABLE(macosx(10.13), ios(11.0));
    64 - (_WKAutomationSessionJavaScriptDialogType)_automationSession:(_WKAutomationSession *)automationSession typeOfCurrentJavaScriptDialogOnPage:(WKPageRef)page WK_API_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
     50- (WKPageRef)_automationSessionDidRequestNewWindow:(_WKAutomationSession *)automationSession;
     51- (BOOL)_automationSession:(_WKAutomationSession *)automationSession isShowingJavaScriptDialogOnPage:(WKPageRef)page;
     52- (void)_automationSession:(_WKAutomationSession *)automationSession dismissCurrentJavaScriptDialogOnPage:(WKPageRef)page;
     53- (void)_automationSession:(_WKAutomationSession *)automationSession acceptCurrentJavaScriptDialogOnPage:(WKPageRef)page;
     54- (NSString *)_automationSession:(_WKAutomationSession *)automationSession messageOfCurrentJavaScriptDialogOnPage:(WKPageRef)page;
     55- (void)_automationSession:(_WKAutomationSession *)automationSession setUserInput:(NSString *)value forCurrentJavaScriptDialogOnPage:(WKPageRef)page;
    6556@end
    6657
  • trunk/Source/WebKit/UIProcess/Cocoa/AutomationSessionClient.h

    r228902 r228920  
    6565        bool messageOfCurrentJavaScriptDialogForWebView : 1;
    6666        bool setUserInputForCurrentJavaScriptPromptForWebView : 1;
    67         bool typeOfCurrentJavaScriptDialogForWebView : 1;
    6867
    69         // FIXME 37408718: these delegate methods should be removed.
     68        // FIXME 28524687: these delegate methods should be removed.
    7069        bool didRequestNewWindow : 1;
    7170        bool isShowingJavaScriptDialogOnPage : 1;
     
    7473        bool messageOfCurrentJavaScriptDialogOnPage : 1;
    7574        bool setUserInputForCurrentJavaScriptPromptOnPage : 1;
    76         bool typeOfCurrentJavaScriptDialogOnPage : 1;
    7775    } m_delegateMethods;
    7876};
  • trunk/Source/WebKit/UIProcess/Cocoa/AutomationSessionClient.mm

    r228902 r228920  
    4949    m_delegateMethods.messageOfCurrentJavaScriptDialogForWebView = [delegate respondsToSelector:@selector(_automationSession:messageOfCurrentJavaScriptDialogForWebView:)];
    5050    m_delegateMethods.setUserInputForCurrentJavaScriptPromptForWebView = [delegate respondsToSelector:@selector(_automationSession:setUserInput:forCurrentJavaScriptDialogForWebView:)];
    51     m_delegateMethods.typeOfCurrentJavaScriptDialogForWebView = [delegate respondsToSelector:@selector(_automationSession:typeOfCurrentJavaScriptDialogForWebView:)];
    5251
    53     // FIXME 37408718: these delegate methods should be removed.
     52    // FIXME 28524687: these delegate methods should be removed.
    5453    m_delegateMethods.didRequestNewWindow = [delegate respondsToSelector:@selector(_automationSessionDidRequestNewWindow:)];
    5554    m_delegateMethods.isShowingJavaScriptDialogOnPage = [delegate respondsToSelector:@selector(_automationSession:isShowingJavaScriptDialogOnPage:)];
     
    5857    m_delegateMethods.messageOfCurrentJavaScriptDialogOnPage = [delegate respondsToSelector:@selector(_automationSession:messageOfCurrentJavaScriptDialogOnPage:)];
    5958    m_delegateMethods.setUserInputForCurrentJavaScriptPromptOnPage = [delegate respondsToSelector:@selector(_automationSession:setUserInput:forCurrentJavaScriptDialogOnPage:)];
    60     m_delegateMethods.typeOfCurrentJavaScriptDialogOnPage = [delegate respondsToSelector:@selector(_automationSession:typeOfCurrentJavaScriptDialogOnPage:)];
    6159}
    6260
     
    6765}
    6866
    69 // FIXME 37408718: support for WKPageRef-based delegate methods should be removed.
     67// FIXME 28524687: support for WKPageRef-based delegate methods should be removed.
    7068// Until these are removed, prefer to use the WKWebView delegate methods if implemented.
    7169WebPageProxy* AutomationSessionClient::didRequestNewWindow(WebAutomationSession& session)
     
    126124}
    127125
    128 static std::optional<API::AutomationSessionClient::JavaScriptDialogType> toImpl(_WKAutomationSessionJavaScriptDialogType type)
     126std::optional<API::AutomationSessionClient::JavaScriptDialogType> AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage(WebAutomationSession&, WebPageProxy&)
    129127{
    130     switch (type) {
    131     case _WKAutomationSessionJavaScriptDialogTypeNone:
    132         return std::nullopt;
    133     case _WKAutomationSessionJavaScriptDialogTypePrompt:
    134         return API::AutomationSessionClient::JavaScriptDialogType::Prompt;
    135     case _WKAutomationSessionJavaScriptDialogTypeConfirm:
    136         return API::AutomationSessionClient::JavaScriptDialogType::Confirm;
    137     case _WKAutomationSessionJavaScriptDialogTypeAlert:
    138         return API::AutomationSessionClient::JavaScriptDialogType::Alert;
    139     }
    140 }
    141 
    142 std::optional<API::AutomationSessionClient::JavaScriptDialogType> AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage(WebAutomationSession& session, WebPageProxy& page)
    143 {
    144     if (m_delegateMethods.typeOfCurrentJavaScriptDialogForWebView)
    145         return toImpl([m_delegate.get() _automationSession:wrapper(session) typeOfCurrentJavaScriptDialogForWebView:fromWebPageProxy(page)]);
    146     if (m_delegateMethods.typeOfCurrentJavaScriptDialogOnPage)
    147         return toImpl([m_delegate.get() _automationSession:wrapper(session) typeOfCurrentJavaScriptDialogOnPage:toAPI(&page)]);
    148 
     128    // FIXME: Implement it. This is only used in WebAutomationSession::setUserInputForCurrentJavaScriptPrompt() so for now we return
     129    // always Prompt type for compatibility.
    149130    return API::AutomationSessionClient::JavaScriptDialogType::Prompt;
    150131}
Note: See TracChangeset for help on using the changeset viewer.