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

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: Addressing Comments 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 c9294b0ff1f2039b98b16582f4c5c83e50ccc39a..4afa9437c5a1d178082ad7ecfcb428b54b85e78a 100644
--- a/Source/modules/accessibility/AXNodeObject.cpp
+++ b/Source/modules/accessibility/AXNodeObject.cpp
@@ -1172,6 +1172,28 @@ InvalidState AXNodeObject::invalidState() const
return InvalidStateUndefined;
}
+int AXNodeObject::posInSet() const
+{
+ if (supportssetSizePosInSet()) {
dmazzoni 2015/04/09 15:15:37 nit: how about supportsSetSizeAndPosInSet
+ if (hasAttribute(aria_posinsetAttr))
+ return getAttribute(aria_posinsetAttr).toInt();
+ return node()->nodeIndex();
shreeramk 2015/04/09 13:50:15 And this to get index? Is this correct API to get
dmazzoni 2015/04/09 15:15:37 Yes
+ }
+
+ return 0;
+}
+
+int AXNodeObject::setSize() const
+{
+ if (supportssetSizePosInSet()) {
+ if (hasAttribute(aria_setsizeAttr))
+ return getAttribute(aria_setsizeAttr).toInt();
+ return node()->parentNode()->countChildren();
shreeramk 2015/04/09 13:50:15 Is this correct API to get the child count of pare
dmazzoni 2015/04/09 15:15:37 Yes, but please check that parentNode() is not nul
+ }
+
+ return 0;
+}
+
String AXNodeObject::ariaInvalidValue() const
{
if (invalidState() == InvalidStateOther)

Powered by Google App Engine
This is Rietveld 408576698