Changeset 167276 in webkit


Ignore:
Timestamp:
Apr 14, 2014 3:46:22 PM (10 years ago)
Author:
mitz@apple.com
Message:

Let the bundle form client know whether a change in a text field was initiated by user typing
https://bugs.webkit.org/show_bug.cgi?id=131643

Reviewed by Sam Weinig.

  • WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Added

initiatedByUserTyping parameter to the delegate method.

  • WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:

(-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Updated overload of
textDidChangeInTextField to take the initiatedByUserTyping parameter and pass it along to
the delegate.

  • WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:

(API::InjectedBundle::FormClient::textDidChangeInTextField): Added initiatedByUserTyping
parameter.

  • WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:

(WebKit::InjectedBundlePageFormClient::textDidChangeInTextField): Maintained the existing
behavior of not calling the C SPI client if the change was not initiated by user typing.

  • WebProcess/InjectedBundle/InjectedBundlePageFormClient.h: Updated for added parameter.
  • WebProcess/WebCoreSupport/WebEditorClient.cpp:

(WebKit::WebEditorClient::textDidChangeInTextField): Changed to call the bundle client
function unconditionally, but pass along whether the change was initiated by user typing.

Location:
trunk/Source/WebKit2
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r167275 r167276  
     12014-04-14  Dan Bernstein  <mitz@apple.com>
     2
     3        Let the bundle form client know whether a change in a text field was initiated by user typing
     4        https://bugs.webkit.org/show_bug.cgi?id=131643
     5
     6        Reviewed by Sam Weinig.
     7
     8        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Added
     9        initiatedByUserTyping parameter to the delegate method.
     10
     11        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
     12        (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Updated overload of
     13        textDidChangeInTextField to take the initiatedByUserTyping parameter and pass it along to
     14        the delegate.
     15
     16        * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
     17        (API::InjectedBundle::FormClient::textDidChangeInTextField): Added initiatedByUserTyping
     18        parameter.
     19
     20        * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
     21        (WebKit::InjectedBundlePageFormClient::textDidChangeInTextField): Maintained the existing
     22        behavior of not calling the C SPI client if the change was not initiated by user typing.
     23        * WebProcess/InjectedBundle/InjectedBundlePageFormClient.h: Updated for added parameter.
     24
     25        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
     26        (WebKit::WebEditorClient::textDidChangeInTextField): Changed to call the bundle client
     27        function unconditionally, but pass along whether the change was initiated by user typing.
     28
    1292014-04-14  Dan Bernstein  <mitz@apple.com>
    230
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h

    r167275 r167276  
    3939- (void)_webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller willSendSubmitEventToForm:(WKWebProcessPlugInNodeHandle *)form inFrame:(WKWebProcessPlugInFrame *)sourceFrame targetFrame:(WKWebProcessPlugInFrame *)targetFrame values:(NSDictionary *)values;
    4040- (void)_webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller willSubmitForm:(WKWebProcessPlugInNodeHandle *)form toFrame:(WKWebProcessPlugInFrame *)frame fromFrame:(WKWebProcessPlugInFrame *)sourceFrame withValues:(NSDictionary *)values;
    41 - (void)_webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller textDidChangeInTextField:(WKWebProcessPlugInNodeHandle *)textField inFrame:(WKWebProcessPlugInFrame *)frame;
     41- (void)_webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller textDidChangeInTextField:(WKWebProcessPlugInNodeHandle *)textField inFrame:(WKWebProcessPlugInFrame *)frame initiatedByUserTyping:(BOOL)initiatedByUserTyping;
    4242
    4343// The return value is exposed in the UI process via the userObject property of the _WKFormInputSession object.
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm

    r167275 r167276  
    421421        }
    422422
    423         virtual void textDidChangeInTextField(WebPage*, HTMLInputElement* inputElement, WebFrame* frame) override
     423        virtual void textDidChangeInTextField(WebPage*, HTMLInputElement* inputElement, WebFrame* frame, bool initiatedByUserTyping) override
    424424        {
    425425            auto formDelegate = m_controller->_formDelegate.get();
    426426
    427             if ([formDelegate respondsToSelector:@selector(_webProcessPlugInBrowserContextController:textDidChangeInTextField:inFrame:)])
    428                 [formDelegate _webProcessPlugInBrowserContextController:m_controller textDidChangeInTextField:wrapper(*WebKit::InjectedBundleNodeHandle::getOrCreate(inputElement)) inFrame:wrapper(*frame)];
     427            if ([formDelegate respondsToSelector:@selector(_webProcessPlugInBrowserContextController:textDidChangeInTextField:inFrame:initiatedByUserTyping:)])
     428                [formDelegate _webProcessPlugInBrowserContextController:m_controller textDidChangeInTextField:wrapper(*WebKit::InjectedBundleNodeHandle::getOrCreate(inputElement)) inFrame:wrapper(*frame) initiatedByUserTyping:initiatedByUserTyping];
    429429        }
    430430
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/APIInjectedBundleFormClient.h

    r166900 r167276  
    5555    virtual void textFieldDidBeginEditing(WebKit::WebPage*, WebCore::HTMLInputElement*, WebKit::WebFrame*) { }
    5656    virtual void textFieldDidEndEditing(WebKit::WebPage*, WebCore::HTMLInputElement*, WebKit::WebFrame*) { }
    57     virtual void textDidChangeInTextField(WebKit::WebPage*, WebCore::HTMLInputElement*, WebKit::WebFrame*) { }
     57    virtual void textDidChangeInTextField(WebKit::WebPage*, WebCore::HTMLInputElement*, WebKit::WebFrame*, bool initiatedByUserTyping) { }
    5858    virtual void textDidChangeInTextArea(WebKit::WebPage*, WebCore::HTMLTextAreaElement*, WebKit::WebFrame*) { }
    5959
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp

    r166890 r167276  
    7272}
    7373
    74 void InjectedBundlePageFormClient::textDidChangeInTextField(WebPage* page, HTMLInputElement* inputElement, WebFrame* frame)
     74void InjectedBundlePageFormClient::textDidChangeInTextField(WebPage* page, HTMLInputElement* inputElement, WebFrame* frame, bool initiatedByUserTyping)
    7575{
    7676    if (!m_client.textDidChangeInTextField)
     77        return;
     78
     79    if (!initiatedByUserTyping)
    7780        return;
    7881
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.h

    r166890 r167276  
    4747    virtual void textFieldDidBeginEditing(WebPage*, WebCore::HTMLInputElement*, WebFrame*) override;
    4848    virtual void textFieldDidEndEditing(WebPage*, WebCore::HTMLInputElement*, WebFrame*) override;
    49     virtual void textDidChangeInTextField(WebPage*, WebCore::HTMLInputElement*, WebFrame*) override;
     49    virtual void textDidChangeInTextField(WebPage*, WebCore::HTMLInputElement*, WebFrame*, bool initiatedByUserTyping) override;
    5050    virtual void textDidChangeInTextArea(WebPage*, WebCore::HTMLTextAreaElement*, WebFrame*) override;
    5151    virtual bool shouldPerformActionInTextField(WebPage*, WebCore::HTMLInputElement*, InputFieldAction, WebFrame*) override;   
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp

    r166890 r167276  
    320320        return;
    321321
    322     if (!UserTypingGestureIndicator::processingUserTypingGesture() || UserTypingGestureIndicator::focusedElementAtGestureStart() != element)
    323         return;
     322    bool initiatedByUserTyping = UserTypingGestureIndicator::processingUserTypingGesture() && UserTypingGestureIndicator::focusedElementAtGestureStart() == element;
    324323
    325324    WebFrame* webFrame = WebFrame::fromCoreFrame(*element->document().frame());
    326325    ASSERT(webFrame);
    327326
    328     m_page->injectedBundleFormClient().textDidChangeInTextField(m_page, toHTMLInputElement(element), webFrame);
     327    m_page->injectedBundleFormClient().textDidChangeInTextField(m_page, toHTMLInputElement(element), webFrame, initiatedByUserTyping);
    329328}
    330329
Note: See TracChangeset for help on using the changeset viewer.