Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Unified Diff: Source/WebCore/html/shadow/DateTimeFieldElement.cpp

Issue 12086056: Merge 140803 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « Source/WebCore/html/shadow/DateTimeFieldElement.h ('k') | Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698