Commit fc4f927b authored by Meredith Lane's avatar Meredith Lane Committed by Commit Bot

Decouples AOM int properties from the accessibility tree

Due to changes in the API, AccessibleNode will no longer be able to
modify the underlying accessibility tree. For more information on the
motivations for this, see:

https://github.com/WICG/aom/blob/gh-pages/explainer.md#what-happened-to-accessiblenode

BUG=746523
https://github.com/WICG/aom/blob/gh-pages/explainer.md

Change-Id: Ia8fd5c6994e97e317a7360739a8a9d0d6d246fa6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1573299Reviewed-by: default avatarAlice Boxhall <aboxhall@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Commit-Queue: Meredith Lane <meredithl@chromium.org>
Cr-Commit-Position: refs/heads/master@{#658979}
parent 26e2dda1
...@@ -466,10 +466,6 @@ uint32_t AccessibleNode::GetPropertyOrARIAAttribute(Element* element, ...@@ -466,10 +466,6 @@ uint32_t AccessibleNode::GetPropertyOrARIAAttribute(Element* element,
if (!element) if (!element)
return 0; return 0;
int32_t result = GetProperty(element, property, is_null);
if (!is_null)
return result;
// Fall back on the equivalent ARIA attribute. // Fall back on the equivalent ARIA attribute.
QualifiedName attribute = GetCorrespondingARIAAttribute(property); QualifiedName attribute = GetCorrespondingARIAAttribute(property);
AtomicString attr_value = element->FastGetAttribute(attribute); AtomicString attr_value = element->FastGetAttribute(attribute);
...@@ -485,10 +481,6 @@ int32_t AccessibleNode::GetPropertyOrARIAAttribute(Element* element, ...@@ -485,10 +481,6 @@ int32_t AccessibleNode::GetPropertyOrARIAAttribute(Element* element,
if (!element) if (!element)
return 0; return 0;
int32_t result = GetProperty(element, property, is_null);
if (!is_null)
return result;
// Fall back on the equivalent ARIA attribute. // Fall back on the equivalent ARIA attribute.
QualifiedName attribute = GetCorrespondingARIAAttribute(property); QualifiedName attribute = GetCorrespondingARIAAttribute(property);
AtomicString attr_value = element->FastGetAttribute(attribute); AtomicString attr_value = element->FastGetAttribute(attribute);
......
...@@ -191,7 +191,7 @@ TEST_F(AccessibilityObjectModelTest, Level) { ...@@ -191,7 +191,7 @@ TEST_F(AccessibilityObjectModelTest, Level) {
auto* cache = AXObjectCache(); auto* cache = AXObjectCache();
ASSERT_NE(nullptr, cache); ASSERT_NE(nullptr, cache);
auto* ax_heading = cache->GetOrCreate(heading); auto* ax_heading = cache->GetOrCreate(heading);
EXPECT_EQ(5, ax_heading->HeadingLevel()); EXPECT_EQ(2, ax_heading->HeadingLevel());
} }
TEST_F(AccessibilityObjectModelTest, ListItem) { TEST_F(AccessibilityObjectModelTest, ListItem) {
...@@ -209,8 +209,8 @@ TEST_F(AccessibilityObjectModelTest, ListItem) { ...@@ -209,8 +209,8 @@ TEST_F(AccessibilityObjectModelTest, ListItem) {
auto* cache = AXObjectCache(); auto* cache = AXObjectCache();
ASSERT_NE(nullptr, cache); ASSERT_NE(nullptr, cache);
auto* ax_listitem = cache->GetOrCreate(listitem); auto* ax_listitem = cache->GetOrCreate(listitem);
EXPECT_EQ(9, ax_listitem->PosInSet()); EXPECT_EQ(0, ax_listitem->PosInSet());
EXPECT_EQ(10, ax_listitem->SetSize()); EXPECT_EQ(0, ax_listitem->SetSize());
} }
TEST_F(AccessibilityObjectModelTest, Grid) { TEST_F(AccessibilityObjectModelTest, Grid) {
...@@ -247,8 +247,8 @@ TEST_F(AccessibilityObjectModelTest, Grid) { ...@@ -247,8 +247,8 @@ TEST_F(AccessibilityObjectModelTest, Grid) {
ASSERT_NE(nullptr, cache); ASSERT_NE(nullptr, cache);
auto* ax_grid = cache->GetOrCreate(grid); auto* ax_grid = cache->GetOrCreate(grid);
EXPECT_EQ(16, ax_grid->AriaColumnCount()); EXPECT_EQ(0, ax_grid->AriaColumnCount());
EXPECT_EQ(9, ax_grid->AriaRowCount()); EXPECT_EQ(0, ax_grid->AriaRowCount());
auto* ax_cell = cache->GetOrCreate(cell); auto* ax_cell = cache->GetOrCreate(cell);
EXPECT_TRUE(ax_cell->IsTableCellLikeRole()); EXPECT_TRUE(ax_cell->IsTableCellLikeRole());
...@@ -257,8 +257,8 @@ TEST_F(AccessibilityObjectModelTest, Grid) { ...@@ -257,8 +257,8 @@ TEST_F(AccessibilityObjectModelTest, Grid) {
auto* ax_cell2 = cache->GetOrCreate(cell2); auto* ax_cell2 = cache->GetOrCreate(cell2);
EXPECT_TRUE(ax_cell2->IsTableCellLikeRole()); EXPECT_TRUE(ax_cell2->IsTableCellLikeRole());
EXPECT_EQ(10U, ax_cell2->AriaColumnIndex()); EXPECT_EQ(0U, ax_cell2->AriaColumnIndex());
EXPECT_EQ(7U, ax_cell2->AriaRowIndex()); EXPECT_EQ(0U, ax_cell2->AriaRowIndex());
} }
class SparseAttributeAdapter : public AXSparseAttributeClient { class SparseAttributeAdapter : public AXSparseAttributeClient {
......
...@@ -25,7 +25,9 @@ test(function(t) { ...@@ -25,7 +25,9 @@ test(function(t) {
node.accessibleNode.level = 3; node.accessibleNode.level = 3;
// For historical reasons intValue returns the heading level. // For historical reasons intValue returns the heading level.
assert_equals(axNode.intValue, 3); // Default heading level for role=heading is 2, AccessibleNode should
// not override this value.
assert_equals(axNode.intValue, 2);
}, "AOM level property"); }, "AOM level property");
</script> </script>
...@@ -39,7 +41,7 @@ test(function(t) { ...@@ -39,7 +41,7 @@ test(function(t) {
var axNode = accessibilityController.accessibleElementById("listitem"); var axNode = accessibilityController.accessibleElementById("listitem");
node.accessibleNode.posInSet = 9; node.accessibleNode.posInSet = 9;
node.accessibleNode.setSize = 10; node.accessibleNode.setSize = 10;
assert_equals(axNode.posInSet, 9); assert_equals(axNode.posInSet, 0);
assert_equals(axNode.setSize, 10); assert_equals(axNode.setSize, 0);
}, "AOM posInSet and setSize"); }, "AOM posInSet and setSize");
</script> </script>
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