Changeset 199040 in webkit
- Timestamp:
- Apr 4, 2016, 9:22:54 PM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h (modified) (1 diff)
-
WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm (modified) (1 diff)
-
WebProcess/InjectedBundle/APIInjectedBundleFormClient.h (modified) (1 diff)
-
WebProcess/WebPage/ios/WebPageIOS.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r199033 r199040 1 2016-04-04 Chelsea Pugh <cpugh@apple.com> 2 3 [iOS] Allow clients in the bundle to know whether a field was focused by user interaction 4 https://bugs.webkit.org/show_bug.cgi?id=156118 5 6 Reviewed by Dan Bernstein. 7 8 * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Add delegate method that takes userIsInteracting bool so that bundle clients get this information. 9 * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: Call API with userIsInteracting property if delegate implements it, otherwise call existing API if 10 userIsInteracting is true, as we previously did in WebKit::WebPage::elementDidFocus. Move FIXME from WebKit::WebPage::elementDidFocus to here, since we are checking userIsInteracting. 11 * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h: 12 (API::InjectedBundle::FormClient::willBeginInputSession): Add userIsInteracting bool to arguments so we can use it for call to the new API as well as preserving behavior of the old API. 13 * WebProcess/WebPage/ios/WebPageIOS.mm: 14 (WebKit::WebPage::elementDidFocus): Remove check if user is interacting and call willBeginInputSession unconditionally. Move FIXME to where we check 15 userIsInteracting. Pass m_userIsInteracting to willBeginInputSession so we can use it there. 16 1 17 2016-04-04 Michael Catanzaro <mcatanzaro@igalia.com> 2 18 -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h
r183038 r199040 45 45 // The return value is exposed in the UI process via the userObject property of the _WKFormInputSession object. 46 46 - (NSObject <NSSecureCoding> *)_webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller willBeginInputSessionForElement:(WKWebProcessPlugInNodeHandle *)node inFrame:(WKWebProcessPlugInFrame *)frame; 47 - (NSObject <NSSecureCoding> *)_webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller willBeginInputSessionForElement:(WKWebProcessPlugInNodeHandle *)node inFrame:(WKWebProcessPlugInFrame *)frame userIsInteracting:(BOOL)userIsInteracting WK_AVAILABLE(NA, WK_IOS_TBA); 47 48 48 49 - (BOOL)_webProcessPlugInBrowserContextControllerShouldNotifyOnFormChanges:(WKWebProcessPlugInBrowserContextController *)controller; -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm
r197563 r199040 516 516 } 517 517 518 void willBeginInputSession(WebPage*, Element* element, WebFrame* frame, RefPtr<API::Object>& userData) override 519 { 520 auto formDelegate = m_controller->_formDelegate.get(); 521 522 if (![formDelegate respondsToSelector:@selector(_webProcessPlugInBrowserContextController:willBeginInputSessionForElement:inFrame:)]) 523 return; 524 525 NSObject <NSSecureCoding> *userObject = [formDelegate _webProcessPlugInBrowserContextController:m_controller willBeginInputSessionForElement:wrapper(*WebKit::InjectedBundleNodeHandle::getOrCreate(element)) inFrame:wrapper(*frame)]; 526 encodeUserObject(userObject, userData); 518 void willBeginInputSession(WebPage*, Element* element, WebFrame* frame, RefPtr<API::Object>& userData, bool userIsInteracting) override 519 { 520 auto formDelegate = m_controller->_formDelegate.get(); 521 522 if ([formDelegate respondsToSelector:@selector(_webProcessPlugInBrowserContextController:willBeginInputSessionForElement:inFrame:userIsInteracting:)]) { 523 NSObject<NSSecureCoding> *userObject = [formDelegate _webProcessPlugInBrowserContextController:m_controller willBeginInputSessionForElement:wrapper(*WebKit::InjectedBundleNodeHandle::getOrCreate(element)) inFrame:wrapper(*frame) userIsInteracting:userIsInteracting]; 524 encodeUserObject(userObject, userData); 525 } else if (userIsInteracting && [formDelegate respondsToSelector:@selector(_webProcessPlugInBrowserContextController:willBeginInputSessionForElement:inFrame:)]) { 526 // FIXME: We check userIsInteracting so that we don't begin an input session for a 527 // programmatic focus that doesn't cause the keyboard to appear. But this misses the case of 528 // a programmatic focus happening while the keyboard is already shown. Once we have a way to 529 // know the keyboard state in the Web Process, we should refine the condition. 530 NSObject<NSSecureCoding> *userObject = [formDelegate _webProcessPlugInBrowserContextController:m_controller willBeginInputSessionForElement:wrapper(*WebKit::InjectedBundleNodeHandle::getOrCreate(element)) inFrame:wrapper(*frame)]; 531 encodeUserObject(userObject, userData); 532 } 527 533 } 528 534 -
trunk/Source/WebKit2/WebProcess/InjectedBundle/APIInjectedBundleFormClient.h
r167360 r199040 73 73 virtual void didAssociateFormControls(WebKit::WebPage*, const Vector<RefPtr<WebCore::Element>>&) { } 74 74 virtual bool shouldNotifyOnFormChanges(WebKit::WebPage*) { return false; } 75 virtual void willBeginInputSession(WebKit::WebPage*, WebCore::Element*, WebKit::WebFrame*, RefPtr<API::Object>& userData ) { UNUSED_PARAM(userData); }75 virtual void willBeginInputSession(WebKit::WebPage*, WebCore::Element*, WebKit::WebFrame*, RefPtr<API::Object>& userData, bool userIsInteracting) { UNUSED_PARAM(userData); } 76 76 }; 77 77 -
trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
r198929 r199040 2549 2549 RefPtr<API::Object> userData; 2550 2550 2551 // FIXME: We check m_userIsInteracting so that we don't begin an input session for a 2552 // programmatic focus that doesn't cause the keyboard to appear. But this misses the case of 2553 // a programmatic focus happening while the keyboard is already shown. Once we have a way to 2554 // know the keyboard state in the Web Process, we should refine the condition. 2555 if (m_userIsInteracting) 2556 m_formClient->willBeginInputSession(this, downcast<Element>(node), WebFrame::fromCoreFrame(*node->document().frame()), userData); 2551 m_formClient->willBeginInputSession(this, downcast<Element>(node), WebFrame::fromCoreFrame(*node->document().frame()), userData, m_userIsInteracting); 2557 2552 2558 2553 send(Messages::WebPageProxy::StartAssistingNode(information, m_userIsInteracting, m_hasPendingBlurNotification, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
Note:
See TracChangeset
for help on using the changeset viewer.