Commit 05085c43 authored by Nektarios Paisios's avatar Nektarios Paisios Committed by Commit Bot

Fixed AXObject IndexInParent by retrieving the unignored parent since all...

Fixed AXObject IndexInParent by retrieving the unignored parent since all children are unignored by default

R=dmazzoni@chromium.org, aboxhall@chromium.org

Change-Id: Ib8b391fd938eee6dc0b48fc08791dd01f68e7faf
Reviewed-on: https://chromium-review.googlesource.com/956298
Commit-Queue: Nektarios Paisios <nektar@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542627}
parent ca530111
......@@ -1437,7 +1437,7 @@ int AXNodeObject::SetSize() const {
}
int AXNodeObject::AutoPosInSet() const {
AXObject* parent = ParentObject();
AXObject* parent = ParentObjectUnignored();
// Do not continue if the children will need updating soon, because
// the calculation requires all the siblings to remain stable.
......@@ -1445,17 +1445,17 @@ int AXNodeObject::AutoPosInSet() const {
return 0;
int pos_in_set = 1;
auto siblings = parent->Children();
const AXObject::AXObjectVector siblings = parent->Children();
AccessibilityRole role = RoleValue();
int level = HierarchicalLevel();
int index_in_parent = IndexInParent();
for (int index = index_in_parent - 1; index >= 0; index--) {
const auto sibling = siblings[index];
const AXObject* sibling = siblings[index];
AccessibilityRole sibling_role = sibling->RoleValue();
if (sibling_role == kSplitterRole)
break; // Set stops at a separator
if (sibling_role == kSplitterRole || sibling_role == kGroupRole)
break; // Set stops at a separator or an optgroup.
if (sibling_role != role || sibling->AccessibilityIsIgnored())
continue;
......@@ -1473,7 +1473,7 @@ int AXNodeObject::AutoPosInSet() const {
}
int AXNodeObject::AutoSetSize() const {
AXObject* parent = ParentObject();
AXObject* parent = ParentObjectUnignored();
// Do not continue if the children will need updating soon, because
// the calculation requires all the siblings to remain stable.
......@@ -1491,8 +1491,8 @@ int AXNodeObject::AutoSetSize() const {
for (int index = index_in_parent + 1; index < sibling_count; index++) {
const auto sibling = siblings[index];
AccessibilityRole sibling_role = sibling->RoleValue();
if (sibling_role == kSplitterRole)
break; // Set stops at a separator
if (sibling_role == kSplitterRole || sibling_role == kGroupRole)
break; // Set stops at a separator or an optgroup.
if (sibling_role != role || sibling->AccessibilityIsIgnored())
continue;
......
......@@ -1633,10 +1633,10 @@ bool AXObject::SupportsRangeValue() const {
}
int AXObject::IndexInParent() const {
if (!ParentObject())
if (!ParentObjectUnignored())
return 0;
const auto& siblings = ParentObject()->Children();
const auto& siblings = ParentObjectUnignored()->Children();
int child_count = siblings.size();
for (int index = 0; index < child_count; ++index) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment