Changeset 167276 in webkit
- Timestamp:
- Apr 14, 2014 3:46:22 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r167275 r167276 1 2014-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 1 29 2014-04-14 Dan Bernstein <mitz@apple.com> 2 30 -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h
r167275 r167276 39 39 - (void)_webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller willSendSubmitEventToForm:(WKWebProcessPlugInNodeHandle *)form inFrame:(WKWebProcessPlugInFrame *)sourceFrame targetFrame:(WKWebProcessPlugInFrame *)targetFrame values:(NSDictionary *)values; 40 40 - (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; 42 42 43 43 // 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 421 421 } 422 422 423 virtual void textDidChangeInTextField(WebPage*, HTMLInputElement* inputElement, WebFrame* frame ) override423 virtual void textDidChangeInTextField(WebPage*, HTMLInputElement* inputElement, WebFrame* frame, bool initiatedByUserTyping) override 424 424 { 425 425 auto formDelegate = m_controller->_formDelegate.get(); 426 426 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]; 429 429 } 430 430 -
trunk/Source/WebKit2/WebProcess/InjectedBundle/APIInjectedBundleFormClient.h
r166900 r167276 55 55 virtual void textFieldDidBeginEditing(WebKit::WebPage*, WebCore::HTMLInputElement*, WebKit::WebFrame*) { } 56 56 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) { } 58 58 virtual void textDidChangeInTextArea(WebKit::WebPage*, WebCore::HTMLTextAreaElement*, WebKit::WebFrame*) { } 59 59 -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp
r166890 r167276 72 72 } 73 73 74 void InjectedBundlePageFormClient::textDidChangeInTextField(WebPage* page, HTMLInputElement* inputElement, WebFrame* frame )74 void InjectedBundlePageFormClient::textDidChangeInTextField(WebPage* page, HTMLInputElement* inputElement, WebFrame* frame, bool initiatedByUserTyping) 75 75 { 76 76 if (!m_client.textDidChangeInTextField) 77 return; 78 79 if (!initiatedByUserTyping) 77 80 return; 78 81 -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.h
r166890 r167276 47 47 virtual void textFieldDidBeginEditing(WebPage*, WebCore::HTMLInputElement*, WebFrame*) override; 48 48 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; 50 50 virtual void textDidChangeInTextArea(WebPage*, WebCore::HTMLTextAreaElement*, WebFrame*) override; 51 51 virtual bool shouldPerformActionInTextField(WebPage*, WebCore::HTMLInputElement*, InputFieldAction, WebFrame*) override; -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
r166890 r167276 320 320 return; 321 321 322 if (!UserTypingGestureIndicator::processingUserTypingGesture() || UserTypingGestureIndicator::focusedElementAtGestureStart() != element) 323 return; 322 bool initiatedByUserTyping = UserTypingGestureIndicator::processingUserTypingGesture() && UserTypingGestureIndicator::focusedElementAtGestureStart() == element; 324 323 325 324 WebFrame* webFrame = WebFrame::fromCoreFrame(*element->document().frame()); 326 325 ASSERT(webFrame); 327 326 328 m_page->injectedBundleFormClient().textDidChangeInTextField(m_page, toHTMLInputElement(element), webFrame );327 m_page->injectedBundleFormClient().textDidChangeInTextField(m_page, toHTMLInputElement(element), webFrame, initiatedByUserTyping); 329 328 } 330 329
Note: See TracChangeset
for help on using the changeset viewer.