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

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

Issue 1071483002: Implement aria properties setsize and posinset. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing nits 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
« no previous file with comments | « Source/modules/accessibility/AXObject.h ('k') | Source/web/WebAXObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/accessibility/AXObject.cpp
diff --git a/Source/modules/accessibility/AXObject.cpp b/Source/modules/accessibility/AXObject.cpp
index e05a796356d47388e2b9ba1dfd4e4a83316fcee2..d3089b17fdd557a6f72cd71389ffd3cc69845aff 100644
--- a/Source/modules/accessibility/AXObject.cpp
+++ b/Source/modules/accessibility/AXObject.cpp
@@ -718,6 +718,42 @@ bool AXObject::supportsRangeValue() const
|| isSpinButton();
}
+bool AXObject::supportsSetSizeAndPosInSet() const
+{
+ AXObject* parent = parentObject();
+ if (!parent)
+ return false;
+
+ int role = roleValue();
+ int parentRole = parent->roleValue();
+
+ if ((role == ListBoxOptionRole && parentRole == ListBoxRole)
+ || (role == ListItemRole && parentRole == ListRole)
+ || (role == MenuItemRole && parentRole == MenuRole)
+ || (role == RadioButtonRole && parentRole == RadioGroupRole)
+ || (role == TabRole && parentRole == TabListRole)
+ || (role == TreeItemRole && parentRole == TreeRole))
+ return true;
+
+ return false;
+}
+
+int AXObject::indexInParent() const
+{
+ if (!parentObject())
+ return 0;
+
+ const auto& siblings = parentObject()->children();
+ int childCount = siblings.size();
+
+ for (int index = 0; index < childCount; ++index) {
+ if (siblings[index].get() == this) {
+ return index;
+ }
+ }
+ return 0;
+}
+
void AXObject::ariaTreeRows(AccessibilityChildrenVector& result)
{
for (const auto& child : children()) {
« no previous file with comments | « Source/modules/accessibility/AXObject.h ('k') | Source/web/WebAXObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698