Changeset 244559 in webkit
- Timestamp:
- Apr 23, 2019, 1:27:24 PM (7 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 11 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/PageClient.h (modified) (2 diffs)
-
UIProcess/WebPageProxy.h (modified) (2 diffs)
-
UIProcess/WebPageProxy.messages.in (modified) (1 diff)
-
UIProcess/ios/PageClientImplIOS.h (modified) (1 diff)
-
UIProcess/ios/PageClientImplIOS.mm (modified) (2 diffs)
-
UIProcess/ios/WKContentViewInteraction.h (modified) (2 diffs)
-
UIProcess/ios/WKContentViewInteraction.mm (modified) (2 diffs)
-
UIProcess/ios/WebPageProxyIOS.mm (modified) (3 diffs)
-
WebProcess/WebPage/WebPage.cpp (modified) (2 diffs)
-
WebProcess/WebPage/WebPage.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r244557 r244559 1 2019-04-23 Per Arne Vollan <pvollan@apple.com> 2 3 [iOS] Input field on ddg.gg is auto focused when url is entered with the software keyboard 4 https://bugs.webkit.org/show_bug.cgi?id=196740 5 6 Reviewed by Megan Gardner. 7 8 When an url for a page with an autofocused input field is entered with the software keyboard, 9 the input field is auto selected, and the software keyboard reappears. This does not happen 10 when picking the url from favorites. After using the software keyboard to enter the url, the 11 activity state is being changed to focused. The method '_elementDidFocus' checks whether the 12 activity state changed, and allows the software keyboard to be shown in this case. To avoid 13 showing the software keyboard in this case, send the changing activity state bitfield to the 14 UI process, and check if the focus flag is the only flag set. 15 16 * UIProcess/ios/WKContentViewInteraction.mm: 17 (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): 18 1 19 2019-04-23 Guy Lewin <guy@lewin.co.il> 2 20 -
trunk/Source/WebKit/UIProcess/PageClient.h
r244225 r244559 32 32 #include "WebDataListSuggestionsDropdown.h" 33 33 #include "WebPopupMenuProxy.h" 34 #include <WebCore/ActivityState.h> 34 35 #include <WebCore/AlternativeTextClient.h> 35 36 #include <WebCore/DragActions.h> … … 383 384 virtual void restorePageCenterAndScale(Optional<WebCore::FloatPoint> center, double scale) = 0; 384 385 385 virtual void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, API::Object* userData) = 0;386 virtual void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges, API::Object* userData) = 0; 386 387 virtual void elementDidBlur() = 0; 387 388 virtual void focusedElementDidChangeInputMode(WebCore::InputMode) = 0; -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r244540 r244559 348 348 bool userIsInteracting; 349 349 bool blurPreviousNode; 350 bool changingActivityState;350 OptionSet<WebCore::ActivityState::Flag> activityStateChanges; 351 351 RefPtr<API::Object> userData; 352 352 }; … … 1908 1908 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, bool nodeHasBuiltInClickHandling); 1909 1909 1910 void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, const UserData&);1910 void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges, const UserData&); 1911 1911 void elementDidBlur(); 1912 1912 void focusedElementDidChangeInputMode(WebCore::InputMode); -
trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in
r244540 r244559 405 405 DidGetTapHighlightGeometries(uint64_t requestID, WebCore::Color color, Vector<WebCore::FloatQuad> geometries, WebCore::IntSize topLeftRadius, WebCore::IntSize topRightRadius, WebCore::IntSize bottomLeftRadius, WebCore::IntSize bottomRightRadius, bool nodeHasBuiltInClickHandling) 406 406 407 ElementDidFocus(struct WebKit::FocusedElementInformation information, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, WebKit::UserData userData)407 ElementDidFocus(struct WebKit::FocusedElementInformation information, bool userIsInteracting, bool blurPreviousNode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges, WebKit::UserData userData) 408 408 ElementDidBlur() 409 409 FocusedElementDidChangeInputMode(enum:uint8_t WebCore::InputMode mode) -
trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h
r244085 r244559 150 150 void restorePageCenterAndScale(Optional<WebCore::FloatPoint>, double) override; 151 151 152 void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, API::Object* userData) override;152 void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges, API::Object* userData) override; 153 153 void elementDidBlur() override; 154 154 void focusedElementDidChangeInputMode(WebCore::InputMode) override; -
trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
r244553 r244559 536 536 } 537 537 538 void PageClientImpl::elementDidFocus(const FocusedElementInformation& nodeInformation, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, API::Object* userData)538 void PageClientImpl::elementDidFocus(const FocusedElementInformation& nodeInformation, bool userIsInteracting, bool blurPreviousNode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges, API::Object* userData) 539 539 { 540 540 MESSAGE_CHECK(!userData || userData->type() == API::Object::Type::Data); … … 551 551 } 552 552 553 [m_contentView _elementDidFocus:nodeInformation userIsInteracting:userIsInteracting blurPreviousNode:blurPreviousNode changingActivityState:changingActivityStateuserObject:userObject];553 [m_contentView _elementDidFocus:nodeInformation userIsInteracting:userIsInteracting blurPreviousNode:blurPreviousNode activityStateChanges:activityStateChanges userObject:userObject]; 554 554 } 555 555 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
r244555 r244559 48 48 #import "_WKFormInputSession.h" 49 49 #import <UIKit/UIView.h> 50 #import <WebCore/ActivityState.h> 50 51 #import <WebCore/Color.h> 51 52 #import <WebCore/FloatQuad.h> … … 425 426 - (void)_disableDoubleTapGesturesDuringTapIfNecessary:(uint64_t)requestID; 426 427 - (void)_handleSmartMagnificationInformationForPotentialTap:(uint64_t)requestID renderRect:(const WebCore::FloatRect&)renderRect fitEntireRect:(BOOL)fitEntireRect viewportMinimumScale:(double)viewportMinimumScale viewportMaximumScale:(double)viewportMaximumScale; 427 - (void)_elementDidFocus:(const WebKit::FocusedElementInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode changingActivityState:(BOOL)changingActivityStateuserObject:(NSObject <NSSecureCoding> *)userObject;428 - (void)_elementDidFocus:(const WebKit::FocusedElementInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode activityStateChanges:(OptionSet<WebCore::ActivityState::Flag>)activityStateChanges userObject:(NSObject <NSSecureCoding> *)userObject; 428 429 - (void)_elementDidBlur; 429 430 - (void)_didUpdateInputMode:(WebCore::InputMode)mode; -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r244555 r244559 4947 4947 } 4948 4948 4949 - (void)_elementDidFocus:(const WebKit::FocusedElementInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode changingActivityState:(BOOL)changingActivityStateuserObject:(NSObject <NSSecureCoding> *)userObject4949 - (void)_elementDidFocus:(const WebKit::FocusedElementInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode activityStateChanges:(OptionSet<WebCore::ActivityState::Flag>)activityStateChanges userObject:(NSObject <NSSecureCoding> *)userObject 4950 4950 { 4951 4951 SetForScope<BOOL> isChangingFocusForScope { _isChangingFocus, hasFocusedElement(_focusedElementInformation) }; … … 4983 4983 4984 4984 if (self.isFirstResponder || _becomingFirstResponder) { 4985 if (changingActivityState) 4985 // When the software keyboard is being used to enter an url, only the focus activity state is changing. 4986 // In this case, auto focus on the page being navigated to should be disabled, unless a hardware 4987 // keyboard is attached. 4988 if (activityStateChanges && activityStateChanges != WebCore::ActivityState::IsFocused) 4986 4989 return YES; 4987 4990 -
trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
r244239 r244559 409 409 410 410 if (auto arguments = std::exchange(m_deferredElementDidFocusArguments, nullptr)) 411 pageClient().elementDidFocus(arguments->information, arguments->userIsInteracting, arguments->blurPreviousNode, arguments-> changingActivityState, arguments->userData.get());411 pageClient().elementDidFocus(arguments->information, arguments->userIsInteracting, arguments->blurPreviousNode, arguments->activityStateChanges, arguments->userData.get()); 412 412 } 413 413 … … 928 928 } 929 929 930 void WebPageProxy::elementDidFocus(const FocusedElementInformation& information, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, const UserData& userData)930 void WebPageProxy::elementDidFocus(const FocusedElementInformation& information, bool userIsInteracting, bool blurPreviousNode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges, const UserData& userData) 931 931 { 932 932 m_waitingForPostLayoutEditorStateUpdateAfterFocusingElement = true; … … 935 935 if (m_editorState.isMissingPostLayoutData) { 936 936 // FIXME: We should try to eliminate m_deferredElementDidFocusArguments altogether, in favor of only deferring actions that are dependent on post-layout editor state information. 937 m_deferredElementDidFocusArguments = std::make_unique<ElementDidFocusArguments>(ElementDidFocusArguments { information, userIsInteracting, blurPreviousNode, changingActivityState, userDataObject });938 return; 939 } 940 941 pageClient().elementDidFocus(information, userIsInteracting, blurPreviousNode, changingActivityState, userDataObject);937 m_deferredElementDidFocusArguments = std::make_unique<ElementDidFocusArguments>(ElementDidFocusArguments { information, userIsInteracting, blurPreviousNode, activityStateChanges, userDataObject }); 938 return; 939 } 940 941 pageClient().elementDidFocus(information, userIsInteracting, blurPreviousNode, activityStateChanges, userDataObject); 942 942 } 943 943 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r244494 r244559 3131 3131 ASSERT_WITH_MESSAGE(m_page, "setActivityState called on %" PRIu64 " but WebCore page was null", pageID()); 3132 3132 if (m_page) { 3133 SetForScope< bool> currentlyChangingActivityState { m_changingActivityState, true};3133 SetForScope<OptionSet<ActivityState::Flag>> currentlyChangingActivityState { m_lastActivityStateChanges, changed }; 3134 3134 m_page->setActivityState(activityState); 3135 3135 } … … 5407 5407 m_formClient->willBeginInputSession(this, &element, WebFrame::fromCoreFrame(*element.document().frame()), m_userIsInteracting, userData); 5408 5408 5409 send(Messages::WebPageProxy::ElementDidFocus(information, m_userIsInteracting, m_recentlyBlurredElement, m_ changingActivityState, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));5409 send(Messages::WebPageProxy::ElementDidFocus(information, m_userIsInteracting, m_recentlyBlurredElement, m_lastActivityStateChanges, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get()))); 5410 5410 #elif PLATFORM(MAC) 5411 5411 // FIXME: This can be unified with the iOS code above by bringing ElementDidFocus to macOS. -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r244494 r244559 1758 1758 bool m_isTouchBarUpdateSupressedForHiddenContentEditable { false }; 1759 1759 bool m_isNeverRichlyEditableForTouchBar { false }; 1760 bool m_changingActivityState { false };1760 OptionSet<WebCore::ActivityState::Flag> m_lastActivityStateChanges; 1761 1761 1762 1762 #if ENABLE(CONTEXT_MENUS)
Note:
See TracChangeset
for help on using the changeset viewer.