Changeset 258333 in webkit
- Timestamp:
- Mar 12, 2020, 9:19:20 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/FocusController.cpp (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/ios/UIWKInteractionViewProtocol.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r258330 r258333 1 2020-03-12 Daniel Bates <dabates@apple.com> 2 3 FocusController::setFocusedElement() should tell client of refocused element 4 https://bugs.webkit.org/show_bug.cgi?id=208880 5 6 Reviewed by Wenson Hsieh. 7 8 If the specified new focus element is non-nullptr and is already focused then tell the client 9 that the element was re-focused so that it may update its input state, if needed. On iOS, this 10 lets the UI process evaluate again whether to start an input session (i.e. bring up the keyboard), 11 which may have been disallowed when the element was originally focused (say, it was programmatically 12 focused and there was no hardware keyboard attached). 13 14 * page/FocusController.cpp: 15 (WebCore::FocusController::setFocusedElement): 16 1 17 2020-03-12 Rob Buis <rbuis@igalia.com> 2 18 -
trunk/Source/WebCore/page/FocusController.cpp
r257592 r258333 821 821 822 822 Element* oldFocusedElement = oldDocument ? oldDocument->focusedElement() : nullptr; 823 if (oldFocusedElement == element) 823 if (oldFocusedElement == element) { 824 if (element) 825 m_page.chrome().client().elementDidRefocus(*element); 824 826 return true; 827 } 825 828 826 829 // FIXME: Might want to disable this check for caretBrowsing -
trunk/Tools/ChangeLog
r258328 r258333 1 2020-03-12 Daniel Bates <dabates@apple.com> 2 3 FocusController::setFocusedElement() should tell client of refocused element 4 https://bugs.webkit.org/show_bug.cgi?id=208880 5 6 Reviewed by Wenson Hsieh. 7 8 Adds a test to ensure that calling -selectPositionAtPoint on an already focused element tries 9 to start an input session. Currently, it does not even try. 10 11 * TestWebKitAPI/Tests/ios/UIWKInteractionViewProtocol.mm: 12 (TEST): 13 1 14 2020-03-12 Michael Catanzaro <mcatanzaro@gnome.org> 2 15 -
trunk/Tools/TestWebKitAPI/Tests/ios/UIWKInteractionViewProtocol.mm
r257487 r258333 131 131 } 132 132 133 TEST(UIWKInteractionViewProtocol, SelectPositionAtPointInFocusedElementStartsInputSession) 134 { 135 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 400, 400)]); 136 auto inputDelegate = adoptNS([TestInputDelegate new]); 137 [webView _setInputDelegate:inputDelegate.get()]; 138 139 bool didCallDecidePolicyForFocusedElement = false; 140 [inputDelegate setFocusStartsInputSessionPolicyHandler:[&] (WKWebView *, id <_WKFocusedElementInfo>) -> _WKFocusStartsInputSessionPolicy { 141 didCallDecidePolicyForFocusedElement = true; 142 return _WKFocusStartsInputSessionPolicyDisallow; 143 }]; 144 145 // 1. Focus element 146 [webView synchronouslyLoadHTMLString:@"<body style='margin: 0; padding: 0'><div contenteditable='true' style='height: 200px; width: 200px'></div></body>"]; 147 [webView stringByEvaluatingJavaScript:@"document.querySelector('div').focus()"]; 148 TestWebKitAPI::Util::run(&didCallDecidePolicyForFocusedElement); 149 150 // 2. Focus the element again via selecting a position at a point inside it. 151 didCallDecidePolicyForFocusedElement = false; 152 [webView becomeFirstResponder]; 153 [webView selectPositionAtPoint:CGPointMake(8, 8)]; 154 TestWebKitAPI::Util::run(&didCallDecidePolicyForFocusedElement); 155 } 156 133 157 #endif
Note:
See TracChangeset
for help on using the changeset viewer.