Index: Source/WebCore/html/shadow/DateTimeFieldElement.cpp |
=================================================================== |
--- Source/WebCore/html/shadow/DateTimeFieldElement.cpp (revision 141200) |
+++ Source/WebCore/html/shadow/DateTimeFieldElement.cpp (working copy) |
@@ -50,6 +50,7 @@ |
{ |
// On accessibility, DateTimeFieldElement acts like spin button. |
setAttribute(roleAttr, "spinbutton"); |
+ setAttribute(aria_valuetextAttr, AXDateTimeFieldEmptyValueText()); |
} |
void DateTimeFieldElement::defaultEventHandler(Event* event) |
@@ -206,13 +207,23 @@ |
return; |
textNode->replaceWholeText(newVisibleValue, ASSERT_NO_EXCEPTION); |
- setAttribute(aria_valuetextAttr, hasValue() ? newVisibleValue : AXDateTimeFieldEmptyValueText()); |
- setAttribute(aria_valuenowAttr, newVisibleValue); |
+ if (hasValue()) { |
+ setAttribute(aria_valuetextAttr, newVisibleValue); |
+ setAttribute(aria_valuenowAttr, String::number(valueForARIAValueNow())); |
+ } else { |
+ setAttribute(aria_valuetextAttr, AXDateTimeFieldEmptyValueText()); |
+ removeAttribute(aria_valuenowAttr); |
+ } |
if (eventBehavior == DispatchEvent && m_fieldOwner) |
m_fieldOwner->fieldValueChanged(); |
} |
+int DateTimeFieldElement::valueForARIAValueNow() const |
+{ |
+ return valueAsInteger(); |
+} |
+ |
} // namespace WebCore |
#endif |