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

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp

Issue 1952863003: Implemented the "aria-current" state on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed switch statements to handle NONE case. Created 4 years, 7 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: third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
index e27b54f495c82e0c75f2e48d521be16364cd9e35..4c988b710e099f1903780cc0aa3bc12bf1acc499 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
@@ -1309,6 +1309,33 @@ RGBA32 AXNodeObject::colorValue() const
return color.rgb();
}
+AriaCurrentState AXNodeObject::ariaCurrentState() const
+{
+ if (!hasAttribute(aria_currentAttr))
+ return AXObject::ariaCurrentState();
+
+ const AtomicString& attributeValue = getAttribute(aria_currentAttr);
+ if (attributeValue.isEmpty() || equalIgnoringCase(attributeValue, "false"))
+ return AriaCurrentStateFalse;
+ if (equalIgnoringCase(attributeValue, "true"))
+ return AriaCurrentStateTrue;
+ if (equalIgnoringCase(attributeValue, "page"))
+ return AriaCurrentStatePage;
+ if (equalIgnoringCase(attributeValue, "step"))
+ return AriaCurrentStateStep;
+ if (equalIgnoringCase(attributeValue, "location"))
+ return AriaCurrentStateLocation;
+ if (equalIgnoringCase(attributeValue, "date"))
+ return AriaCurrentStateDate;
+ if (equalIgnoringCase(attributeValue, "time"))
+ return AriaCurrentStateTime;
+ // An unknown value should return true.
+ if (!attributeValue.isEmpty())
+ return AriaCurrentStateTrue;
+
+ return AXObject::ariaCurrentState();
+}
+
InvalidState AXNodeObject::getInvalidState() const
{
if (hasAttribute(aria_invalidAttr)) {
@@ -1336,7 +1363,7 @@ InvalidState AXNodeObject::getInvalidState() const
return isInvalid ? InvalidStateTrue : InvalidStateFalse;
}
- return InvalidStateUndefined;
+ return AXObject::getInvalidState();
}
int AXNodeObject::posInSet() const

Powered by Google App Engine
This is Rietveld 408576698