Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add AssistedNodeInformation plumbing for form control placeholder tex…
…t and label text https://bugs.webkit.org/show_bug.cgi?id=183802 <rdar://problem/38686273> Reviewed by Tim Horton. Source/WebKit: Surfaces some additional information about the currently focused element to the input delegate in the UI process. See comments below for more details. Test: WebKit.FocusedElementInfo * Shared/AssistedNodeInformation.cpp: (WebKit::AssistedNodeInformation::encode const): (WebKit::AssistedNodeInformation::decode): * Shared/AssistedNodeInformation.h: Add `placeholder` and `label` to AssistedNodeInformation, which capture the value of the placeholder attribute and the text of the first associated label element for the focused form control. Also add boilerplate encoder/ decoder support for these members. * UIProcess/API/Cocoa/_WKFocusedElementInfo.h: Augment _WKFocusedElementInfo to include placeholder and label. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]): (-[WKFocusedElementInfo label]): (-[WKFocusedElementInfo placeholder]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getAssistedNodeInformation): For input elements and textareas, set the placeholder to the value of the placeholder attribute. For all elements with associated labels, grab the inner text of the first label that is not empty, ignoring all labels that are `display: none` (i.e. not being rendered). Tools: Adds a new API test to exercise new placeholder and label SPI on _WKFocusedFormElement. * TestWebKitAPI/Tests/WebKitCocoa/_WKInputDelegate.mm: (-[InputDelegate _webView:focusShouldStartInputSession:]): (-[InputDelegate shouldStartInputSessionHandler]): (-[InputDelegate setShouldStartInputSessionHandler:]): (TEST): (-[FormSubmissionDelegate webView:startURLSchemeTask:]): Deleted. (-[FormSubmissionDelegate webView:stopURLSchemeTask:]): Deleted. (-[FormSubmissionDelegate _webView:willSubmitFormValues:userObject:submissionHandler:]): Deleted. Canonical link: https://commits.webkit.org/199427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
174 additions
and 3 deletions.
- +37 −0 Source/WebKit/ChangeLog
- +8 −0 Source/WebKit/Shared/AssistedNodeInformation.cpp
- +2 −0 Source/WebKit/Shared/AssistedNodeInformation.h
- +6 −0 Source/WebKit/UIProcess/API/Cocoa/_WKFocusedElementInfo.h
- +15 −0 Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
- +19 −0 Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
- +19 −0 Tools/ChangeLog
- +68 −3 Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKInputDelegate.mm
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters