[Extra zoom mode] The search field on www.bing.com is missing label text
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Apr 2018 21:23:27 +0000 (21:23 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Apr 2018 21:23:27 +0000 (21:23 +0000)
commit543edf95b13fcb669eb071c4a033a8f56abc52a0
treee0e4ff6d41c1d08df80cbccd204b6e39f28c5e99
parent380a20c2cf7b27e1756e6b0e6235daf1f03a2d86
[Extra zoom mode] The search field on bing.com is missing label text
https://bugs.webkit.org/show_bug.cgi?id=184975
<rdar://problem/39723081>

Reviewed by Tim Horton.

Source/WebKit:

Adds support for displaying the "aria-label" attribute as the input view's label text in extra zoom mode. Also
adds support for grabbing the input label's text for testing.

Test: fast/forms/extrazoom/form-control-label-text.html

* Shared/AssistedNodeInformation.cpp:
(WebKit::AssistedNodeInformation::encode const):
(WebKit::AssistedNodeInformation::decode):
* Shared/AssistedNodeInformation.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView formInputLabel]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView formInputLabel]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getAssistedNodeInformation):

Tools:

Adds UIScriptController.formInputLabel, which asynchronously requests the input label text for the currently
focused element in extra zoom mode.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::formInputLabel const):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::formInputLabel const):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::formInputLabel const):

LayoutTests:

Adds a layout test to check that the label text of the focused form control in the input view can be sourced
from (1) the "placeholder" attribute, (2) the "title" attribute, (3) the "aria-label" attribute, or (4) an
associated label element.

* fast/forms/extrazoom/form-control-label-text-expected.txt: Added.
* fast/forms/extrazoom/form-control-label-text.html: Added.
* resources/ui-helper.js:
(window.UIHelper.formInputLabel):
(window.UIHelper):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231022 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/forms/extrazoom/form-control-label-text-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/extrazoom/form-control-label-text.html [new file with mode: 0644]
LayoutTests/resources/ui-helper.js
Source/WebKit/ChangeLog
Source/WebKit/Shared/AssistedNodeInformation.cpp
Source/WebKit/Shared/AssistedNodeInformation.h
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
Tools/ChangeLog
Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm
Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl
Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp
Tools/TestRunnerShared/UIScriptContext/UIScriptController.h
Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm