Changeset 188405 in webkit
- Timestamp:
- Aug 13, 2015 2:48:50 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r188342 r188405 1 2015-08-13 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 A focused node should not be assisted when handling touch events synchronously 4 https://bugs.webkit.org/show_bug.cgi?id=147836 5 6 Reviewed by Enrica Casucci. 7 8 Added manual tests for keyboard assistance behavior due to receiving touch events on iOS. 9 10 * ManualTests/ios/focused-input-should-assist-on-touch.html: Checks that a currently focused 11 input can still be assisted due to a touch event. 12 * ManualTests/ios/keyboard-should-not-show-on-touch-event.html: Checks that handling a touch 13 event does not automatically cause us to assist the currently focused node. 14 1 15 2015-08-12 Alex Christensen <achristensen@webkit.org> 2 16 -
trunk/Source/WebCore/ChangeLog
r188402 r188405 1 2015-08-13 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 A focused node should not be assisted when handling touch events synchronously 4 https://bugs.webkit.org/show_bug.cgi?id=147836 5 <rdar://problem/22204108> 6 7 Reviewed by Enrica Casucci. 8 9 Makes interaction with touch handlers no longer assist the currently focused element in the 10 general case. Added plumbing to reassist a currently focused node when dispatching touch events, 11 so that an input that programmatically focuses itself and prevents default on a touch event will 12 be properly assisted when it has been programmatically focused (either through Javascript or the 13 autofocus attribute) prior to receiving the touch event. This patch also removes the now 14 unnecessary special-casing of the Gmail settings app that currently makes the keyboard deploy 15 upon autofocus. 16 17 * dom/Element.cpp: 18 (WebCore::Element::focus): Notifies the chrome client that the element has refocused before 19 returning early. 20 * page/ChromeClient.h: Refocusing an element does nothing by default. 21 * platform/RuntimeApplicationChecksIOS.h: Removed special casing for Gmail Add Account. 22 * platform/RuntimeApplicationChecksIOS.mm: See above. 23 (WebCore::applicationIsGmailAddAccountOnIOS): See above. 24 1 25 2015-08-13 Brent Fulgham <bfulgham@apple.com> 2 26 -
trunk/Source/WebCore/dom/Element.cpp
r186398 r188405 2118 2118 return; 2119 2119 2120 if (document().focusedElement() == this) 2121 return; 2120 if (document().focusedElement() == this) { 2121 if (document().page()) 2122 document().page()->chrome().client().elementDidRefocus(this); 2123 2124 return; 2125 } 2122 2126 2123 2127 // If the stylesheets have already been loaded we can reliably check isFocusable. -
trunk/Source/WebCore/page/ChromeClient.h
r188121 r188405 282 282 virtual void elementDidFocus(const Node*) { }; 283 283 virtual void elementDidBlur(const Node*) { }; 284 virtual void elementDidRefocus(const Node*) { }; 284 285 285 286 virtual bool shouldPaintEntireContents() const { return false; } -
trunk/Source/WebCore/platform/RuntimeApplicationChecksIOS.h
r188162 r188405 44 44 bool applicationIsWebProcess(); 45 45 bool applicationIsIBooksOnIOS(); 46 WEBCORE_EXPORT bool applicationIsGmailAddAccountOnIOS();47 46 48 47 } // namespace WebCore -
trunk/Source/WebCore/platform/RuntimeApplicationChecksIOS.mm
r188162 r188405 123 123 } 124 124 125 bool applicationIsGmailAddAccountOnIOS()126 {127 static const bool isGmailAddAccountOnIOS = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.social.SLGoogleAuth.SLGoogleAuthService"];128 return isGmailAddAccountOnIOS;129 }130 131 125 } // namespace WebCore 132 126 -
trunk/Source/WebKit2/ChangeLog
r188404 r188405 1 2015-08-13 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 A focused node should not be assisted when handling touch events synchronously 4 https://bugs.webkit.org/show_bug.cgi?id=147836 5 <rdar://problem/22204108> 6 7 Reviewed by Enrica Casucci. 8 9 Makes interaction with touch handlers no longer assist the currently focused element in the 10 general case. Added plumbing to reassist a currently focused node when dispatching touch events, 11 so that an input that programmatically focuses itself and prevents default on a touch event will 12 be properly assisted when it has been programmatically focused (either through Javascript or the 13 autofocus attribute) prior to receiving the touch event. This patch also removes the now 14 unnecessary special-casing of the Gmail settings app that currently makes the keyboard deploy 15 upon autofocus. 16 17 * UIProcess/ios/WKContentViewInteraction.mm: 18 (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): Removed 19 special case to avoid the early return for Gmail Add Account. 20 * WebProcess/WebCoreSupport/WebChromeClient.h: Added a handler for refocusing an element. 21 * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: 22 (WebKit::WebChromeClient::elementDidRefocus): Makes refocusing an element trigger input 23 assistance on iOS. 24 * WebProcess/WebPage/WebPage.cpp: 25 (WebKit::WebPage::dispatchTouchEvent): Removes logic to focus the currently focused element upon 26 receiving a touch event. 27 1 28 2015-08-13 Anders Carlsson <andersca@apple.com> 2 29 -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
r188349 r188405 3013 3013 // FIXME: This is a temporary workaround for <rdar://problem/22126518>. The real fix will involve refactoring 3014 3014 // the way we assist programmatically focused nodes. 3015 if (! applicationIsGmailAddAccountOnIOS() && !userIsInteracting && !_textSelectionAssistant)3015 if (!userIsInteracting && !_textSelectionAssistant) 3016 3016 return; 3017 3017 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
r188121 r188405 244 244 virtual void elementDidFocus(const WebCore::Node*) override; 245 245 virtual void elementDidBlur(const WebCore::Node*) override; 246 virtual void elementDidRefocus(const WebCore::Node*) override; 246 247 #endif 247 248 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm
r185013 r188405 53 53 { 54 54 m_page->elementDidBlur(const_cast<WebCore::Node*>(node)); 55 } 56 57 void WebChromeClient::elementDidRefocus(const WebCore::Node* node) 58 { 59 elementDidFocus(node); 55 60 } 56 61 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r188030 r188405 2191 2191 void WebPage::dispatchTouchEvent(const WebTouchEvent& touchEvent, bool& handled) 2192 2192 { 2193 RefPtr<Frame> oldFocusedFrame = m_page->focusController().focusedFrame();2194 RefPtr<Element> oldFocusedElement = oldFocusedFrame ? oldFocusedFrame->document()->focusedElement() : nullptr;2195 2193 m_userIsInteracting = true; 2196 2194 … … 2198 2196 CurrentEvent currentEvent(touchEvent); 2199 2197 handled = handleTouchEvent(touchEvent, m_page.get()); 2200 2201 RefPtr<Frame> newFocusedFrame = m_page->focusController().focusedFrame();2202 RefPtr<Element> newFocusedElement = newFocusedFrame ? newFocusedFrame->document()->focusedElement() : nullptr;2203 2204 // If the focus has not changed, we need to notify the client anyway, since it might be2205 // necessary to start assisting the node.2206 // If the node has been focused by JavaScript without user interaction, the2207 // keyboard is not on screen.2208 if (newFocusedElement && newFocusedElement == oldFocusedElement)2209 elementDidFocus(newFocusedElement.get());2210 2198 2211 2199 m_userIsInteracting = false;
Note: See TracChangeset
for help on using the changeset viewer.