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

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

Issue 1071483002: Implement aria properties setsize and posinset. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Comments incorporated Created 5 years, 8 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/modules/accessibility/AXNodeObject.cpp
diff --git a/Source/modules/accessibility/AXNodeObject.cpp b/Source/modules/accessibility/AXNodeObject.cpp
index a5438ac4ada964ee02f7734e009ef76f7e326b59..e03c80043d0a39cfc11c4deea8c6d6324d9fa2b9 100644
--- a/Source/modules/accessibility/AXNodeObject.cpp
+++ b/Source/modules/accessibility/AXNodeObject.cpp
@@ -1265,6 +1265,30 @@ InvalidState AXNodeObject::invalidState() const
return InvalidStateUndefined;
}
+int AXNodeObject::posInSet() const
+{
+ if (supportsSetSizeAndPosInSet()) {
+ if (hasAttribute(aria_posinsetAttr))
+ return getAttribute(aria_posinsetAttr).toInt();
+ return AXObject::indexInParent();
+ }
+
+ return 0;
+}
+
+int AXNodeObject::setSize() const
+{
+ if (supportsSetSizeAndPosInSet()) {
+ if (hasAttribute(aria_setsizeAttr))
+ return getAttribute(aria_setsizeAttr).toInt();
+
+ const auto& siblings = parentObject()->children();
+ return siblings.size();
+ }
+
+ return 0;
+}
+
String AXNodeObject::ariaInvalidValue() const
{
if (invalidState() == InvalidStateOther)

Powered by Google App Engine
This is Rietveld 408576698