Changeset 167774 in webkit
- Timestamp:
- Apr 24, 2014, 2:44:42 PM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r167768 r167774 1 2014-04-24 Enrica Casucci <enrica@apple.com> 2 3 [iOS WebKit2] Should properly handle focus redirect (keyboard state changes when focus changes). 4 https://bugs.webkit.org/show_bug.cgi?id=132136 5 <rdar://problem/16238336> 6 7 Reviewed by Benjamin Poulain. 8 9 Focusing a field from JavaScript should not make the keyboard or the select picker 10 appear unless the user has already started interacting with one of the fields in the page. 11 Adding a parameter to StartAssistingNode to indicate whether the focus change is a result 12 of a user action. 13 14 * UIProcess/PageClient.h: 15 * UIProcess/WebPageProxy.h: 16 * UIProcess/WebPageProxy.messages.in: 17 * UIProcess/ios/PageClientImplIOS.h: 18 * UIProcess/ios/PageClientImplIOS.mm: 19 (WebKit::PageClientImpl::startAssistingNode): 20 * UIProcess/ios/WKContentViewInteraction.h: 21 * UIProcess/ios/WKContentViewInteraction.mm: 22 (-[WKContentView _startAssistingNode:userIsInteracting:userObject:]): 23 * UIProcess/ios/WebPageProxyIOS.mm: 24 (WebKit::WebPageProxy::startAssistingNode): 25 * WebProcess/WebPage/WebPage.cpp: 26 (WebKit::WebPage::WebPage): 27 (WebKit::WebPage::dispatchTouchEvent): 28 * WebProcess/WebPage/WebPage.h: 29 * WebProcess/WebPage/ios/WebPageIOS.mm: 30 (WebKit::WebPage::handleTap): 31 (WebKit::WebPage::elementDidFocus): 32 1 33 2014-04-24 Myles C. Maxfield <mmaxfield@apple.com> 2 34 -
trunk/Source/WebKit2/UIProcess/PageClient.h
r167262 r167774 244 244 virtual void dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint& newScrollPosition) = 0; 245 245 246 virtual void startAssistingNode(const AssistedNodeInformation&, API::Object* userData) = 0;246 virtual void startAssistingNode(const AssistedNodeInformation&, bool userIsInteracting, API::Object* userData) = 0; 247 247 virtual void stopAssistingNode() = 0; 248 248 virtual void selectionDidChange() = 0; -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r167742 r167774 1357 1357 void didGetTapHighlightGeometries(uint64_t requestID, const WebCore::Color& color, const Vector<WebCore::FloatQuad>& geometries, const WebCore::IntSize& topLeftRadius, const WebCore::IntSize& topRightRadius, const WebCore::IntSize& bottomLeftRadius, const WebCore::IntSize& bottomRightRadius); 1358 1358 1359 void startAssistingNode(const AssistedNodeInformation&, IPC::MessageDecoder&);1359 void startAssistingNode(const AssistedNodeInformation&, bool userIsInteracting, IPC::MessageDecoder&); 1360 1360 void stopAssistingNode(); 1361 1361 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r167519 r167774 321 321 DidGetTapHighlightGeometries(uint64_t requestID, WebCore::Color color, Vector<WebCore::FloatQuad> geometries, WebCore::IntSize topLeftRadius, WebCore::IntSize topRightRadius, WebCore::IntSize bottomLeftRadius, WebCore::IntSize bottomRightRadius) 322 322 323 StartAssistingNode(WebKit::AssistedNodeInformation information, WebKit::InjectedBundleUserMessageEncoder userData) Variadic323 StartAssistingNode(WebKit::AssistedNodeInformation information, bool userIsInteracting, WebKit::InjectedBundleUserMessageEncoder userData) Variadic 324 324 StopAssistingNode() 325 325 NotifyRevealedSelection() -
trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h
r167262 r167774 110 110 virtual void dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint& newScrollPosition) override; 111 111 112 virtual void startAssistingNode(const AssistedNodeInformation&, API::Object* userData) override;112 virtual void startAssistingNode(const AssistedNodeInformation&, bool userIsInteracting, API::Object* userData) override; 113 113 virtual void stopAssistingNode() override; 114 114 virtual void selectionDidChange() override; -
trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm
r167512 r167774 374 374 } 375 375 376 void PageClientImpl::startAssistingNode(const AssistedNodeInformation& nodeInformation, API::Object* userData)376 void PageClientImpl::startAssistingNode(const AssistedNodeInformation& nodeInformation, bool userIsInteracting, API::Object* userData) 377 377 { 378 378 MESSAGE_CHECK(!userData || userData->type() == API::Object::Type::Data); … … 390 390 } 391 391 392 [m_contentView _startAssistingNode:nodeInformation user Object:userObject];392 [m_contentView _startAssistingNode:nodeInformation userIsInteracting:userIsInteracting userObject:userObject]; 393 393 } 394 394 -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h
r167698 r167774 134 134 - (void)_didGetTapHighlightForRequest:(uint64_t)requestID color:(const WebCore::Color&)color quads:(const Vector<WebCore::FloatQuad>&)highlightedQuads topLeftRadius:(const WebCore::IntSize&)topLeftRadius topRightRadius:(const WebCore::IntSize&)topRightRadius bottomLeftRadius:(const WebCore::IntSize&)bottomLeftRadius bottomRightRadius:(const WebCore::IntSize&)bottomRightRadius; 135 135 136 - (void)_startAssistingNode:(const WebKit::AssistedNodeInformation&)information user Object:(NSObject <NSSecureCoding> *)userObject;136 - (void)_startAssistingNode:(const WebKit::AssistedNodeInformation&)information userIsInteracting:(BOOL)userIsInteracting userObject:(NSObject <NSSecureCoding> *)userObject; 137 137 - (void)_stopAssistingNode; 138 138 - (void)_selectionChanged; -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
r167698 r167774 1980 1980 } 1981 1981 1982 - (void)_startAssistingNode:(const AssistedNodeInformation&)information userObject:(NSObject <NSSecureCoding> *)userObject 1983 { 1982 - (void)_startAssistingNode:(const AssistedNodeInformation&)information userIsInteracting:(BOOL)userIsInteracting userObject:(NSObject <NSSecureCoding> *)userObject 1983 { 1984 if (!userIsInteracting && !_textSelectionAssistant) 1985 return; 1986 1984 1987 _isEditable = YES; 1985 1988 _assistedNodeInformation = information; -
trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm
r167735 r167774 489 489 } 490 490 491 void WebPageProxy::startAssistingNode(const AssistedNodeInformation& information, IPC::MessageDecoder& decoder)491 void WebPageProxy::startAssistingNode(const AssistedNodeInformation& information, bool userIsInteracting, IPC::MessageDecoder& decoder) 492 492 { 493 493 RefPtr<API::Object> userData; … … 496 496 return; 497 497 498 m_pageClient.startAssistingNode(information, user Data.get());498 m_pageClient.startAssistingNode(information, userIsInteracting, userData.get()); 499 499 } 500 500 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r167767 r167774 287 287 , m_scaleWasSetByUIProcess(false) 288 288 , m_userHasChangedPageScaleFactor(false) 289 , m_userIsInteracting(false) 289 290 , m_screenSize(parameters.screenSize) 290 291 , m_availableScreenSize(parameters.availableScreenSize) … … 1956 1957 void WebPage::dispatchTouchEvent(const WebTouchEvent& touchEvent, bool& handled) 1957 1958 { 1959 RefPtr<Frame> oldFocusedFrame = m_page->focusController().focusedFrame(); 1960 RefPtr<Element> oldFocusedElement = oldFocusedFrame ? oldFocusedFrame->document()->focusedElement() : nullptr; 1961 m_userIsInteracting = true; 1962 1958 1963 m_lastInteractionLocation = touchEvent.position(); 1959 1964 CurrentEvent currentEvent(touchEvent); 1960 1965 handled = handleTouchEvent(touchEvent, m_page.get()); 1966 1967 RefPtr<Frame> newFocusedFrame = m_page->focusController().focusedFrame(); 1968 RefPtr<Element> newFocusedElement = newFocusedFrame ? newFocusedFrame->document()->focusedElement() : nullptr; 1969 1970 // If the focus has not changed, we need to notify the client anyway, since it might be 1971 // necessary to start assisting the node. 1972 // If the node has been focused by JavaScript without user interaction, the 1973 // keyboard is not on screen. 1974 if (newFocusedElement && newFocusedElement == oldFocusedElement) 1975 elementDidFocus(newFocusedElement.get()); 1976 1977 m_userIsInteracting = false; 1961 1978 } 1962 1979 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r167742 r167774 1163 1163 bool m_scaleWasSetByUIProcess; 1164 1164 bool m_userHasChangedPageScaleFactor; 1165 bool m_userIsInteracting; 1165 1166 WebCore::FloatSize m_screenSize; 1166 1167 WebCore::FloatSize m_availableScreenSize; -
trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
r167738 r167774 313 313 return; 314 314 315 RefPtr<Frame> oldFocusedFrame = m_page->focusController().focusedFrame(); 316 RefPtr<Element> oldFocusedElement = oldFocusedFrame ? oldFocusedFrame->document()->focusedElement() : nullptr; 317 m_userIsInteracting = true; 318 315 319 m_lastInteractionLocation = roundedAdjustedPoint; 316 320 mainframe.eventHandler().handleMousePressEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MousePressed, 1, false, false, false, false, 0)); 317 321 mainframe.eventHandler().handleMouseReleaseEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MouseReleased, 1, false, false, false, false, 0)); 322 323 RefPtr<Frame> newFocusedFrame = m_page->focusController().focusedFrame(); 324 RefPtr<Element> newFocusedElement = newFocusedFrame ? newFocusedFrame->document()->focusedElement() : nullptr; 325 326 // If the focus has not changed, we need to notify the client anyway, since it might be 327 // necessary to start assisting the node. 328 // If the node has been focused by JavaScript without user interaction, the 329 // keyboard is not on screen. 330 if (newFocusedElement && newFocusedElement == oldFocusedElement) 331 elementDidFocus(newFocusedElement.get()); 332 333 m_userIsInteracting = false; 318 334 } 319 335 … … 1748 1764 RefPtr<API::Object> userData; 1749 1765 m_formClient->willBeginInputSession(this, toElement(node), WebFrame::fromCoreFrame(*node->document().frame()), userData); 1750 send(Messages::WebPageProxy::StartAssistingNode(information, InjectedBundleUserMessageEncoder(userData.get())));1766 send(Messages::WebPageProxy::StartAssistingNode(information, m_userIsInteracting, InjectedBundleUserMessageEncoder(userData.get()))); 1751 1767 } 1752 1768 }
Note:
See TracChangeset
for help on using the changeset viewer.