[Extra zoom mode] Missing label when focusing a <select> with a title attribute but no associated <label>
https://bugs.webkit.org/show_bug.cgi?id=184352
<rdar://problem/
39237683>
Reviewed by Andy Estes.
Source/WebKit:
Currently, AssistedNodeInformation only sends the `title` of input elements to the UI process. This means that
any information requested in the UI process that is dependent on the `title` of the focused element is broken
in the case of select elements. An existing example of this is the title of the table view controller used to
present select menus on iPad.
To fix this, we simply send the `title` of the focused element across, as long as the focused element is an
HTMLElement. This ensures that there's label text when focusing unlabeled select elements with titles in extra
zoom mode, and also fixes a currenly broken codepath where we show the title of the select in the presented view
controller's title.
Test: fast/forms/ios/ipad/select-with-title.html
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView selectFormPopoverTitle]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
Add new testing SPI to fetch the title of the UITableViewController presented for the currently focused select
element.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView selectFormPopoverTitle]):
* UIProcess/ios/forms/WKFormSelectControl.h:
* UIProcess/ios/forms/WKFormSelectControl.mm:
(-[WKFormSelectControl selectFormPopoverTitle]):
* UIProcess/ios/forms/WKFormSelectPopover.h:
* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectPopover initWithView:hasGroups:]):
(-[WKSelectPopover tableViewController]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
Always send the title across if the focused node is an HTMLElement.
(WebKit::WebPage::getAssistedNodeInformation):
Tools:
Add support for UIScriptController::selectFormPopoverTitle, which returns the title of the current select
popover's UITableViewController (for testing purposes).
* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::selectFormPopoverTitle const):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::selectFormPopoverTitle const):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::selectFormPopoverTitle const):
LayoutTests:
Add a new layout test to check that the title of select elements is propagated to the UI process upon focus.
This title is used for several purposes, one of them being the title of select menus in the table view
controller presented when tapping on a select on an iPad, so the test checks that the title of the select is
shown here.
Also moves a select-related helper into UIHelper from basic-gestures.js (since this doesn't involve user gesture
simulation in any way) and also introduces a new UIHelper method for querying the title of the select menu that
is currently being presented.
* fast/forms/ios/ipad/multiple-select-updates-renderer.html:
* fast/forms/ios/ipad/select-with-title-expected.txt: Added.
* fast/forms/ios/ipad/select-with-title.html: Copied from LayoutTests/fast/forms/ios/ipad/multiple-select-updates-renderer.html.
* resources/basic-gestures.js:
* resources/ui-helper.js:
(window.UIHelper.selectFormAccessoryPickerRow):
(window.UIHelper.selectFormPopoverTitle):
(window.UIHelper):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230527
268f45cc-cd09-0410-ab3c-
d52691b4dbfc