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

Unified Diff: ui/accessibility/ax_node_data.cc

Issue 2719223002: Use correct position when setting pos_in_set for tabs.
Patch Set: Potential nit. Created 3 years, 10 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: ui/accessibility/ax_node_data.cc
diff --git a/ui/accessibility/ax_node_data.cc b/ui/accessibility/ax_node_data.cc
index 82e35d6fab3a4ddc97dc39ce03e8611f63ad6664..0a339bdcec3edcb4dab941f7d6152aa6086359b7 100644
--- a/ui/accessibility/ax_node_data.cc
+++ b/ui/accessibility/ax_node_data.cc
@@ -369,6 +369,21 @@ void AXNodeData::AddIntAttribute(
int_attributes.push_back(std::make_pair(attribute, value));
}
+void AXNodeData::AddValidatedIntAttribute(AXValidatedIntAttribute attribute,
+ int value) {
+ switch (attribute) {
+ case ui::AX_ATTR_INDEX_IN_SET:
+ if (value < 0) {
+ NOTREACHED();
+ return;
+ }
+ AddIntAttribute(ui::AX_ATTR_POS_IN_SET, value + 1);
+ break;
+ default:
+ NOTREACHED();
+ }
+}
+
void AXNodeData::AddFloatAttribute(
AXFloatAttribute attribute, float value) {
float_attributes.push_back(std::make_pair(attribute, value));

Powered by Google App Engine
This is Rietveld 408576698