- Revision
- 208159
- Author
- n_w...@apple.com
- Date
- 2016-10-31 10:18:19 -0700 (Mon, 31 Oct 2016)
Log Message
AX: iOS Voiceover does not announce previously selected value from input type="date" form field
https://bugs.webkit.org/show_bug.cgi?id=164176
Reviewed by Chris Fleizach.
Source/WebCore:
Input type date is a popup button on iOS and its value was not exposed in stringValue() since
it's not considered a text control. Instead, the value was exposed in AXTitle. Fixed this by adding
the case in stringValue() and removing the AXTitle exposure.
Changes are covered in modified test.
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::stringValue):
* accessibility/ios/AccessibilityObjectIOS.mm:
(WebCore::AccessibilityObject::isInputTypePopupButton):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityLabel]):
LayoutTests:
* accessibility/ios-simulator/input-type-time-expected.txt:
* accessibility/ios-simulator/input-type-time.html:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (208158 => 208159)
--- trunk/LayoutTests/ChangeLog 2016-10-31 17:16:52 UTC (rev 208158)
+++ trunk/LayoutTests/ChangeLog 2016-10-31 17:18:19 UTC (rev 208159)
@@ -1,3 +1,13 @@
+2016-10-31 Nan Wang <n_w...@apple.com>
+
+ AX: iOS Voiceover does not announce previously selected value from input type="date" form field
+ https://bugs.webkit.org/show_bug.cgi?id=164176
+
+ Reviewed by Chris Fleizach.
+
+ * accessibility/ios-simulator/input-type-time-expected.txt:
+ * accessibility/ios-simulator/input-type-time.html:
+
2016-10-31 Jer Noble <jer.no...@apple.com>
REGRESSION (r206300): LayoutTest media/media-source/media-source-duplicate-seeked.html timing out
Modified: trunk/LayoutTests/accessibility/ios-simulator/input-type-time-expected.txt (208158 => 208159)
--- trunk/LayoutTests/accessibility/ios-simulator/input-type-time-expected.txt 2016-10-31 17:16:52 UTC (rev 208158)
+++ trunk/LayoutTests/accessibility/ios-simulator/input-type-time-expected.txt 2016-10-31 17:18:19 UTC (rev 208159)
@@ -1,4 +1,4 @@
-
+
This tests that input type: time is accessible on iOS.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
@@ -6,6 +6,9 @@
PASS timeinput.description is 'AXLabel: (Between: 07:00 AM-09:00 AM)'
PASS timeinput.isIgnored is false
+PASS timeinput.stringValue is 'AXValue: 8:00 AM'
+PASS timeinput2.description is 'AXLabel: '
+PASS timeinput2.stringValue is 'AXValue: 8:00 AM'
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/accessibility/ios-simulator/input-type-time.html (208158 => 208159)
--- trunk/LayoutTests/accessibility/ios-simulator/input-type-time.html 2016-10-31 17:16:52 UTC (rev 208158)
+++ trunk/LayoutTests/accessibility/ios-simulator/input-type-time.html 2016-10-31 17:18:19 UTC (rev 208159)
@@ -8,7 +8,8 @@
</head>
<body id="body">
-<input id="timeinput" type="time" aria-label="(Between: 07:00 AM-09:00 AM)" min="07:00" max="09:00" step="300" placeholder="00:00 AM">
+<input id="timeinput" type="time" aria-label="(Between: 07:00 AM-09:00 AM)" min="07:00" max="09:00" step="300" placeholder="00:00 AM" value="08:00">
+<input id="timeinput2" type="time" min="07:00" max="09:00" step="300" value="08:00">
<p id="description"></p>
<div id="console"></div>
@@ -20,8 +21,14 @@
if (window.accessibilityController) {
var timeinput = accessibilityController.accessibleElementById("timeinput");
+ var timeinput2 = accessibilityController.accessibleElementById("timeinput2");
shouldBe("timeinput.description", "'AXLabel: (Between: 07:00 AM-09:00 AM)'");
shouldBeFalse("timeinput.isIgnored");
+
+ // Test value is exposed in AXValue.
+ shouldBe("timeinput.stringValue", "'AXValue: 8:00 AM'");
+ shouldBe("timeinput2.description", "'AXLabel: '");
+ shouldBe("timeinput2.stringValue", "'AXValue: 8:00 AM'");
}
successfullyParsed = true;
Modified: trunk/Source/WebCore/ChangeLog (208158 => 208159)
--- trunk/Source/WebCore/ChangeLog 2016-10-31 17:16:52 UTC (rev 208158)
+++ trunk/Source/WebCore/ChangeLog 2016-10-31 17:18:19 UTC (rev 208159)
@@ -1,3 +1,24 @@
+2016-10-31 Nan Wang <n_w...@apple.com>
+
+ AX: iOS Voiceover does not announce previously selected value from input type="date" form field
+ https://bugs.webkit.org/show_bug.cgi?id=164176
+
+ Reviewed by Chris Fleizach.
+
+ Input type date is a popup button on iOS and its value was not exposed in stringValue() since
+ it's not considered a text control. Instead, the value was exposed in AXTitle. Fixed this by adding
+ the case in stringValue() and removing the AXTitle exposure.
+
+ Changes are covered in modified test.
+
+ * accessibility/AccessibilityObject.h:
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::stringValue):
+ * accessibility/ios/AccessibilityObjectIOS.mm:
+ (WebCore::AccessibilityObject::isInputTypePopupButton):
+ * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+ (-[WebAccessibilityObjectWrapper accessibilityLabel]):
+
2016-10-31 Simon Fraser <simon.fra...@apple.com>
Add requestIdleCallback to features.json.
Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (208158 => 208159)
--- trunk/Source/WebCore/accessibility/AccessibilityObject.h 2016-10-31 17:16:52 UTC (rev 208158)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h 2016-10-31 17:18:19 UTC (rev 208159)
@@ -1042,6 +1042,7 @@
#if PLATFORM(IOS)
int accessibilityPasswordFieldLength();
bool hasTouchEventListener() const;
+ bool isInputTypePopupButton() const;
#endif
// allows for an AccessibilityObject to update its render tree or perform
Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (208158 => 208159)
--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2016-10-31 17:16:52 UTC (rev 208158)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2016-10-31 17:18:19 UTC (rev 208159)
@@ -776,6 +776,11 @@
if (isTextControl())
return text();
+#if PLATFORM(IOS)
+ if (isInputTypePopupButton())
+ return textUnderElement();
+#endif
+
if (is<RenderFileUploadControl>(*m_renderer))
return downcast<RenderFileUploadControl>(*m_renderer).fileTextValue();
Modified: trunk/Source/WebCore/accessibility/ios/AccessibilityObjectIOS.mm (208158 => 208159)
--- trunk/Source/WebCore/accessibility/ios/AccessibilityObjectIOS.mm 2016-10-31 17:16:52 UTC (rev 208158)
+++ trunk/Source/WebCore/accessibility/ios/AccessibilityObjectIOS.mm 2016-10-31 17:18:19 UTC (rev 208159)
@@ -90,6 +90,13 @@
}
return false;
}
+
+bool AccessibilityObject::isInputTypePopupButton() const
+{
+ if (is<HTMLInputElement>(node()))
+ return roleValue() == PopUpButtonRole;
+ return false;
+}
} // WebCore
Modified: trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (208158 => 208159)
--- trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm 2016-10-31 17:16:52 UTC (rev 208158)
+++ trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm 2016-10-31 17:18:19 UTC (rev 208159)
@@ -997,6 +997,10 @@
NSString *axTitle = [self baseAccessibilityTitle];
NSString *axDescription = [self baseAccessibilityDescription];
NSString *landmarkDescription = [self ariaLandmarkRoleDescription];
+
+ // We should expose the value of the input type date or time through AXValue instead of AXTitle.
+ if (m_object->isInputTypePopupButton() && [axTitle isEqualToString:[self accessibilityValue]])
+ axTitle = nil;
// Footer is not considered a landmark, but we want the role description.
if (m_object->roleValue() == FooterRole)