WebKit Bugzilla
Attachment 338770 Details for
Bug 184975
: [Extra zoom mode] The search field on www.bing.com is missing label text
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-184975-20180425124011.patch (text/plain), 16.58 KB, created by
Wenson Hsieh
on 2018-04-25 12:40:12 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2018-04-25 12:40:12 PDT
Size:
16.58 KB
patch
obsolete
>Subversion Revision: 230986 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index c987370d00112451afeedd89d14836dfad7020d1..cece91abddff3e44409de7199d7c5309876cee03 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,29 @@ >+2018-04-25 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [Extra zoom mode] The search field on www.bing.com is missing label text >+ https://bugs.webkit.org/show_bug.cgi?id=184975 >+ <rdar://problem/39723081> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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): >+ > 2018-04-24 Wenson Hsieh <wenson_hsieh@apple.com> > > Fix entitlements and sandbox configurations in WebKit after r230778 >diff --git a/Source/WebKit/Shared/AssistedNodeInformation.cpp b/Source/WebKit/Shared/AssistedNodeInformation.cpp >index c7cb31af3e42b96a64ce2a4da735f67fa6ca81e3..68e19483e670d78ab2c6fe45b8b7af85d97cf34d 100644 >--- a/Source/WebKit/Shared/AssistedNodeInformation.cpp >+++ b/Source/WebKit/Shared/AssistedNodeInformation.cpp >@@ -93,6 +93,7 @@ void AssistedNodeInformation::encode(IPC::Encoder& encoder) const > encoder.encodeEnum(autofillFieldName); > encoder << placeholder; > encoder << label; >+ encoder << ariaLabel; > encoder << assistedNodeIdentifier; > } > >@@ -188,6 +189,9 @@ bool AssistedNodeInformation::decode(IPC::Decoder& decoder, AssistedNodeInformat > if (!decoder.decode(result.label)) > return false; > >+ if (!decoder.decode(result.ariaLabel)) >+ return false; >+ > if (!decoder.decode(result.assistedNodeIdentifier)) > return false; > >diff --git a/Source/WebKit/Shared/AssistedNodeInformation.h b/Source/WebKit/Shared/AssistedNodeInformation.h >index a6124fd00f16373eaacdc680f211e59d56648dfb..bcc46fb3808525d4cee4bccc8abcb8f91d0cfc5c 100644 >--- a/Source/WebKit/Shared/AssistedNodeInformation.h >+++ b/Source/WebKit/Shared/AssistedNodeInformation.h >@@ -117,6 +117,7 @@ struct AssistedNodeInformation { > WebCore::AutofillFieldName autofillFieldName { WebCore::AutofillFieldName::None }; > String placeholder; > String label; >+ String ariaLabel; > > uint64_t assistedNodeIdentifier { 0 }; > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm b/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >index de12e5aaf36e8b223362dcdc873184ad5b331703..317789ef126e3dbec8902cb3d067bfdc92893593 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >@@ -5914,6 +5914,11 @@ - (NSString *)selectFormPopoverTitle > return [_contentView selectFormPopoverTitle]; > } > >+- (NSString *)formInputLabel >+{ >+ return [_contentView formInputLabel]; >+} >+ > - (void)didStartFormControlInteraction > { > // For subclasses to override. >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h b/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h >index cf1fca8aa1c5268c1e118aef9532197e4c2e72ac..8f293f8372099e21f131690ea7362f4f2fa13410 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h >@@ -382,6 +382,7 @@ typedef NS_OPTIONS(NSUInteger, _WKRectEdge) { > - (void)dismissFormAccessoryView WK_API_AVAILABLE(ios(10.3)); > - (void)selectFormAccessoryPickerRow:(int)rowIndex WK_API_AVAILABLE(ios(10.3)); > @property (nonatomic, readonly) NSString *selectFormPopoverTitle WK_API_AVAILABLE(ios(WK_IOS_TBA)); >+@property (nonatomic, readonly) NSString *formInputLabel WK_API_AVAILABLE(ios(WK_IOS_TBA)); > - (void)setTimePickerValueToHour:(NSInteger)hour minute:(NSInteger)minute WK_API_AVAILABLE(ios(WK_IOS_TBA)); > > - (void)applyAutocorrection:(NSString *)newString toString:(NSString *)oldString withCompletionHandler:(void (^)(void))completionHandler WK_API_AVAILABLE(ios(11.0)); >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h >index 787f6b2b85d930140770f14c2244711881e20f2b..3f4ee967dd8edb6f04e931e74173b0a3823a8481 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h >@@ -365,6 +365,7 @@ FOR_EACH_WKCONTENTVIEW_ACTION(DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW) > - (NSDictionary *)_contentsOfUserInterfaceItem:(NSString *)userInterfaceItem; > > @property (nonatomic, readonly) NSString *selectFormPopoverTitle; >+@property (nonatomic, readonly) NSString *formInputLabel; > > @end > >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index 1b83610c59425b549551011af5eaad0183947b79..bb2e3642f54707ddb451dd301362092e1499bf7f 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -5518,6 +5518,15 @@ - (NSString *)selectFormPopoverTitle > return [(WKFormSelectControl *)_inputPeripheral selectFormPopoverTitle]; > } > >+- (NSString *)formInputLabel >+{ >+#if ENABLE(EXTRA_ZOOM_MODE) >+ if (_presentedFullScreenInputViewController) >+ return [self inputLabelTextForViewController:(id)_presentedFullScreenInputViewController.get()]; >+#endif >+ return nil; >+} >+ > - (void)setTimePickerValueToHour:(NSInteger)hour minute:(NSInteger)minute > { > #if ENABLE(EXTRA_ZOOM_MODE) >diff --git a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >index 9f7f49f175202fe36f6d05dffb7d9183c68bf721..5ced48b0b3f25620e7e0f703067d5da6b5e57926 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >@@ -2345,8 +2345,11 @@ void WebPage::getAssistedNodeInformation(AssistedNodeInformation& information) > } > } > >- if (is<HTMLElement>(m_assistedNode.get())) >- information.title = downcast<HTMLElement>(*m_assistedNode).title(); >+ if (is<Element>(m_assistedNode.get())) { >+ auto& element = downcast<Element>(*m_assistedNode); >+ information.title = element.title(); >+ information.ariaLabel = element.attributeWithoutSynchronization(HTMLNames::aria_labelAttr); >+ } > > if (is<HTMLSelectElement>(*m_assistedNode)) { > HTMLSelectElement& element = downcast<HTMLSelectElement>(*m_assistedNode); >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index f78f818fedd64a32e7a221d20536ee459b7d64cc..aa776a4f3dac96f90b8bf85c9f2713e2c1ad5267 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,23 @@ >+2018-04-25 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [Extra zoom mode] The search field on www.bing.com is missing label text >+ https://bugs.webkit.org/show_bug.cgi?id=184975 >+ <rdar://problem/39723081> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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): >+ > 2018-04-24 Pablo Saavedra <psaavedra@igalia.com> > > [GTK][WPE] Fix triggered bot name on the WPE Debug Build bot >diff --git a/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm b/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm >index b5a33370ecf443fce46bbcfd06156eb235c1bd6c..72797b70e901ee7b89c0bae60c49081921eca28b 100644 >--- a/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm >+++ b/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm >@@ -171,6 +171,11 @@ JSRetainPtr<JSStringRef> UIScriptController::selectFormPopoverTitle() const > { > return nullptr; > } >+ >+JSRetainPtr<JSStringRef> UIScriptController::formInputLabel() const >+{ >+ return nullptr; >+} > > JSObjectRef UIScriptController::contentsOfUserInterfaceItem(JSStringRef interfaceItem) const > { >diff --git a/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl b/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl >index 37737a47d1b7b136f0a06d1b7d2e12819a48c14c..23f2ba6a48f0f9c1708e25b4d624d67281602be8 100644 >--- a/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl >+++ b/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl >@@ -189,6 +189,7 @@ interface UIScriptController { > // <select> picker > void selectFormAccessoryPickerRow(long rowIndex); > readonly attribute DOMString selectFormPopoverTitle; >+ readonly attribute DOMString formInputLabel; > > void setTimePickerValue(long hour, long minute); > >diff --git a/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp b/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp >index 2b4b49367e905d3753e600fb929e040f4d1c777e..619286ae1236994bff097868ef84fc8a499a1417 100644 >--- a/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp >+++ b/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp >@@ -311,6 +311,11 @@ JSRetainPtr<JSStringRef> UIScriptController::selectFormPopoverTitle() const > return nullptr; > } > >+JSRetainPtr<JSStringRef> UIScriptController::formInputLabel() const >+{ >+ return nullptr; >+} >+ > void UIScriptController::scrollToOffset(long x, long y) > { > } >diff --git a/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h b/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h >index fd6ca9302d6e2c8f91c140558064506925466089..d3a1d18c1889816551f4e36f0c0ec1ed9e014dd1 100644 >--- a/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h >+++ b/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h >@@ -99,6 +99,7 @@ public: > void dismissFormAccessoryView(); > void selectFormAccessoryPickerRow(long); > JSRetainPtr<JSStringRef> selectFormPopoverTitle() const; >+ JSRetainPtr<JSStringRef> formInputLabel() const; > void setTimePickerValue(long hour, long minute); > > JSObjectRef contentsOfUserInterfaceItem(JSStringRef) const; >diff --git a/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm b/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm >index 27f391fae2431f2dff13d4c91420662137c63345..a7c739af9b1aed9e62ab0c2b40dc57569859cf0d 100644 >--- a/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm >+++ b/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm >@@ -431,6 +431,12 @@ JSRetainPtr<JSStringRef> UIScriptController::selectFormPopoverTitle() const > return JSStringCreateWithCFString((CFStringRef)webView.selectFormPopoverTitle); > } > >+JSRetainPtr<JSStringRef> UIScriptController::formInputLabel() const >+{ >+ TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView(); >+ return JSStringCreateWithCFString((CFStringRef)webView.formInputLabel); >+} >+ > void UIScriptController::selectFormAccessoryPickerRow(long rowIndex) > { > TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView(); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 4625d25ba7da98161ddd4d8ea8008dd8ee39f94b..be9825b87cd5ddf42949a3c8923790f4d0f49521 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,21 @@ >+2018-04-25 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [Extra zoom mode] The search field on www.bing.com is missing label text >+ https://bugs.webkit.org/show_bug.cgi?id=184975 >+ <rdar://problem/39723081> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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): >+ > 2018-04-24 Simon Fraser <simon.fraser@apple.com> > > Add a new "color-filter" CSS property as an experimental feature >diff --git a/LayoutTests/fast/forms/extrazoom/form-control-label-text-expected.txt b/LayoutTests/fast/forms/extrazoom/form-control-label-text-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..25240d3db966f287370badc86cb9ea5bfaa31474 >--- /dev/null >+++ b/LayoutTests/fast/forms/extrazoom/form-control-label-text-expected.txt >@@ -0,0 +1,9 @@ >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+test label 4 >+Label text should be missing: "" >+Label text should use the placeholder: "test label 1" >+Label text should use the title: "test label 2" >+Label text should use the accessibility label: "test label 3" >+Label text should use the associated label: "test label 4" >diff --git a/LayoutTests/fast/forms/extrazoom/form-control-label-text.html b/LayoutTests/fast/forms/extrazoom/form-control-label-text.html >new file mode 100644 >index 0000000000000000000000000000000000000000..c97b0d572ecd270d4b79a30aa91941ee9c49072c >--- /dev/null >+++ b/LayoutTests/fast/forms/extrazoom/form-control-label-text.html >@@ -0,0 +1,55 @@ >+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] --> >+<html> >+<meta name="viewport" content="width=device-width"> >+<head> >+<script src="../../../resources/js-test.js"></script> >+<script src="../../../resources/ui-helper.js"></script> >+<script> >+doneCount = 0; >+jsTestIsAsync = true; >+ >+function getLabelTextAfterFocusingInput() { >+ return new Promise(async (resolve) => { >+ await UIHelper.activateAndWaitForInputSessionAt(75, 75); >+ const labelText = await UIHelper.formInputLabel(); >+ field.blur(); >+ await UIHelper.waitForKeyboardToHide(); >+ resolve(labelText); >+ }); >+} >+ >+async function runTest() { >+ if (!window.testRunner) { >+ description(`This test requires WebKitTestRunner.`); >+ return; >+ } >+ >+ missingLabel.textContent = await getLabelTextAfterFocusingInput(); >+ >+ field.setAttribute("placeholder", "test label 1"); >+ labelFromPlaceholder.textContent = await getLabelTextAfterFocusingInput(); >+ >+ field.setAttribute("title", "test label 2"); >+ labelFromTitle.textContent = await getLabelTextAfterFocusingInput(); >+ >+ field.setAttribute("aria-label", "test label 3"); >+ labelFromAriaLabel.textContent = await getLabelTextAfterFocusingInput(); >+ >+ label.setAttribute("for", "field"); >+ labelFromLabelElement.textContent = await getLabelTextAfterFocusingInput(); >+ >+ finishJSTest(); >+} >+</script> >+</head> >+ >+<body onload="runTest()"> >+<input id="field" style="width: 320px; height: 568px;"></input> >+<label id="label">test label 4</label> >+<div>Label text should be missing: "<code id="missingLabel"></code>"</div> >+<div>Label text should use the placeholder: "<code id="labelFromPlaceholder"></code>"</div> >+<div>Label text should use the title: "<code id="labelFromTitle"></code>"</div> >+<div>Label text should use the accessibility label: "<code id="labelFromAriaLabel"></code>"</div> >+<div>Label text should use the associated label: "<code id="labelFromLabelElement"></code>"</div> >+</body> >+</html> >\ No newline at end of file >diff --git a/LayoutTests/resources/ui-helper.js b/LayoutTests/resources/ui-helper.js >index 3be7d7297fb52ec84fbb16208c6271682136f80a..44635679e7938e695d5df1777c55a3f1f433df50 100644 >--- a/LayoutTests/resources/ui-helper.js >+++ b/LayoutTests/resources/ui-helper.js >@@ -199,4 +199,13 @@ window.UIHelper = class UIHelper { > const setValueScript = `(() => uiController.setTimePickerValue(${hours}, ${minutes}))()`; > return new Promise(resolve => testRunner.runUIScript(setValueScript, resolve)); > } >+ >+ static formInputLabel() >+ { >+ return new Promise(resolve => { >+ testRunner.runUIScript(`(() => { >+ uiController.uiScriptComplete(uiController.formInputLabel); >+ })()`, resolve); >+ }); >+ } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
thorton
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 184975
: 338770 |
338786