Commit 6c93833b authored by Meredith Lane's avatar Meredith Lane Committed by Commit Bot

Decouples AOM float properties from the axtree

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

Change-Id: I1b7b49fb04a62566295620e172e7d51078d6375f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1598897Reviewed-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@{#659309}
parent 21435bcc
......@@ -447,10 +447,6 @@ float AccessibleNode::GetPropertyOrARIAAttribute(Element* element,
if (!element)
return 0.0;
float result = GetProperty(element, property, is_null);
if (!is_null)
return result;
// Fall back on the equivalent ARIA attribute.
QualifiedName attribute = GetCorrespondingARIAAttribute(property);
AtomicString attr_value = element->FastGetAttribute(attribute);
......
......@@ -171,11 +171,11 @@ TEST_F(AccessibilityObjectModelTest, RangeProperties) {
auto* ax_slider = cache->GetOrCreate(slider);
float value = 0.0f;
EXPECT_TRUE(ax_slider->MinValueForRange(&value));
EXPECT_EQ(-0.5f, value);
EXPECT_EQ(0.0f, value);
EXPECT_TRUE(ax_slider->MaxValueForRange(&value));
EXPECT_EQ(0.5f, value);
EXPECT_EQ(100.0f, value);
EXPECT_TRUE(ax_slider->ValueForRange(&value));
EXPECT_EQ(0.1f, value);
EXPECT_EQ(50.0f, value);
}
TEST_F(AccessibilityObjectModelTest, Level) {
......
......@@ -25,7 +25,7 @@ test(function(t) {
assert_equals(axNode.intValue, 5);
assert_equals(node.accessibleNode.valueNow, null);
node.accessibleNode.valueNow = 9;
assert_equals(axNode.intValue, 9);
assert_equals(axNode.intValue, 5);
node.accessibleNode.valueNow = null;
assert_equals(axNode.intValue, 5);
assert_equals(node.accessibleNode.valueNow, null);
......@@ -44,8 +44,8 @@ test(function(t) {
node.accessibleNode.valueNow = 33;
node.accessibleNode.valueMin = -100;
node.accessibleNode.valueMax = 100;;
assert_equals(axNode.intValue, 33);
assert_equals(axNode.minValue, -100);
assert_equals(axNode.intValue, 50);
assert_equals(axNode.minValue, 0);
assert_equals(axNode.maxValue, 100);
}, "Range values in accessible node of slider.");
</script>
......@@ -62,8 +62,8 @@ test(function(t) {
node.accessibleNode.valueNow = 33;
node.accessibleNode.valueMin = -100;
node.accessibleNode.valueMax = 100;;
assert_equals(axNode.intValue, 33);
assert_equals(axNode.minValue, -100);
assert_equals(axNode.maxValue, 100);
assert_equals(axNode.intValue, 0);
assert_equals(axNode.minValue, 0);
assert_equals(axNode.maxValue, 0);
}, "Range values in accessible node of spinbutton.");
</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