summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content/browser/accessibility/browser_accessibility.cc3
-rw-r--r--content/browser/accessibility/browser_accessibility_cocoa.mm2
-rw-r--r--content/browser/accessibility/browser_accessibility_manager_android.cc2
-rw-r--r--content/browser/accessibility/browser_accessibility_manager_gtk.cc2
-rw-r--r--content/browser/accessibility/browser_accessibility_manager_mac.mm2
-rw-r--r--content/browser/accessibility/browser_accessibility_manager_unittest.cc12
-rw-r--r--content/browser/accessibility/browser_accessibility_manager_win.cc2
-rw-r--r--content/browser/accessibility/browser_accessibility_win.cc6
-rw-r--r--content/browser/accessibility/browser_accessibility_win_unittest.cc22
-rw-r--r--content/content_tests.gypi3
-rw-r--r--content/renderer/accessibility/accessibility_node_serializer.cc3
-rw-r--r--content/renderer/accessibility/blink_ax_enum_conversion.cc24
-rw-r--r--content/renderer/accessibility/blink_ax_enum_conversion.h5
-rw-r--r--content/renderer/accessibility/renderer_accessibility_browsertest.cc8
-rw-r--r--content/renderer/accessibility/renderer_accessibility_focus_only.cc4
-rw-r--r--tools/json_schema_compiler/cc_generator.py3
-rwxr-xr-xtools/json_schema_compiler/compiler.py11
-rw-r--r--tools/json_schema_compiler/cpp_type_generator.py5
-rw-r--r--tools/json_schema_compiler/cpp_util.py8
-rw-r--r--tools/json_schema_compiler/idl_schema.py3
-rw-r--r--tools/json_schema_compiler/model.py2
-rw-r--r--ui/accessibility/accessibility.gyp35
-rw-r--r--ui/accessibility/ax_enums.h335
-rw-r--r--ui/accessibility/ax_enums.idl325
-rw-r--r--ui/accessibility/ax_node_data.cc128
25 files changed, 454 insertions, 501 deletions
diff --git a/content/browser/accessibility/browser_accessibility.cc b/content/browser/accessibility/browser_accessibility.cc
index 452f01b..0e79a04 100644
--- a/content/browser/accessibility/browser_accessibility.cc
+++ b/content/browser/accessibility/browser_accessibility.cc
@@ -259,6 +259,7 @@ gfx::Rect BrowserAccessibility::GetLocalBoundsForRange(int start, int len)
gfx::Rect child_overlap_rect;
switch (text_direction) {
+ case ui::AX_TEXT_DIRECTION_NONE:
case ui::AX_TEXT_DIRECTION_LR: {
int left = child_rect.x() + start_pixel_offset;
int right = child_rect.x() + end_pixel_offset;
@@ -602,7 +603,7 @@ bool BrowserAccessibility::IsEditableText() const {
// Note: WebAXStateReadonly being false means it's either a text control,
// or contenteditable. We also check for editable text roles to cover
// another element that has role=textbox set on it.
- return (!HasState(ui::AX_STATE_READONLY) ||
+ return (!HasState(ui::AX_STATE_READ_ONLY) ||
role_ == ui::AX_ROLE_TEXT_FIELD ||
role_ == ui::AX_ROLE_TEXT_AREA);
}
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm
index 9e3e771..cfc924b 100644
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
@@ -95,7 +95,7 @@ RoleMap BuildRoleMap() {
{ ui::AX_ROLE_IMAGE_MAP, NSAccessibilityGroupRole },
{ ui::AX_ROLE_IMAGE_MAP_LINK, NSAccessibilityLinkRole },
{ ui::AX_ROLE_INCREMENTOR, NSAccessibilityIncrementorRole },
- { ui::AX_ROLE_LABEL, NSAccessibilityGroupRole },
+ { ui::AX_ROLE_LABEL_TEXT, NSAccessibilityGroupRole },
{ ui::AX_ROLE_LINK, NSAccessibilityLinkRole },
{ ui::AX_ROLE_LIST, NSAccessibilityListRole },
{ ui::AX_ROLE_LIST_BOX, NSAccessibilityListRole },
diff --git a/content/browser/accessibility/browser_accessibility_manager_android.cc b/content/browser/accessibility/browser_accessibility_manager_android.cc
index d928258..7cae154 100644
--- a/content/browser/accessibility/browser_accessibility_manager_android.cc
+++ b/content/browser/accessibility/browser_accessibility_manager_android.cc
@@ -77,7 +77,7 @@ ui::AXNodeData BrowserAccessibilityManagerAndroid::GetEmptyDocument() {
ui::AXNodeData empty_document;
empty_document.id = 0;
empty_document.role = ui::AX_ROLE_ROOT_WEB_AREA;
- empty_document.state = 1 << ui::AX_STATE_READONLY;
+ empty_document.state = 1 << ui::AX_STATE_READ_ONLY;
return empty_document;
}
diff --git a/content/browser/accessibility/browser_accessibility_manager_gtk.cc b/content/browser/accessibility/browser_accessibility_manager_gtk.cc
index 975336f..3d7a976 100644
--- a/content/browser/accessibility/browser_accessibility_manager_gtk.cc
+++ b/content/browser/accessibility/browser_accessibility_manager_gtk.cc
@@ -40,7 +40,7 @@ ui::AXNodeData BrowserAccessibilityManagerGtk::GetEmptyDocument() {
empty_document.id = 0;
empty_document.role = ui::AX_ROLE_ROOT_WEB_AREA;
empty_document.state =
- 1 << ui::AX_STATE_READONLY;
+ 1 << ui::AX_STATE_READ_ONLY;
return empty_document;
}
diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm
index 801dca8..834799c 100644
--- a/content/browser/accessibility/browser_accessibility_manager_mac.mm
+++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm
@@ -33,7 +33,7 @@ ui::AXNodeData BrowserAccessibilityManagerMac::GetEmptyDocument() {
empty_document.id = 0;
empty_document.role = ui::AX_ROLE_ROOT_WEB_AREA;
empty_document.state =
- 1 << ui::AX_STATE_READONLY;
+ 1 << ui::AX_STATE_READ_ONLY;
return empty_document;
}
diff --git a/content/browser/accessibility/browser_accessibility_manager_unittest.cc b/content/browser/accessibility/browser_accessibility_manager_unittest.cc
index f06f1a9..36e5d23 100644
--- a/content/browser/accessibility/browser_accessibility_manager_unittest.cc
+++ b/content/browser/accessibility/browser_accessibility_manager_unittest.cc
@@ -640,7 +640,7 @@ TEST(BrowserAccessibilityManagerTest, BoundsForRange) {
inline_text1.role = ui::AX_ROLE_INLINE_TEXT_BOX;
inline_text1.location = gfx::Rect(100, 100, 29, 9);
inline_text1.AddIntAttribute(ui::AX_ATTR_TEXT_DIRECTION,
- blink::WebAXTextDirectionLR);
+ ui::AX_TEXT_DIRECTION_LR);
std::vector<int32> character_offsets1;
character_offsets1.push_back(6); // 0
character_offsets1.push_back(11); // 1
@@ -659,7 +659,7 @@ TEST(BrowserAccessibilityManagerTest, BoundsForRange) {
inline_text2.role = ui::AX_ROLE_INLINE_TEXT_BOX;
inline_text2.location = gfx::Rect(100, 109, 28, 9);
inline_text2.AddIntAttribute(ui::AX_ATTR_TEXT_DIRECTION,
- blink::WebAXTextDirectionLR);
+ ui::AX_TEXT_DIRECTION_LR);
std::vector<int32> character_offsets2;
character_offsets2.push_back(5);
character_offsets2.push_back(10);
@@ -736,7 +736,7 @@ TEST(BrowserAccessibilityManagerTest, BoundsForRangeBiDi) {
inline_text1.role = ui::AX_ROLE_INLINE_TEXT_BOX;
inline_text1.location = gfx::Rect(100, 100, 30, 20);
inline_text1.AddIntAttribute(ui::AX_ATTR_TEXT_DIRECTION,
- blink::WebAXTextDirectionLR);
+ ui::AX_TEXT_DIRECTION_LR);
std::vector<int32> character_offsets1;
character_offsets1.push_back(10); // 0
character_offsets1.push_back(20); // 1
@@ -751,7 +751,7 @@ TEST(BrowserAccessibilityManagerTest, BoundsForRangeBiDi) {
inline_text2.role = ui::AX_ROLE_INLINE_TEXT_BOX;
inline_text2.location = gfx::Rect(130, 100, 30, 20);
inline_text2.AddIntAttribute(ui::AX_ATTR_TEXT_DIRECTION,
- blink::WebAXTextDirectionRL);
+ ui::AX_TEXT_DIRECTION_RL);
std::vector<int32> character_offsets2;
character_offsets2.push_back(10);
character_offsets2.push_back(20);
@@ -837,7 +837,7 @@ TEST(BrowserAccessibilityManagerTest, MAYBE_BoundsForRangeOnParentElement) {
inline_text1.role = ui::AX_ROLE_INLINE_TEXT_BOX;
inline_text1.location = gfx::Rect(100, 100, 40, 20);
inline_text1.AddIntAttribute(ui::AX_ATTR_TEXT_DIRECTION,
- blink::WebAXTextDirectionLR);
+ ui::AX_TEXT_DIRECTION_LR);
std::vector<int32> character_offsets1;
character_offsets1.push_back(20); // 0
character_offsets1.push_back(40); // 1
@@ -850,7 +850,7 @@ TEST(BrowserAccessibilityManagerTest, MAYBE_BoundsForRangeOnParentElement) {
inline_text2.role = ui::AX_ROLE_INLINE_TEXT_BOX;
inline_text2.location = gfx::Rect(160, 100, 40, 20);
inline_text2.AddIntAttribute(ui::AX_ATTR_TEXT_DIRECTION,
- blink::WebAXTextDirectionLR);
+ ui::AX_TEXT_DIRECTION_LR);
std::vector<int32> character_offsets2;
character_offsets2.push_back(20); // 0
character_offsets2.push_back(40); // 1
diff --git a/content/browser/accessibility/browser_accessibility_manager_win.cc b/content/browser/accessibility/browser_accessibility_manager_win.cc
index 81ea9dc..684e11b 100644
--- a/content/browser/accessibility/browser_accessibility_manager_win.cc
+++ b/content/browser/accessibility/browser_accessibility_manager_win.cc
@@ -59,7 +59,7 @@ ui::AXNodeData BrowserAccessibilityManagerWin::GetEmptyDocument() {
empty_document.role = ui::AX_ROLE_ROOT_WEB_AREA;
empty_document.state =
(1 << blink::WebAXStateEnabled) |
- (1 << ui::AX_STATE_READONLY) |
+ (1 << ui::AX_STATE_READ_ONLY) |
(1 << ui::AX_STATE_BUSY);
return empty_document;
}
diff --git a/content/browser/accessibility/browser_accessibility_win.cc b/content/browser/accessibility/browser_accessibility_win.cc
index 451043b..1684450 100644
--- a/content/browser/accessibility/browser_accessibility_win.cc
+++ b/content/browser/accessibility/browser_accessibility_win.cc
@@ -3357,7 +3357,7 @@ void BrowserAccessibilityWin::InitRoleAndState() {
// WebKit marks everything as readonly unless it's editable text, so if it's
// not readonly, mark it as editable now. The final computation of the
// READONLY state for MSAA is below, after the switch.
- if (!HasState(ui::AX_STATE_READONLY))
+ if (!HasState(ui::AX_STATE_READ_ONLY))
ia2_state_ |= IA2_STATE_EDITABLE;
base::string16 invalid;
@@ -3526,7 +3526,7 @@ void BrowserAccessibilityWin::InitRoleAndState() {
ia_state_ |= STATE_SYSTEM_LINKED;
ia_state_ |= STATE_SYSTEM_READONLY;
break;
- case ui::AX_ROLE_LABEL:
+ case ui::AX_ROLE_LABEL_TEXT:
ia_role_ = ROLE_SYSTEM_TEXT;
ia2_role_ = IA2_ROLE_LABEL;
break;
@@ -3778,7 +3778,7 @@ void BrowserAccessibilityWin::InitRoleAndState() {
ia_role_ != ROLE_SYSTEM_DOCUMENT) {
ia_state_ &= ~(STATE_SYSTEM_READONLY);
}
- if (!HasState(ui::AX_STATE_READONLY))
+ if (!HasState(ui::AX_STATE_READ_ONLY))
ia_state_ &= ~(STATE_SYSTEM_READONLY);
if (GetBoolAttribute(ui::AX_ATTR_ARIA_READONLY))
ia_state_ |= STATE_SYSTEM_READONLY;
diff --git a/content/browser/accessibility/browser_accessibility_win_unittest.cc b/content/browser/accessibility/browser_accessibility_win_unittest.cc
index 8f97483..fad5ad4 100644
--- a/content/browser/accessibility/browser_accessibility_win_unittest.cc
+++ b/content/browser/accessibility/browser_accessibility_win_unittest.cc
@@ -423,19 +423,19 @@ TEST_F(BrowserAccessibilityTest, TestSimpleHypertext) {
ui::AXNodeData text1;
text1.id = 11;
text1.role = ui::AX_ROLE_STATIC_TEXT;
- text1.state = 1 << ui::AX_STATE_READONLY;
+ text1.state = 1 << ui::AX_STATE_READ_ONLY;
text1.SetName(text1_name);
ui::AXNodeData text2;
text2.id = 12;
text2.role = ui::AX_ROLE_STATIC_TEXT;
- text2.state = 1 << ui::AX_STATE_READONLY;
+ text2.state = 1 << ui::AX_STATE_READ_ONLY;
text2.SetName(text2_name);
ui::AXNodeData root;
root.id = 1;
root.role = ui::AX_ROLE_ROOT_WEB_AREA;
- root.state = 1 << ui::AX_STATE_READONLY;
+ root.state = 1 << ui::AX_STATE_READ_ONLY;
root.child_ids.push_back(11);
root.child_ids.push_back(12);
@@ -491,13 +491,13 @@ TEST_F(BrowserAccessibilityTest, TestComplexHypertext) {
ui::AXNodeData text1;
text1.id = 11;
text1.role = ui::AX_ROLE_STATIC_TEXT;
- text1.state = 1 << ui::AX_STATE_READONLY;
+ text1.state = 1 << ui::AX_STATE_READ_ONLY;
text1.SetName(text1_name);
ui::AXNodeData text2;
text2.id = 12;
text2.role = ui::AX_ROLE_STATIC_TEXT;
- text2.state = 1 << ui::AX_STATE_READONLY;
+ text2.state = 1 << ui::AX_STATE_READ_ONLY;
text2.SetName(text2_name);
ui::AXNodeData button1, button1_text;
@@ -506,8 +506,8 @@ TEST_F(BrowserAccessibilityTest, TestComplexHypertext) {
button1_text.SetName(button1_text_name);
button1.role = ui::AX_ROLE_BUTTON;
button1_text.role = ui::AX_ROLE_STATIC_TEXT;
- button1.state = 1 << ui::AX_STATE_READONLY;
- button1_text.state = 1 << ui::AX_STATE_READONLY;
+ button1.state = 1 << ui::AX_STATE_READ_ONLY;
+ button1_text.state = 1 << ui::AX_STATE_READ_ONLY;
button1.child_ids.push_back(15);
ui::AXNodeData link1, link1_text;
@@ -516,14 +516,14 @@ TEST_F(BrowserAccessibilityTest, TestComplexHypertext) {
link1_text.SetName(link1_text_name);
link1.role = ui::AX_ROLE_LINK;
link1_text.role = ui::AX_ROLE_STATIC_TEXT;
- link1.state = 1 << ui::AX_STATE_READONLY;
- link1_text.state = 1 << ui::AX_STATE_READONLY;
+ link1.state = 1 << ui::AX_STATE_READ_ONLY;
+ link1_text.state = 1 << ui::AX_STATE_READ_ONLY;
link1.child_ids.push_back(16);
ui::AXNodeData root;
root.id = 1;
root.role = ui::AX_ROLE_ROOT_WEB_AREA;
- root.state = 1 << ui::AX_STATE_READONLY;
+ root.state = 1 << ui::AX_STATE_READ_ONLY;
root.child_ids.push_back(11);
root.child_ids.push_back(13);
root.child_ids.push_back(12);
@@ -604,7 +604,7 @@ TEST_F(BrowserAccessibilityTest, TestCreateEmptyDocument) {
// set automatically.
CountedBrowserAccessibility::reset();
const int32 busy_state = 1 << ui::AX_STATE_BUSY;
- const int32 readonly_state = 1 << ui::AX_STATE_READONLY;
+ const int32 readonly_state = 1 << ui::AX_STATE_READ_ONLY;
const int32 enabled_state = 1 << blink::WebAXStateEnabled;
scoped_ptr<content::LegacyRenderWidgetHostHWND> accessible_hwnd(
content::LegacyRenderWidgetHostHWND::Create(GetDesktopWindow()));
diff --git a/content/content_tests.gypi b/content/content_tests.gypi
index 4e42d3a..6a7be8c 100644
--- a/content/content_tests.gypi
+++ b/content/content_tests.gypi
@@ -12,6 +12,7 @@
'../skia/skia.gyp:skia',
'../testing/gmock.gyp:gmock',
'../testing/gtest.gyp:gtest',
+ '../ui/accessibility/accessibility.gyp:ax_gen',
'../ui/events/events.gyp:dom4_keycode_converter',
'../ui/events/events.gyp:events_base',
'../ui/events/events.gyp:events_test_support',
@@ -887,6 +888,7 @@
'content_shell_lib',
'../skia/skia.gyp:skia',
'../testing/gtest.gyp:gtest',
+ '../ui/accessibility/accessibility.gyp:ax_gen',
],
'sources': [
'test/accessibility_browser_test_utils.cc',
@@ -936,6 +938,7 @@
'../ui/snapshot/snapshot.gyp:snapshot',
'../ui/ui.gyp:ui',
'../webkit/child/webkit_child.gyp:webkit_child',
+ '../ui/accessibility/accessibility.gyp:ax_gen',
],
'include_dirs': [
'..',
diff --git a/content/renderer/accessibility/accessibility_node_serializer.cc b/content/renderer/accessibility/accessibility_node_serializer.cc
index 4e93282..9912332 100644
--- a/content/renderer/accessibility/accessibility_node_serializer.cc
+++ b/content/renderer/accessibility/accessibility_node_serializer.cc
@@ -103,7 +103,8 @@ void SerializeAccessibilityNode(
}
if (dst->role == ui::AX_ROLE_INLINE_TEXT_BOX) {
- dst->AddIntAttribute(ui::AX_ATTR_TEXT_DIRECTION, src.textDirection());
+ dst->AddIntAttribute(ui::AX_ATTR_TEXT_DIRECTION,
+ AXTextDirectionFromBlink(src.textDirection()));
WebVector<int> src_character_offsets;
src.characterOffsets(src_character_offsets);
diff --git a/content/renderer/accessibility/blink_ax_enum_conversion.cc b/content/renderer/accessibility/blink_ax_enum_conversion.cc
index 894adf7..694cfe6 100644
--- a/content/renderer/accessibility/blink_ax_enum_conversion.cc
+++ b/content/renderer/accessibility/blink_ax_enum_conversion.cc
@@ -54,7 +54,7 @@ uint32 AXStateFromBlink(const blink::WebAXObject& o) {
state |= (1 << ui::AX_STATE_PROTECTED);
if (o.isReadOnly())
- state |= (1 << ui::AX_STATE_READONLY);
+ state |= (1 << ui::AX_STATE_READ_ONLY);
if (o.isRequired())
state |= (1 << ui::AX_STATE_REQUIRED);
@@ -69,7 +69,7 @@ uint32 AXStateFromBlink(const blink::WebAXObject& o) {
state |= (1 << ui::AX_STATE_VISITED);
if (o.isEnabled())
- state |= (1 << blink::WebAXStateEnabled);
+ state |= (1 << ui::AX_STATE_ENABLED);
if (o.isVertical())
state |= (1 << ui::AX_STATE_VERTICAL);
@@ -167,7 +167,7 @@ ui::AXRole AXRoleFromBlink(blink::WebAXRole role) {
case blink::WebAXRoleInlineTextBox:
return ui::AX_ROLE_INLINE_TEXT_BOX;
case blink::WebAXRoleLabel:
- return ui::AX_ROLE_LABEL;
+ return ui::AX_ROLE_LABEL_TEXT;
case blink::WebAXRoleLegend:
return ui::AX_ROLE_LEGEND;
case blink::WebAXRoleLink:
@@ -372,4 +372,22 @@ ui::AXEvent AXEventFromBlink(blink::WebAXEvent event) {
return static_cast<ui::AXEvent>(-1);
}
+ui::AXTextDirection AXTextDirectionFromBlink(
+ blink::WebAXTextDirection text_direction) {
+ switch (text_direction) {
+ case blink::WebAXTextDirectionLR:
+ return ui::AX_TEXT_DIRECTION_LR;
+ case blink::WebAXTextDirectionRL:
+ return ui::AX_TEXT_DIRECTION_RL;
+ case blink::WebAXTextDirectionTB:
+ return ui::AX_TEXT_DIRECTION_TB;
+ case blink::WebAXTextDirectionBT:
+ return ui::AX_TEXT_DIRECTION_BT;
+ default:
+ NOTREACHED();
+ }
+
+ return ui::AX_TEXT_DIRECTION_NONE;
+}
+
} // namespace content
diff --git a/content/renderer/accessibility/blink_ax_enum_conversion.h b/content/renderer/accessibility/blink_ax_enum_conversion.h
index 78a739c..b7c41a1 100644
--- a/content/renderer/accessibility/blink_ax_enum_conversion.h
+++ b/content/renderer/accessibility/blink_ax_enum_conversion.h
@@ -22,6 +22,11 @@ ui::AXEvent AXEventFromBlink(blink::WebAXEvent event);
// in AXNodeData instead.)
uint32 AXStateFromBlink(const blink::WebAXObject& o);
+// Convert a Blink WebAXTextDirection to an AXTextDirection defined in
+// ui/accessibility.
+ui::AXTextDirection AXTextDirectionFromBlink(
+ blink::WebAXTextDirection text_direction);
+
} // namespace content
#endif // CONTENT_RENDERER_ACCESSIBILITY_BLINK_AX_ENUM_CONVERSION_H_
diff --git a/content/renderer/accessibility/renderer_accessibility_browsertest.cc b/content/renderer/accessibility/renderer_accessibility_browsertest.cc
index fbf8522..ca5d7a1 100644
--- a/content/renderer/accessibility/renderer_accessibility_browsertest.cc
+++ b/content/renderer/accessibility/renderer_accessibility_browsertest.cc
@@ -132,7 +132,7 @@ TEST_F(RendererAccessibilityTest, EditableTextModeFocusEvents) {
EXPECT_EQ(event.nodes[0].role,
ui::AX_ROLE_ROOT_WEB_AREA);
EXPECT_EQ(event.nodes[0].state,
- (1U << ui::AX_STATE_READONLY) |
+ (1U << ui::AX_STATE_READ_ONLY) |
(1U << ui::AX_STATE_FOCUSABLE) |
(1U << ui::AX_STATE_FOCUSED));
EXPECT_EQ(event.nodes[0].child_ids.size(), 1U);
@@ -152,7 +152,7 @@ TEST_F(RendererAccessibilityTest, EditableTextModeFocusEvents) {
EXPECT_EQ(event.nodes[0].role,
ui::AX_ROLE_ROOT_WEB_AREA);
EXPECT_EQ(event.nodes[0].state,
- (1U << ui::AX_STATE_READONLY) |
+ (1U << ui::AX_STATE_READ_ONLY) |
(1U << ui::AX_STATE_FOCUSABLE));
EXPECT_EQ(event.nodes[0].child_ids.size(), 1U);
EXPECT_EQ(event.nodes[1].id, 3);
@@ -211,7 +211,7 @@ TEST_F(RendererAccessibilityTest, EditableTextModeFocusEvents) {
EXPECT_EQ(event.nodes[1].state,
(1U << ui::AX_STATE_FOCUSABLE) |
(1U << ui::AX_STATE_FOCUSED) |
- (1U << ui::AX_STATE_READONLY));
+ (1U << ui::AX_STATE_READ_ONLY));
}
{
@@ -224,7 +224,7 @@ TEST_F(RendererAccessibilityTest, EditableTextModeFocusEvents) {
EXPECT_EQ(event.nodes[1].state,
(1U << ui::AX_STATE_FOCUSABLE) |
(1U << ui::AX_STATE_FOCUSED) |
- (1U << ui::AX_STATE_READONLY));
+ (1U << ui::AX_STATE_READ_ONLY));
}
// Clear focus.
diff --git a/content/renderer/accessibility/renderer_accessibility_focus_only.cc b/content/renderer/accessibility/renderer_accessibility_focus_only.cc
index 28e9477..dd57f91 100644
--- a/content/renderer/accessibility/renderer_accessibility_focus_only.cc
+++ b/content/renderer/accessibility/renderer_accessibility_focus_only.cc
@@ -101,7 +101,7 @@ void RendererAccessibilityFocusOnly::HandleFocusedNodeChanged(
root.id = 1;
root.role = ui::AX_ROLE_ROOT_WEB_AREA;
root.state =
- (1 << ui::AX_STATE_READONLY) |
+ (1 << ui::AX_STATE_READ_ONLY) |
(1 << ui::AX_STATE_FOCUSABLE);
if (!node_has_focus)
root.state |= (1 << ui::AX_STATE_FOCUSED);
@@ -125,7 +125,7 @@ void RendererAccessibilityFocusOnly::HandleFocusedNodeChanged(
(1 << ui::AX_STATE_FOCUSABLE) |
(1 << ui::AX_STATE_FOCUSED);
if (!node_is_editable_text)
- child.state |= (1 << ui::AX_STATE_READONLY);
+ child.state |= (1 << ui::AX_STATE_READ_ONLY);
}
#ifndef NDEBUG
diff --git a/tools/json_schema_compiler/cc_generator.py b/tools/json_schema_compiler/cc_generator.py
index 68152b5..04d951b 100644
--- a/tools/json_schema_compiler/cc_generator.py
+++ b/tools/json_schema_compiler/cc_generator.py
@@ -46,7 +46,7 @@ class _Generator(object):
.Append('#include "base/strings/string_number_conversions.h"')
.Append('#include "base/strings/utf_string_conversions.h"')
.Append('#include "%s/%s.h"' %
- (self._namespace.source_file_dir, self._namespace.unix_name))
+ (self._namespace.source_file_dir, self._namespace.short_filename))
.Cblock(self._type_helper.GenerateIncludes(include_soft=True))
.Append()
.Concat(cpp_util.OpenNamespace(self._cpp_namespace))
@@ -91,6 +91,7 @@ class _Generator(object):
(c.Concat(self._type_helper.GetNamespaceEnd())
.Cblock(cpp_util.CloseNamespace(self._cpp_namespace))
)
+ c.Append()
return c
def _GenerateType(self, cpp_namespace, type_):
diff --git a/tools/json_schema_compiler/compiler.py b/tools/json_schema_compiler/compiler.py
index 21281fc..c79beaec 100755
--- a/tools/json_schema_compiler/compiler.py
+++ b/tools/json_schema_compiler/compiler.py
@@ -71,13 +71,6 @@ def GenerateSchema(generator,
path, filename = os.path.split(schema_filename)
short_filename, extension = os.path.splitext(filename)
- # Filenames are checked against the unix_names of the namespaces they
- # generate because the gyp uses the names of the JSON files to generate
- # the names of the .cc and .h files. We want these to be using unix_names.
- if namespace.unix_name != short_filename:
- sys.exit("Filename %s is illegal. Name files using unix_hacker style." %
- schema_filename)
-
# Construct the type generator with all the namespaces in this model.
type_generator = CppTypeGenerator(api_model,
schema_loader,
@@ -99,8 +92,8 @@ def GenerateSchema(generator,
elif generator == 'cpp':
cpp_generator = CppGenerator(type_generator, root_namespace)
generators = [
- ('%s.h' % namespace.unix_name, cpp_generator.h_generator),
- ('%s.cc' % namespace.unix_name, cpp_generator.cc_generator)
+ ('%s.h' % short_filename, cpp_generator.h_generator),
+ ('%s.cc' % short_filename, cpp_generator.cc_generator)
]
elif generator == 'dart':
generators = [
diff --git a/tools/json_schema_compiler/cpp_type_generator.py b/tools/json_schema_compiler/cpp_type_generator.py
index d485b46..244cbda 100644
--- a/tools/json_schema_compiler/cpp_type_generator.py
+++ b/tools/json_schema_compiler/cpp_type_generator.py
@@ -64,8 +64,9 @@ class CppTypeGenerator(object):
e.g VAR_STRING
"""
- value = '%s_%s' % (self.FollowRef(type_).unix_name.upper(),
- cpp_util.Classname(enum_value.name.upper()))
+ value = cpp_util.Classname(enum_value.name.upper())
+ if not type_.cpp_omit_enum_type:
+ value = '%s_%s' % (self.FollowRef(type_).unix_name.upper(), value)
# To avoid collisions with built-in OS_* preprocessor definitions, we add a
# trailing slash to enum names that start with OS_.
if value.startswith("OS_"):
diff --git a/tools/json_schema_compiler/cpp_util.py b/tools/json_schema_compiler/cpp_util.py
index 1e7c370..e7c29ac 100644
--- a/tools/json_schema_compiler/cpp_util.py
+++ b/tools/json_schema_compiler/cpp_util.py
@@ -110,6 +110,10 @@ def OpenNamespace(namespace):
"""Get opening root namespace declarations.
"""
c = Code()
+ # In lieu of GYP supporting None for the namespace variable the '' namespace
+ # implies there is no root namespace.
+ if namespace == '':
+ return c
for component in namespace.split('::'):
c.Append('namespace %s {' % component)
return c
@@ -119,6 +123,10 @@ def CloseNamespace(namespace):
"""Get closing root namespace declarations.
"""
c = Code()
+ # In lieu of GYP supporting None for the namespace variable the '' namespace
+ # implies there is no root namespace.
+ if namespace == '':
+ return c
for component in reversed(namespace.split('::')):
c.Append('} // namespace %s' % component)
return c
diff --git a/tools/json_schema_compiler/idl_schema.py b/tools/json_schema_compiler/idl_schema.py
index 62d31ed..bc8b2bf 100644
--- a/tools/json_schema_compiler/idl_schema.py
+++ b/tools/json_schema_compiler/idl_schema.py
@@ -309,7 +309,8 @@ class Enum(object):
'description': self.description,
'type': 'string',
'enum': enum}
- for property_name in ('inline_doc', 'noinline_doc', 'nodoc'):
+ for property_name in (
+ 'inline_doc', 'noinline_doc', 'nodoc', 'cpp_omit_enum_type',):
if self.node.GetProperty(property_name):
result[property_name] = True
if self.node.GetProperty('deprecated'):
diff --git a/tools/json_schema_compiler/model.py b/tools/json_schema_compiler/model.py
index e0dabb1..967e9ab 100644
--- a/tools/json_schema_compiler/model.py
+++ b/tools/json_schema_compiler/model.py
@@ -107,6 +107,7 @@ class Namespace(object):
self.unix_name = UnixName(self.name)
self.source_file = source_file
self.source_file_dir, self.source_file_filename = os.path.split(source_file)
+ self.short_filename = os.path.basename(source_file).split('.')[0]
self.parent = None
self.platforms = _GetPlatforms(json)
toplevel_origin = Origin(from_client=True, from_json=True)
@@ -189,6 +190,7 @@ class Type(object):
elif 'enum' in json and json_type == 'string':
self.property_type = PropertyType.ENUM
self.enum_values = [EnumValue(value) for value in json['enum']]
+ self.cpp_omit_enum_type = 'cpp_omit_enum_type' in json
elif json_type == 'any':
self.property_type = PropertyType.ANY
elif json_type == 'binary':
diff --git a/ui/accessibility/accessibility.gyp b/ui/accessibility/accessibility.gyp
index 2db99d6..d02704a 100644
--- a/ui/accessibility/accessibility.gyp
+++ b/ui/accessibility/accessibility.gyp
@@ -11,17 +11,20 @@
{
'target_name': 'accessibility',
'type': '<(component)',
+ 'export_dependent_settings': [
+ 'ax_gen',
+ ],
'dependencies': [
'../../base/base.gyp:base',
'../gfx/gfx.gyp:gfx',
'../gfx/gfx.gyp:gfx_geometry',
+ 'ax_gen',
],
'defines': [
'ACCESSIBILITY_IMPLEMENTATION',
],
'sources': [
# All .cc, .h under accessibility, except unittests
- 'ax_enums.h',
'ax_node.cc',
'ax_node_data.cc',
'ax_node_data.h',
@@ -47,6 +50,7 @@
'../gfx/gfx.gyp:gfx',
'../gfx/gfx.gyp:gfx_geometry',
'accessibility',
+ 'ax_gen',
],
'sources': [
'ax_generated_tree_unittest.cc',
@@ -54,5 +58,34 @@
'ax_tree_unittest.cc',
]
},
+ {
+ 'target_name': 'ax_gen',
+ 'type': 'static_library',
+ # This target exports a hard dependency because dependent targets may
+ # include ax_enums.h, a generated header.
+ 'hard_dependency': 1,
+ 'dependencies': [
+ '../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations'
+ ],
+ 'sources': [
+ '<@(schema_files)',
+ ],
+ 'msvs_disabled_warnings': [ 4267 ],
+ 'includes': [
+ '../../build/json_schema_bundle_compile.gypi',
+ '../../build/json_schema_compile.gypi',
+ ],
+ 'variables': {
+ 'chromium_code': 1,
+ 'schema_files': [
+ 'ax_enums.idl',
+ ],
+ 'non_compiled_schema_files': [],
+ 'cc_dir': 'ui/accessibility',
+ # TODO(dtseng): Change this once all files under ui/accessibility
+ # namespaced under ui::ax.
+ 'root_namespace': '',
+ },
+ },
],
}
diff --git a/ui/accessibility/ax_enums.h b/ui/accessibility/ax_enums.h
deleted file mode 100644
index b57b241..0000000
--- a/ui/accessibility/ax_enums.h
+++ /dev/null
@@ -1,335 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef UI_ACCESSIBILITY_AX_ENUMS_H_
-#define UI_ACCESSIBILITY_AX_ENUMS_H_
-
-#include "base/basictypes.h"
-
-namespace ui {
-
-// These should be kept in sync with third_party/WebKit/public/web/WebAXEnums.h
-// until the Chromium and Blink trees are merged.
-
-enum AXEvent {
- AX_EVENT_ACTIVEDESCENDANTCHANGED,
- AX_EVENT_ALERT,
- AX_EVENT_ARIA_ATTRIBUTE_CHANGED,
- AX_EVENT_AUTOCORRECTION_OCCURED,
- AX_EVENT_BLUR,
- AX_EVENT_CHECKED_STATE_CHANGED,
- AX_EVENT_CHILDREN_CHANGED,
- AX_EVENT_FOCUS,
- AX_EVENT_HIDE,
- AX_EVENT_INVALID_STATUS_CHANGED,
- AX_EVENT_LAYOUT_COMPLETE,
- AX_EVENT_LIVE_REGION_CHANGED,
- AX_EVENT_LOAD_COMPLETE,
- AX_EVENT_LOCATION_CHANGED,
- AX_EVENT_MENU_LIST_ITEM_SELECTED,
- AX_EVENT_MENU_LIST_VALUE_CHANGED,
- AX_EVENT_ROW_COLLAPSED,
- AX_EVENT_ROW_COUNT_CHANGED,
- AX_EVENT_ROW_EXPANDED,
- AX_EVENT_SCROLLED_TO_ANCHOR,
- AX_EVENT_SELECTED_CHILDREN_CHANGED,
- AX_EVENT_SELECTED_TEXT_CHANGED,
- AX_EVENT_SHOW,
- AX_EVENT_TEXT_CHANGED,
- AX_EVENT_TEXT_INSERTED,
- AX_EVENT_TEXT_REMOVED,
- AX_EVENT_VALUE_CHANGED
-};
-
-enum AXRole {
- AX_ROLE_ALERT_DIALOG = 1,
- AX_ROLE_ALERT,
- AX_ROLE_ANNOTATION,
- AX_ROLE_APPLICATION,
- AX_ROLE_ARTICLE,
- AX_ROLE_BANNER,
- AX_ROLE_BROWSER,
- AX_ROLE_BUSY_INDICATOR,
- AX_ROLE_BUTTON,
- AX_ROLE_CANVAS,
- AX_ROLE_CELL,
- AX_ROLE_CHECK_BOX,
- AX_ROLE_COLOR_WELL,
- AX_ROLE_COLUMN_HEADER,
- AX_ROLE_COLUMN,
- AX_ROLE_COMBO_BOX,
- AX_ROLE_COMPLEMENTARY,
- AX_ROLE_CONTENT_INFO,
- AX_ROLE_DEFINITION,
- AX_ROLE_DESCRIPTION_LIST_DETAIL,
- AX_ROLE_DESCRIPTION_LIST_TERM,
- AX_ROLE_DIALOG,
- AX_ROLE_DIRECTORY,
- AX_ROLE_DISCLOSURE_TRIANGLE,
- AX_ROLE_DIV,
- AX_ROLE_DOCUMENT,
- AX_ROLE_DRAWER,
- AX_ROLE_EDITABLE_TEXT,
- AX_ROLE_FOOTER,
- AX_ROLE_FORM,
- AX_ROLE_GRID,
- AX_ROLE_GROUP,
- AX_ROLE_GROW_AREA,
- AX_ROLE_HEADING,
- AX_ROLE_HELP_TAG,
- AX_ROLE_HORIZONTAL_RULE,
- AX_ROLE_IGNORED,
- AX_ROLE_IMAGE_MAP_LINK,
- AX_ROLE_IMAGE_MAP,
- AX_ROLE_IMAGE,
- AX_ROLE_INCREMENTOR,
- AX_ROLE_INLINE_TEXT_BOX,
- AX_ROLE_LABEL,
- AX_ROLE_LEGEND,
- AX_ROLE_LINK,
- AX_ROLE_LIST_BOX_OPTION,
- AX_ROLE_LIST_BOX,
- AX_ROLE_LIST_ITEM,
- AX_ROLE_LIST_MARKER,
- AX_ROLE_LIST,
- AX_ROLE_LOG,
- AX_ROLE_MAIN,
- AX_ROLE_MARQUEE,
- AX_ROLE_MATH_ELEMENT,
- AX_ROLE_MATH,
- AX_ROLE_MATTE,
- AX_ROLE_MENU_BAR,
- AX_ROLE_MENU_BUTTON,
- AX_ROLE_MENU_ITEM,
- AX_ROLE_MENU_LIST_OPTION,
- AX_ROLE_MENU_LIST_POPUP,
- AX_ROLE_MENU,
- AX_ROLE_NAVIGATION,
- AX_ROLE_NOTE,
- AX_ROLE_OUTLINE,
- AX_ROLE_PARAGRAPH,
- AX_ROLE_POP_UP_BUTTON,
- AX_ROLE_PRESENTATIONAL,
- AX_ROLE_PROGRESS_INDICATOR,
- AX_ROLE_RADIO_BUTTON,
- AX_ROLE_RADIO_GROUP,
- AX_ROLE_REGION,
- AX_ROLE_ROOT_WEB_AREA,
- AX_ROLE_ROW_HEADER,
- AX_ROLE_ROW,
- AX_ROLE_RULER_MARKER,
- AX_ROLE_RULER,
- AX_ROLE_SVG_ROOT,
- AX_ROLE_SCROLL_AREA,
- AX_ROLE_SCROLL_BAR,
- AX_ROLE_SEAMLESS_WEB_AREA,
- AX_ROLE_SEARCH,
- AX_ROLE_SHEET,
- AX_ROLE_SLIDER,
- AX_ROLE_SLIDER_THUMB,
- AX_ROLE_SPIN_BUTTON_PART,
- AX_ROLE_SPIN_BUTTON,
- AX_ROLE_SPLIT_GROUP,
- AX_ROLE_SPLITTER,
- AX_ROLE_STATIC_TEXT,
- AX_ROLE_STATUS,
- AX_ROLE_SYSTEM_WIDE,
- AX_ROLE_TAB_GROUP,
- AX_ROLE_TAB_LIST,
- AX_ROLE_TAB_PANEL,
- AX_ROLE_TAB,
- AX_ROLE_TABLE_HEADER_CONTAINER,
- AX_ROLE_TABLE,
- AX_ROLE_TEXT_AREA,
- AX_ROLE_TEXT_FIELD,
- AX_ROLE_TIMER,
- AX_ROLE_TOGGLE_BUTTON,
- AX_ROLE_TOOLBAR,
- AX_ROLE_TREE_GRID,
- AX_ROLE_TREE_ITEM,
- AX_ROLE_TREE,
- AX_ROLE_UNKNOWN,
- AX_ROLE_TOOLTIP,
- AX_ROLE_VALUE_INDICATOR,
- AX_ROLE_WEB_AREA,
- AX_ROLE_WINDOW
-};
-
-enum AXState {
- AX_STATE_BUSY,
- AX_STATE_CHECKED,
- AX_STATE_COLLAPSED,
- AX_STATE_ENABLED,
- AX_STATE_EXPANDED,
- AX_STATE_FOCUSABLE,
- AX_STATE_FOCUSED,
- AX_STATE_HASPOPUP,
- AX_STATE_HOVERED,
- AX_STATE_INDETERMINATE,
- AX_STATE_INVISIBLE,
- AX_STATE_LINKED,
- AX_STATE_MULTISELECTABLE,
- AX_STATE_OFFSCREEN,
- AX_STATE_PRESSED,
- AX_STATE_PROTECTED,
- AX_STATE_READONLY,
- AX_STATE_REQUIRED,
- AX_STATE_SELECTABLE,
- AX_STATE_SELECTED,
- AX_STATE_VERTICAL,
- AX_STATE_VISITED
-};
-
-enum AXStringAttribute {
- // Document attributes.
- AX_ATTR_DOC_URL,
- AX_ATTR_DOC_TITLE,
- AX_ATTR_DOC_MIMETYPE,
- AX_ATTR_DOC_DOCTYPE,
-
- // Attributes that could apply to any node.
- AX_ATTR_ACCESS_KEY,
- AX_ATTR_ACTION,
- AX_ATTR_CONTAINER_LIVE_RELEVANT,
- AX_ATTR_CONTAINER_LIVE_STATUS,
- AX_ATTR_DESCRIPTION,
- AX_ATTR_DISPLAY,
- AX_ATTR_HELP,
- AX_ATTR_HTML_TAG,
- AX_ATTR_NAME,
- AX_ATTR_LIVE_RELEVANT,
- AX_ATTR_LIVE_STATUS,
- AX_ATTR_ROLE,
- AX_ATTR_SHORTCUT,
- AX_ATTR_URL,
- AX_ATTR_VALUE,
-};
-
-enum AXIntAttribute {
- // Scrollable container attributes.
- AX_ATTR_SCROLL_X,
- AX_ATTR_SCROLL_X_MIN,
- AX_ATTR_SCROLL_X_MAX,
- AX_ATTR_SCROLL_Y,
- AX_ATTR_SCROLL_Y_MIN,
- AX_ATTR_SCROLL_Y_MAX,
-
- // Editable text attributes.
- AX_ATTR_TEXT_SEL_START,
- AX_ATTR_TEXT_SEL_END,
-
- // Table attributes.
- AX_ATTR_TABLE_ROW_COUNT,
- AX_ATTR_TABLE_COLUMN_COUNT,
- AX_ATTR_TABLE_HEADER_ID,
-
- // Table row attributes.
- AX_ATTR_TABLE_ROW_INDEX,
- AX_ATTR_TABLE_ROW_HEADER_ID,
-
- // Table column attributes.
- AX_ATTR_TABLE_COLUMN_INDEX,
- AX_ATTR_TABLE_COLUMN_HEADER_ID,
-
- // Table cell attributes.
- AX_ATTR_TABLE_CELL_COLUMN_INDEX,
- AX_ATTR_TABLE_CELL_COLUMN_SPAN,
- AX_ATTR_TABLE_CELL_ROW_INDEX,
- AX_ATTR_TABLE_CELL_ROW_SPAN,
-
- // Tree control attributes.
- AX_ATTR_HIERARCHICAL_LEVEL,
-
- // Relationships between this element and other elements.
- AX_ATTR_TITLE_UI_ELEMENT,
-
- // Color value for AX_ROLE_COLOR_WELL, each component is 0..255
- AX_ATTR_COLOR_VALUE_RED,
- AX_ATTR_COLOR_VALUE_GREEN,
- AX_ATTR_COLOR_VALUE_BLUE,
-
- // Inline text attributes.
- AX_ATTR_TEXT_DIRECTION
-};
-
-enum AXFloatAttribute {
- // Document attributes.
- AX_ATTR_DOC_LOADING_PROGRESS,
-
- // Range attributes.
- AX_ATTR_VALUE_FOR_RANGE,
- AX_ATTR_MIN_VALUE_FOR_RANGE,
- AX_ATTR_MAX_VALUE_FOR_RANGE,
-};
-
-enum AXBoolAttribute {
- // Document attributes.
- AX_ATTR_DOC_LOADED,
-
- // True if a checkbox or radio button is in the "mixed" state.
- AX_ATTR_BUTTON_MIXED,
-
- // Live region attributes.
- AX_ATTR_CONTAINER_LIVE_ATOMIC,
- AX_ATTR_CONTAINER_LIVE_BUSY,
- AX_ATTR_LIVE_ATOMIC,
- AX_ATTR_LIVE_BUSY,
-
- // ARIA readonly flag.
- AX_ATTR_ARIA_READONLY,
-
- // Writeable attributes
- AX_ATTR_CAN_SET_VALUE,
-
- // If this is set, all of the other fields in this struct should
- // be ignored and only the locations should change.
- AX_ATTR_UPDATE_LOCATION_ONLY,
-
- // Set on a canvas element if it has fallback content.
- AX_ATTR_CANVAS_HAS_FALLBACK,
-};
-
-enum AXIntListAttribute {
- // Ids of nodes that are children of this node logically, but are
- // not children of this node in the tree structure. As an example,
- // a table cell is a child of a row, and an 'indirect' child of a
- // column.
- AX_ATTR_INDIRECT_CHILD_IDS,
-
- // Character indices where line breaks occur.
- AX_ATTR_LINE_BREAKS,
-
- // For a table, the cell ids in row-major order, with duplicate entries
- // when there's a rowspan or colspan, and with -1 for missing cells.
- // There are always exactly rows * columns entries.
- AX_ATTR_CELL_IDS,
-
- // For a table, the unique cell ids in row-major order of their first
- // occurrence.
- AX_ATTR_UNIQUE_CELL_IDS,
-
- // For inline text. This is the pixel position of the end of this
- // character within the bounding rectangle of this object, in the
- // direction given by AX_ATTR_TEXT_DIRECTION. For example, for left-to-right
- // text, the first offset is the right coordinate of the first character
- // within the object's bounds, the second offset is the right coordinate
- // of the second character, and so on.
- AX_ATTR_CHARACTER_OFFSETS,
-
- // For inline text. These int lists must be the same size; they represent
- // the start and end character index of each word within this text.
- AX_ATTR_WORD_STARTS,
- AX_ATTR_WORD_ENDS,
-};
-
-enum AXTextDirection {
- AX_TEXT_DIRECTION_LR,
- AX_TEXT_DIRECTION_RL,
- AX_TEXT_DIRECTION_TB,
- AX_TEXT_DIRECTION_BT,
-};
-
-} // namespace ui
-
-#endif // UI_ACCESSIBILITY_AX_ENUMS_H_
diff --git a/ui/accessibility/ax_enums.idl b/ui/accessibility/ax_enums.idl
new file mode 100644
index 0000000..e6a3aa8
--- /dev/null
+++ b/ui/accessibility/ax_enums.idl
@@ -0,0 +1,325 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// These should be kept in sync with third_party/WebKit/public/web/WebAXEnums.h
+// until the Chromium and Blink trees are merged.
+namespace ui {
+ enum AXEvent {
+ activedescendantchanged,
+ alert,
+ aria_attribute_changed,
+ autocorrection_occured,
+ blur,
+ checked_state_changed,
+ children_changed,
+ focus,
+ hide,
+ invalid_status_changed,
+ layout_complete,
+ live_region_changed,
+ load_complete,
+ location_changed,
+ menu_list_item_selected,
+ menu_list_value_changed,
+ row_collapsed,
+ row_count_changed,
+ row_expanded,
+ scrolled_to_anchor,
+ selected_children_changed,
+ selected_text_changed,
+ show,
+ text_changed,
+ text_inserted,
+ text_removed,
+ value_changed
+ };
+
+ enum AXRole {
+ alert_dialog,
+ alert,
+ annotation,
+ application,
+ article,
+ banner,
+ browser,
+ busy_indicator,
+ button,
+ canvas,
+ cell,
+ check_box,
+ color_well,
+ column_header,
+ column,
+ combo_box,
+ complementary,
+ content_info,
+ definition,
+ description_list_detail,
+ description_list_term,
+ dialog,
+ directory,
+ disclosure_triangle,
+ div,
+ document,
+ drawer,
+ editable_text,
+ footer,
+ form,
+ grid,
+ group,
+ grow_area,
+ heading,
+ help_tag,
+ horizontal_rule,
+ ignored,
+ image_map_link,
+ image_map,
+ image,
+ incrementor,
+ inline_text_box,
+ label_text,
+ legend,
+ link,
+ list_box_option,
+ list_box,
+ list_item,
+ list_marker,
+ list,
+ log,
+ main,
+ marquee,
+ math_element,
+ math,
+ matte,
+ menu_bar,
+ menu_button,
+ menu_item,
+ menu_list_option,
+ menu_list_popup,
+ menu,
+ navigation,
+ note,
+ outline,
+ paragraph,
+ pop_up_button,
+ presentational,
+ progress_indicator,
+ radio_button,
+ radio_group,
+ region,
+ root_web_area,
+ row_header,
+ row,
+ ruler_marker,
+ ruler,
+ svg_root,
+ scroll_area,
+ scroll_bar,
+ seamless_web_area,
+ search,
+ sheet,
+ slider,
+ slider_thumb,
+ spin_button_part,
+ spin_button,
+ split_group,
+ splitter,
+ static_text,
+ status,
+ system_wide,
+ tab_group,
+ tab_list,
+ tab_panel,
+ tab,
+ table_header_container,
+ table,
+ text_area,
+ text_field,
+ timer,
+ toggle_button,
+ toolbar,
+ tree_grid,
+ tree_item,
+ tree,
+ unknown,
+ tooltip,
+ value_indicator,
+ web_area,
+ window
+ };
+
+ enum AXState {
+ busy,
+ checked,
+ collapsed,
+ enabled,
+ expanded,
+ focusable,
+ focused,
+ haspopup,
+ hovered,
+ indeterminate,
+ invisible,
+ linked,
+ multiselectable,
+ offscreen,
+ pressed,
+ protected,
+ read_only,
+ required,
+ selectable,
+ selected,
+ vertical,
+ visited
+ };
+
+ [cpp_omit_enum_type] enum AXStringAttribute {
+ // Document attributes.
+ ax_attr_doc_url,
+ ax_attr_doc_title,
+ ax_attr_doc_mimetype,
+ ax_attr_doc_doctype,
+
+ // Attributes that could apply to any node.
+ ax_attr_access_key,
+ ax_attr_action,
+ ax_attr_container_live_relevant,
+ ax_attr_container_live_status,
+ ax_attr_description,
+ ax_attr_display,
+ ax_attr_help,
+ ax_attr_html_tag,
+ ax_attr_name,
+ ax_attr_live_relevant,
+ ax_attr_live_status,
+ ax_attr_role,
+ ax_attr_shortcut,
+ ax_attr_url,
+ ax_attr_value
+ };
+
+ [cpp_omit_enum_type] enum AXIntAttribute {
+ // Scrollable container attributes.
+ ax_attr_scroll_x,
+ ax_attr_scroll_x_min,
+ ax_attr_scroll_x_max,
+ ax_attr_scroll_y,
+ ax_attr_scroll_y_min,
+ ax_attr_scroll_y_max,
+
+ // Editable text attributes.
+ ax_attr_text_sel_start,
+ ax_attr_text_sel_end,
+
+ // Table attributes.
+ ax_attr_table_row_count,
+ ax_attr_table_column_count,
+ ax_attr_table_header_id,
+
+ // Table row attributes.
+ ax_attr_table_row_index,
+ ax_attr_table_row_header_id,
+
+ // Table column attributes.
+ ax_attr_table_column_index,
+ ax_attr_table_column_header_id,
+
+ // Table cell attributes.
+ ax_attr_table_cell_column_index,
+ ax_attr_table_cell_column_span,
+ ax_attr_table_cell_row_index,
+ ax_attr_table_cell_row_span,
+
+ // Tree control attributes.
+ ax_attr_hierarchical_level,
+
+ // Relationships between this element and other elements.
+ ax_attr_title_ui_element,
+
+ // Color value for AX_ROLE_COLOR_WELL, each component is 0..255
+ ax_attr_color_value_red,
+ ax_attr_color_value_green,
+ ax_attr_color_value_blue,
+
+ // Inline text attributes.
+ ax_attr_text_direction
+ };
+
+ [cpp_omit_enum_type] enum AXFloatAttribute {
+ // Document attributes.
+ ax_attr_doc_loading_progress,
+
+ // Range attributes.
+ ax_attr_value_for_range,
+ ax_attr_min_value_for_range,
+ ax_attr_max_value_for_range
+ };
+
+ [cpp_omit_enum_type] enum AXBoolAttribute {
+ // Document attributes.
+ ax_attr_doc_loaded,
+
+ // True if a checkbox or radio button is in the "mixed" state.
+ ax_attr_button_mixed,
+
+ // Live region attributes.
+ ax_attr_container_live_atomic,
+ ax_attr_container_live_busy,
+ ax_attr_live_atomic,
+ ax_attr_live_busy,
+
+ // ARIA readonly flag.
+ ax_attr_aria_readonly,
+
+ // Writeable attributes
+ ax_attr_can_set_value,
+
+ // If this is set, all of the other fields in this struct should
+ // be ignored and only the locations should change.
+ ax_attr_update_location_only,
+
+ // Set on a canvas element if it has fallback content.
+ ax_attr_canvas_has_fallback
+ };
+
+ [cpp_omit_enum_type] enum AXIntListAttribute {
+ // Ids of nodes that are children of this node logically, but are
+ // not children of this node in the tree structure. As an example,
+ // a table cell is a child of a row, and an 'indirect' child of a
+ // column.
+ ax_attr_indirect_child_ids,
+
+ // Character indices where line breaks occur.
+ ax_attr_line_breaks,
+
+ // For a table, the cell ids in row-major order, with duplicate entries
+ // when there's a rowspan or colspan, and with -1 for missing cells.
+ // There are always exactly rows * columns entries.
+ ax_attr_cell_ids,
+
+ // For a table, the unique cell ids in row-major order of their first
+ // occurrence.
+ ax_attr_unique_cell_ids,
+
+ // For inline text. This is the pixel position of the end of this
+ // character within the bounding rectangle of this object, in the
+ // direction given by AX_ATTR_TEXT_DIRECTION. For example, for left-to-right
+ // text, the first offset is the right coordinate of the first character
+ // within the object's bounds, the second offset is the right coordinate
+ // of the second character, and so on.
+ ax_attr_character_offsets,
+
+ // For inline text. These int lists must be the same size; they represent
+ // the start and end character index of each word within this text.
+ ax_attr_word_starts,
+ ax_attr_word_ends
+ };
+
+ [cpp_omit_enum_type] enum AXTextDirection {
+ ax_text_direction_lr,
+ ax_text_direction_rl,
+ ax_text_direction_tb,
+ ax_text_direction_bt
+ };
+};
diff --git a/ui/accessibility/ax_node_data.cc b/ui/accessibility/ax_node_data.cc
index 2e8b9c2..9a796a3 100644
--- a/ui/accessibility/ax_node_data.cc
+++ b/ui/accessibility/ax_node_data.cc
@@ -76,121 +76,7 @@ std::string AXNodeData::ToString() const {
std::string result;
result += "id=" + IntToString(id);
-
- switch (role) {
- case ui::AX_ROLE_ALERT: result += " ALERT"; break;
- case ui::AX_ROLE_ALERT_DIALOG: result += " ALERT_DIALOG"; break;
- case ui::AX_ROLE_ANNOTATION: result += " ANNOTATION"; break;
- case ui::AX_ROLE_APPLICATION: result += " APPLICATION"; break;
- case ui::AX_ROLE_ARTICLE: result += " ARTICLE"; break;
- case ui::AX_ROLE_BANNER: result += " BANNER"; break;
- case ui::AX_ROLE_BROWSER: result += " BROWSER"; break;
- case ui::AX_ROLE_BUSY_INDICATOR: result += " BUSY_INDICATOR"; break;
- case ui::AX_ROLE_BUTTON: result += " BUTTON"; break;
- case ui::AX_ROLE_CANVAS: result += " CANVAS"; break;
- case ui::AX_ROLE_CELL: result += " CELL"; break;
- case ui::AX_ROLE_CHECK_BOX: result += " CHECKBOX"; break;
- case ui::AX_ROLE_COLOR_WELL: result += " COLOR_WELL"; break;
- case ui::AX_ROLE_COLUMN: result += " COLUMN"; break;
- case ui::AX_ROLE_COLUMN_HEADER: result += " COLUMN_HEADER"; break;
- case ui::AX_ROLE_COMBO_BOX: result += " COMBO_BOX"; break;
- case ui::AX_ROLE_COMPLEMENTARY: result += " COMPLEMENTARY"; break;
- case ui::AX_ROLE_CONTENT_INFO: result += " CONTENTINFO"; break;
- case ui::AX_ROLE_DEFINITION: result += " DEFINITION"; break;
- case ui::AX_ROLE_DESCRIPTION_LIST_DETAIL: result += " DD"; break;
- case ui::AX_ROLE_DESCRIPTION_LIST_TERM: result += " DT"; break;
- case ui::AX_ROLE_DIALOG: result += " DIALOG"; break;
- case ui::AX_ROLE_DIRECTORY: result += " DIRECTORY"; break;
- case ui::AX_ROLE_DISCLOSURE_TRIANGLE:
- result += " DISCLOSURE_TRIANGLE"; break;
- case ui::AX_ROLE_DIV: result += " DIV"; break;
- case ui::AX_ROLE_DOCUMENT: result += " DOCUMENT"; break;
- case ui::AX_ROLE_DRAWER: result += " DRAWER"; break;
- case ui::AX_ROLE_EDITABLE_TEXT: result += " EDITABLE_TEXT"; break;
- case ui::AX_ROLE_FOOTER: result += " FOOTER"; break;
- case ui::AX_ROLE_FORM: result += " FORM"; break;
- case ui::AX_ROLE_GRID: result += " GRID"; break;
- case ui::AX_ROLE_GROUP: result += " GROUP"; break;
- case ui::AX_ROLE_GROW_AREA: result += " GROW_AREA"; break;
- case ui::AX_ROLE_HEADING: result += " HEADING"; break;
- case ui::AX_ROLE_HELP_TAG: result += " HELP_TAG"; break;
- case ui::AX_ROLE_HORIZONTAL_RULE: result += " HORIZONTAL_RULE"; break;
- case ui::AX_ROLE_IGNORED: result += " IGNORED"; break;
- case ui::AX_ROLE_IMAGE: result += " IMAGE"; break;
- case ui::AX_ROLE_IMAGE_MAP: result += " IMAGE_MAP"; break;
- case ui::AX_ROLE_IMAGE_MAP_LINK: result += " IMAGE_MAP_LINK"; break;
- case ui::AX_ROLE_INCREMENTOR: result += " INCREMENTOR"; break;
- case ui::AX_ROLE_INLINE_TEXT_BOX: result += " INLINE_TEXT_BOX"; break;
- case ui::AX_ROLE_LABEL: result += " LABEL"; break;
- case ui::AX_ROLE_LINK: result += " LINK"; break;
- case ui::AX_ROLE_LIST: result += " LIST"; break;
- case ui::AX_ROLE_LIST_BOX: result += " LISTBOX"; break;
- case ui::AX_ROLE_LIST_BOX_OPTION: result += " LISTBOX_OPTION"; break;
- case ui::AX_ROLE_LIST_ITEM: result += " LIST_ITEM"; break;
- case ui::AX_ROLE_LIST_MARKER: result += " LIST_MARKER"; break;
- case ui::AX_ROLE_LOG: result += " LOG"; break;
- case ui::AX_ROLE_MAIN: result += " MAIN"; break;
- case ui::AX_ROLE_MARQUEE: result += " MARQUEE"; break;
- case ui::AX_ROLE_MATH: result += " MATH"; break;
- case ui::AX_ROLE_MATTE: result += " MATTE"; break;
- case ui::AX_ROLE_MENU: result += " MENU"; break;
- case ui::AX_ROLE_MENU_BAR: result += " MENU_BAR"; break;
- case ui::AX_ROLE_MENU_BUTTON: result += " MENU_BUTTON"; break;
- case ui::AX_ROLE_MENU_ITEM: result += " MENU_ITEM"; break;
- case ui::AX_ROLE_MENU_LIST_OPTION: result += " MENU_LIST_OPTION"; break;
- case ui::AX_ROLE_MENU_LIST_POPUP: result += " MENU_LIST_POPUP"; break;
- case ui::AX_ROLE_NAVIGATION: result += " NAVIGATION"; break;
- case ui::AX_ROLE_NOTE: result += " NOTE"; break;
- case ui::AX_ROLE_OUTLINE: result += " OUTLINE"; break;
- case ui::AX_ROLE_PARAGRAPH: result += " PARAGRAPH"; break;
- case ui::AX_ROLE_POP_UP_BUTTON: result += " POPUP_BUTTON"; break;
- case ui::AX_ROLE_PRESENTATIONAL: result += " PRESENTATIONAL"; break;
- case ui::AX_ROLE_PROGRESS_INDICATOR:
- result += " PROGRESS_INDICATOR"; break;
- case ui::AX_ROLE_RADIO_BUTTON: result += " RADIO_BUTTON"; break;
- case ui::AX_ROLE_RADIO_GROUP: result += " RADIO_GROUP"; break;
- case ui::AX_ROLE_REGION: result += " REGION"; break;
- case ui::AX_ROLE_ROOT_WEB_AREA: result += " ROOT_WEB_AREA"; break;
- case ui::AX_ROLE_ROW: result += " ROW"; break;
- case ui::AX_ROLE_ROW_HEADER: result += " ROW_HEADER"; break;
- case ui::AX_ROLE_RULER: result += " RULER"; break;
- case ui::AX_ROLE_RULER_MARKER: result += " RULER_MARKER"; break;
- case ui::AX_ROLE_SVG_ROOT: result += " SVG_ROOT"; break;
- case ui::AX_ROLE_SCROLL_AREA: result += " SCROLLAREA"; break;
- case ui::AX_ROLE_SCROLL_BAR: result += " SCROLLBAR"; break;
- case ui::AX_ROLE_SEARCH: result += " SEARCH"; break;
- case ui::AX_ROLE_SHEET: result += " SHEET"; break;
- case ui::AX_ROLE_SLIDER: result += " SLIDER"; break;
- case ui::AX_ROLE_SLIDER_THUMB: result += " SLIDER_THUMB"; break;
- case ui::AX_ROLE_SPIN_BUTTON: result += " SPIN_BUTTON"; break;
- case ui::AX_ROLE_SPIN_BUTTON_PART: result += " SPIN_BUTTON_PART"; break;
- case ui::AX_ROLE_SPLIT_GROUP: result += " SPLIT_GROUP"; break;
- case ui::AX_ROLE_SPLITTER: result += " SPLITTER"; break;
- case ui::AX_ROLE_STATIC_TEXT: result += " STATIC_TEXT"; break;
- case ui::AX_ROLE_STATUS: result += " STATUS"; break;
- case ui::AX_ROLE_SYSTEM_WIDE: result += " SYSTEM_WIDE"; break;
- case ui::AX_ROLE_TAB: result += " TAB"; break;
- case ui::AX_ROLE_TAB_LIST: result += " TAB_LIST"; break;
- case ui::AX_ROLE_TAB_PANEL: result += " TAB_PANEL"; break;
- case ui::AX_ROLE_TABLE: result += " TABLE"; break;
- case ui::AX_ROLE_TABLE_HEADER_CONTAINER:
- result += " TABLE_HDR_CONTAINER"; break;
- case ui::AX_ROLE_TEXT_AREA: result += " TEXTAREA"; break;
- case ui::AX_ROLE_TEXT_FIELD: result += " TEXT_FIELD"; break;
- case ui::AX_ROLE_TIMER: result += " TIMER"; break;
- case ui::AX_ROLE_TOGGLE_BUTTON: result += " TOGGLE_BUTTON"; break;
- case ui::AX_ROLE_TOOLBAR: result += " TOOLBAR"; break;
- case ui::AX_ROLE_TREE: result += " TREE"; break;
- case ui::AX_ROLE_TREE_GRID: result += " TREE_GRID"; break;
- case ui::AX_ROLE_TREE_ITEM: result += " TREE_ITEM"; break;
- case ui::AX_ROLE_UNKNOWN: result += " UNKNOWN"; break;
- case ui::AX_ROLE_TOOLTIP: result += " TOOLTIP"; break;
- case ui::AX_ROLE_VALUE_INDICATOR: result += " VALUE_INDICATOR"; break;
- case ui::AX_ROLE_WEB_AREA: result += " WEB_AREA"; break;
- case ui::AX_ROLE_WINDOW: result += " WINDOW"; break;
- default:
- assert(false);
- }
+ result += " " + ui::ToString(role);
if (state & (1 << ui::AX_STATE_BUSY))
result += " BUSY";
@@ -222,7 +108,7 @@ std::string AXNodeData::ToString() const {
result += " PRESSED";
if (state & (1 << ui::AX_STATE_PROTECTED))
result += " PROTECTED";
- if (state & (1 << ui::AX_STATE_READONLY))
+ if (state & (1 << ui::AX_STATE_READ_ONLY))
result += " READONLY";
if (state & (1 << ui::AX_STATE_REQUIRED))
result += " REQUIRED";
@@ -332,6 +218,8 @@ std::string AXNodeData::ToString() const {
break;
}
break;
+ case AX_INT_ATTRIBUTE_NONE:
+ break;
}
}
@@ -395,6 +283,8 @@ std::string AXNodeData::ToString() const {
case AX_ATTR_VALUE:
result += " value=" + value;
break;
+ case AX_STRING_ATTRIBUTE_NONE:
+ break;
}
}
@@ -413,6 +303,8 @@ std::string AXNodeData::ToString() const {
case AX_ATTR_MIN_VALUE_FOR_RANGE:
result += " min_value=" + value;
break;
+ case AX_FLOAT_ATTRIBUTE_NONE:
+ break;
}
}
@@ -449,6 +341,8 @@ std::string AXNodeData::ToString() const {
case AX_ATTR_CANVAS_HAS_FALLBACK:
result += " has_fallback=" + value;
break;
+ case AX_BOOL_ATTRIBUTE_NONE:
+ break;
}
}
@@ -476,6 +370,8 @@ std::string AXNodeData::ToString() const {
case AX_ATTR_WORD_ENDS:
result += " word_ends=" + IntVectorToString(values);
break;
+ case AX_INT_LIST_ATTRIBUTE_NONE:
+ break;
}
}