Index: content/renderer/accessibility/accessibility_node_serializer.cc |
diff --git a/content/renderer/accessibility/accessibility_node_serializer.cc b/content/renderer/accessibility/accessibility_node_serializer.cc |
index 6bace0e9a9c63e8121f5641245d12778dea69915..798aab19da61fdb6d7949d6a83ffce2b225c212c 100644 |
--- a/content/renderer/accessibility/accessibility_node_serializer.cc |
+++ b/content/renderer/accessibility/accessibility_node_serializer.cc |
@@ -9,6 +9,7 @@ |
#include "base/strings/string_number_conversions.h" |
#include "base/strings/string_util.h" |
#include "base/strings/utf_string_conversions.h" |
+#include "content/renderer/accessibility/blink_ax_enum_conversion.h" |
#include "third_party/WebKit/public/platform/WebRect.h" |
#include "third_party/WebKit/public/platform/WebSize.h" |
#include "third_party/WebKit/public/platform/WebString.h" |
@@ -23,6 +24,7 @@ |
#include "third_party/WebKit/public/web/WebInputElement.h" |
#include "third_party/WebKit/public/web/WebNode.h" |
+using base::UTF16ToUTF8; |
using blink::WebAXObject; |
using blink::WebDocument; |
using blink::WebDocumentType; |
@@ -49,111 +51,35 @@ bool IsParentUnignoredOf(const WebAXObject& ancestor, |
return LowerCaseEqualsASCII(html_value, "true"); |
} |
-// Provides a conversion between the WebAXObject state |
-// accessors and a state bitmask that can be serialized and sent to the |
-// Browser process. Rare state are sent as boolean attributes instead. |
-uint32 ConvertState(const WebAXObject& o) { |
- uint32 state = 0; |
- if (o.isChecked()) |
- state |= (1 << blink::WebAXStateChecked); |
- |
- if (o.isCollapsed()) |
- state |= (1 << blink::WebAXStateCollapsed); |
- |
- if (o.canSetFocusAttribute()) |
- state |= (1 << blink::WebAXStateFocusable); |
- |
- if (o.isFocused()) |
- state |= (1 << blink::WebAXStateFocused); |
- |
- if (o.role() == blink::WebAXRolePopUpButton || |
- o.ariaHasPopup()) { |
- state |= (1 << blink::WebAXStateHaspopup); |
- if (!o.isCollapsed()) |
- state |= (1 << blink::WebAXStateExpanded); |
- } |
- |
- if (o.isHovered()) |
- state |= (1 << blink::WebAXStateHovered); |
- |
- if (o.isIndeterminate()) |
- state |= (1 << blink::WebAXStateIndeterminate); |
- |
- if (!o.isVisible()) |
- state |= (1 << blink::WebAXStateInvisible); |
- |
- if (o.isLinked()) |
- state |= (1 << blink::WebAXStateLinked); |
- |
- if (o.isMultiSelectable()) |
- state |= (1 << blink::WebAXStateMultiselectable); |
- |
- if (o.isOffScreen()) |
- state |= (1 << blink::WebAXStateOffscreen); |
- |
- if (o.isPressed()) |
- state |= (1 << blink::WebAXStatePressed); |
- |
- if (o.isPasswordField()) |
- state |= (1 << blink::WebAXStateProtected); |
- |
- if (o.isReadOnly()) |
- state |= (1 << blink::WebAXStateReadonly); |
- |
- if (o.isRequired()) |
- state |= (1 << blink::WebAXStateRequired); |
- |
- if (o.canSetSelectedAttribute()) |
- state |= (1 << blink::WebAXStateSelectable); |
- |
- if (o.isSelected()) |
- state |= (1 << blink::WebAXStateSelected); |
- |
- if (o.isVisited()) |
- state |= (1 << blink::WebAXStateVisited); |
- |
- if (o.isEnabled()) |
- state |= (1 << blink::WebAXStateEnabled); |
- |
- if (o.isVertical()) |
- state |= (1 << blink::WebAXStateVertical); |
- |
- if (o.isVisited()) |
- state |= (1 << blink::WebAXStateVisited); |
- |
- return state; |
-} |
- |
} // Anonymous namespace |
void SerializeAccessibilityNode( |
const WebAXObject& src, |
- AccessibilityNodeData* dst) { |
- dst->role = src.role(); |
- dst->state = ConvertState(src); |
+ ui::AXNodeData* dst) { |
+ dst->role = AXRoleFromBlink(src.role()); |
+ dst->state = AXStateFromBlink(src); |
dst->location = src.boundingBoxRect(); |
dst->id = src.axID(); |
std::string name = base::UTF16ToUTF8(src.title()); |
std::string value; |
if (src.valueDescription().length()) { |
- dst->AddStringAttribute(dst->ATTR_VALUE, |
- base::UTF16ToUTF8(src.valueDescription())); |
+ dst->AddStringAttribute(ui::AX_ATTR_VALUE, |
+ UTF16ToUTF8(src.valueDescription())); |
} else { |
- dst->AddStringAttribute(dst->ATTR_VALUE, |
- base::UTF16ToUTF8(src.stringValue())); |
+ dst->AddStringAttribute(ui::AX_ATTR_VALUE, UTF16ToUTF8(src.stringValue())); |
} |
- if (dst->role == blink::WebAXRoleColorWell) { |
+ if (dst->role == ui::AX_ROLE_COLOR_WELL) { |
int r, g, b; |
src.colorValue(r, g, b); |
- dst->AddIntAttribute(dst->ATTR_COLOR_VALUE_RED, r); |
- dst->AddIntAttribute(dst->ATTR_COLOR_VALUE_GREEN, g); |
- dst->AddIntAttribute(dst->ATTR_COLOR_VALUE_BLUE, b); |
+ dst->AddIntAttribute(ui::AX_ATTR_COLOR_VALUE_RED, r); |
+ dst->AddIntAttribute(ui::AX_ATTR_COLOR_VALUE_GREEN, g); |
+ dst->AddIntAttribute(ui::AX_ATTR_COLOR_VALUE_BLUE, b); |
} |
- if (dst->role == blink::WebAXRoleInlineTextBox) { |
- dst->AddIntAttribute(dst->ATTR_TEXT_DIRECTION, src.textDirection()); |
+ if (dst->role == ui::AX_ROLE_INLINE_TEXT_BOX) { |
+ dst->AddIntAttribute(ui::AX_ATTR_TEXT_DIRECTION, src.textDirection()); |
WebVector<int> src_character_offsets; |
src.characterOffsets(src_character_offsets); |
@@ -161,7 +87,7 @@ void SerializeAccessibilityNode( |
character_offsets.reserve(src_character_offsets.size()); |
for (size_t i = 0; i < src_character_offsets.size(); ++i) |
character_offsets.push_back(src_character_offsets[i]); |
- dst->AddIntListAttribute(dst->ATTR_CHARACTER_OFFSETS, character_offsets); |
+ dst->AddIntListAttribute(ui::AX_ATTR_CHARACTER_OFFSETS, character_offsets); |
WebVector<int> src_word_starts; |
WebVector<int> src_word_ends; |
@@ -174,61 +100,59 @@ void SerializeAccessibilityNode( |
word_starts.push_back(src_word_starts[i]); |
word_ends.push_back(src_word_ends[i]); |
} |
- dst->AddIntListAttribute(dst->ATTR_WORD_STARTS, word_starts); |
- dst->AddIntListAttribute(dst->ATTR_WORD_ENDS, word_ends); |
+ dst->AddIntListAttribute(ui::AX_ATTR_WORD_STARTS, word_starts); |
+ dst->AddIntListAttribute(ui::AX_ATTR_WORD_ENDS, word_ends); |
} |
- if (src.accessKey().length()) { |
- dst->AddStringAttribute(dst->ATTR_ACCESS_KEY, |
- base::UTF16ToUTF8(src.accessKey())); |
- } |
- if (src.actionVerb().length()) { |
- dst->AddStringAttribute(dst->ATTR_ACTION, |
- base::UTF16ToUTF8(src.actionVerb())); |
- } |
+ if (src.accessKey().length()) |
+ dst->AddStringAttribute(ui::AX_ATTR_ACCESS_KEY, |
+ UTF16ToUTF8(src.accessKey())); |
+ if (src.actionVerb().length()) |
+ dst->AddStringAttribute(ui::AX_ATTR_ACTION, UTF16ToUTF8(src.actionVerb())); |
if (src.isAriaReadOnly()) |
- dst->AddBoolAttribute(dst->ATTR_ARIA_READONLY, true); |
+ dst->AddBoolAttribute(ui::AX_ATTR_ARIA_READONLY, true); |
if (src.isButtonStateMixed()) |
- dst->AddBoolAttribute(dst->ATTR_BUTTON_MIXED, true); |
+ dst->AddBoolAttribute(ui::AX_ATTR_BUTTON_MIXED, true); |
if (src.canSetValueAttribute()) |
- dst->AddBoolAttribute(dst->ATTR_CAN_SET_VALUE, true); |
+ dst->AddBoolAttribute(ui::AX_ATTR_CAN_SET_VALUE, true); |
if (src.accessibilityDescription().length()) { |
- dst->AddStringAttribute(dst->ATTR_DESCRIPTION, |
- base::UTF16ToUTF8(src.accessibilityDescription())); |
+ dst->AddStringAttribute(ui::AX_ATTR_DESCRIPTION, |
+ UTF16ToUTF8(src.accessibilityDescription())); |
} |
if (src.hasComputedStyle()) { |
- dst->AddStringAttribute(dst->ATTR_DISPLAY, |
- base::UTF16ToUTF8(src.computedStyleDisplay())); |
+ dst->AddStringAttribute(ui::AX_ATTR_DISPLAY, |
+ UTF16ToUTF8(src.computedStyleDisplay())); |
} |
if (src.helpText().length()) |
- dst->AddStringAttribute(dst->ATTR_HELP, base::UTF16ToUTF8(src.helpText())); |
+ dst->AddStringAttribute(ui::AX_ATTR_HELP, UTF16ToUTF8(src.helpText())); |
if (src.keyboardShortcut().length()) { |
- dst->AddStringAttribute(dst->ATTR_SHORTCUT, |
- base::UTF16ToUTF8(src.keyboardShortcut())); |
+ dst->AddStringAttribute(ui::AX_ATTR_SHORTCUT, |
+ UTF16ToUTF8(src.keyboardShortcut())); |
} |
if (!src.titleUIElement().isDetached()) { |
- dst->AddIntAttribute(dst->ATTR_TITLE_UI_ELEMENT, |
+ dst->AddIntAttribute(ui::AX_ATTR_TITLE_UI_ELEMENT, |
src.titleUIElement().axID()); |
} |
if (!src.url().isEmpty()) |
- dst->AddStringAttribute(dst->ATTR_URL, src.url().spec()); |
+ dst->AddStringAttribute(ui::AX_ATTR_URL, src.url().spec()); |
- if (dst->role == blink::WebAXRoleHeading) |
- dst->AddIntAttribute(dst->ATTR_HIERARCHICAL_LEVEL, src.headingLevel()); |
- else if ((dst->role == blink::WebAXRoleTreeItem || |
- dst->role == blink::WebAXRoleRow) && |
+ if (dst->role == ui::AX_ROLE_HEADING) |
+ dst->AddIntAttribute(ui::AX_ATTR_HIERARCHICAL_LEVEL, src.headingLevel()); |
+ else if ((dst->role == ui::AX_ROLE_TREE_ITEM || |
+ dst->role == ui::AX_ROLE_ROW) && |
src.hierarchicalLevel() > 0) { |
- dst->AddIntAttribute(dst->ATTR_HIERARCHICAL_LEVEL, src.hierarchicalLevel()); |
+ dst->AddIntAttribute(ui::AX_ATTR_HIERARCHICAL_LEVEL, |
+ src.hierarchicalLevel()); |
} |
// Treat the active list box item as focused. |
- if (dst->role == blink::WebAXRoleListBoxOption && |
+ if (dst->role == ui::AX_ROLE_LIST_BOX_OPTION && |
src.isSelectedOptionActive()) { |
- dst->state |= (1 << blink::WebAXStateFocused); |
+ dst->state |= (1 << ui::AX_STATE_FOCUSED); |
} |
if (src.canvasHasFallbackContent()) |
- dst->AddBoolAttribute(dst->ATTR_CANVAS_HAS_FALLBACK, true); |
+ dst->AddBoolAttribute(ui::AX_ATTR_CANVAS_HAS_FALLBACK, true); |
WebNode node = src.node(); |
bool is_iframe = false; |
@@ -242,14 +166,14 @@ void SerializeAccessibilityNode( |
is_iframe = (element.tagName() == base::ASCIIToUTF16("IFRAME")); |
if (LowerCaseEqualsASCII(element.getAttribute("aria-expanded"), "true")) |
- dst->state |= (1 << blink::WebAXStateExpanded); |
+ dst->state |= (1 << ui::AX_STATE_EXPANDED); |
// TODO(ctguil): The tagName in WebKit is lower cased but |
// HTMLElement::nodeName calls localNameUpper. Consider adding |
// a WebElement method that returns the original lower cased tagName. |
dst->AddStringAttribute( |
- dst->ATTR_HTML_TAG, |
- StringToLowerASCII(base::UTF16ToUTF8(element.tagName()))); |
+ ui::AX_ATTR_HTML_TAG, |
+ StringToLowerASCII(UTF16ToUTF8(element.tagName()))); |
for (unsigned i = 0; i < element.attributeCount(); ++i) { |
std::string name = StringToLowerASCII(base::UTF16ToUTF8( |
element.attributeLocalName(i))); |
@@ -257,11 +181,11 @@ void SerializeAccessibilityNode( |
dst->html_attributes.push_back(std::make_pair(name, value)); |
} |
- if (dst->role == blink::WebAXRoleEditableText || |
- dst->role == blink::WebAXRoleTextArea || |
- dst->role == blink::WebAXRoleTextField) { |
- dst->AddIntAttribute(dst->ATTR_TEXT_SEL_START, src.selectionStart()); |
- dst->AddIntAttribute(dst->ATTR_TEXT_SEL_END, src.selectionEnd()); |
+ if (dst->role == ui::AX_ROLE_EDITABLE_TEXT || |
+ dst->role == ui::AX_ROLE_TEXT_AREA || |
+ dst->role == ui::AX_ROLE_TEXT_FIELD) { |
+ dst->AddIntAttribute(ui::AX_ATTR_TEXT_SEL_START, src.selectionStart()); |
+ dst->AddIntAttribute(ui::AX_ATTR_TEXT_SEL_END, src.selectionEnd()); |
WebVector<int> src_line_breaks; |
src.lineBreaks(src_line_breaks); |
@@ -270,14 +194,14 @@ void SerializeAccessibilityNode( |
line_breaks.reserve(src_line_breaks.size()); |
for (size_t i = 0; i < src_line_breaks.size(); ++i) |
line_breaks.push_back(src_line_breaks[i]); |
- dst->AddIntListAttribute(dst->ATTR_LINE_BREAKS, line_breaks); |
+ dst->AddIntListAttribute(ui::AX_ATTR_LINE_BREAKS, line_breaks); |
} |
} |
// ARIA role. |
if (element.hasAttribute("role")) { |
- dst->AddStringAttribute(dst->ATTR_ROLE, |
- base::UTF16ToUTF8(element.getAttribute("role"))); |
+ dst->AddStringAttribute(ui::AX_ATTR_ROLE, |
+ UTF16ToUTF8(element.getAttribute("role"))); |
} |
// Live region attributes |
@@ -322,89 +246,89 @@ void SerializeAccessibilityNode( |
} |
if (!live_atomic.empty()) |
- dst->AddBoolAttribute(dst->ATTR_LIVE_ATOMIC, IsTrue(live_atomic)); |
+ dst->AddBoolAttribute(ui::AX_ATTR_LIVE_ATOMIC, IsTrue(live_atomic)); |
if (!live_busy.empty()) |
- dst->AddBoolAttribute(dst->ATTR_LIVE_BUSY, IsTrue(live_busy)); |
+ dst->AddBoolAttribute(ui::AX_ATTR_LIVE_BUSY, IsTrue(live_busy)); |
if (!live_status.empty()) |
- dst->AddStringAttribute(dst->ATTR_LIVE_STATUS, live_status); |
+ dst->AddStringAttribute(ui::AX_ATTR_LIVE_STATUS, live_status); |
if (!live_relevant.empty()) |
- dst->AddStringAttribute(dst->ATTR_LIVE_RELEVANT, live_relevant); |
+ dst->AddStringAttribute(ui::AX_ATTR_LIVE_RELEVANT, live_relevant); |
if (!container_live_atomic.empty()) { |
- dst->AddBoolAttribute(dst->ATTR_CONTAINER_LIVE_ATOMIC, |
+ dst->AddBoolAttribute(ui::AX_ATTR_CONTAINER_LIVE_ATOMIC, |
IsTrue(container_live_atomic)); |
} |
if (!container_live_busy.empty()) { |
- dst->AddBoolAttribute(dst->ATTR_CONTAINER_LIVE_BUSY, |
+ dst->AddBoolAttribute(ui::AX_ATTR_CONTAINER_LIVE_BUSY, |
IsTrue(container_live_busy)); |
} |
if (!container_live_status.empty()) { |
- dst->AddStringAttribute(dst->ATTR_CONTAINER_LIVE_STATUS, |
+ dst->AddStringAttribute(ui::AX_ATTR_CONTAINER_LIVE_STATUS, |
container_live_status); |
} |
if (!container_live_relevant.empty()) { |
- dst->AddStringAttribute(dst->ATTR_CONTAINER_LIVE_RELEVANT, |
+ dst->AddStringAttribute(ui::AX_ATTR_CONTAINER_LIVE_RELEVANT, |
container_live_relevant); |
} |
- if (dst->role == blink::WebAXRoleProgressIndicator || |
- dst->role == blink::WebAXRoleScrollBar || |
- dst->role == blink::WebAXRoleSlider || |
- dst->role == blink::WebAXRoleSpinButton) { |
- dst->AddFloatAttribute(dst->ATTR_VALUE_FOR_RANGE, src.valueForRange()); |
- dst->AddFloatAttribute(dst->ATTR_MAX_VALUE_FOR_RANGE, |
+ if (dst->role == ui::AX_ROLE_PROGRESS_INDICATOR || |
+ dst->role == ui::AX_ROLE_SCROLL_BAR || |
+ dst->role == ui::AX_ROLE_SLIDER || |
+ dst->role == ui::AX_ROLE_SPIN_BUTTON) { |
+ dst->AddFloatAttribute(ui::AX_ATTR_VALUE_FOR_RANGE, src.valueForRange()); |
+ dst->AddFloatAttribute(ui::AX_ATTR_MAX_VALUE_FOR_RANGE, |
src.maxValueForRange()); |
- dst->AddFloatAttribute(dst->ATTR_MIN_VALUE_FOR_RANGE, |
+ dst->AddFloatAttribute(ui::AX_ATTR_MIN_VALUE_FOR_RANGE, |
src.minValueForRange()); |
} |
- if (dst->role == blink::WebAXRoleDocument || |
- dst->role == blink::WebAXRoleWebArea) { |
- dst->AddStringAttribute(dst->ATTR_HTML_TAG, "#document"); |
+ if (dst->role == ui::AX_ROLE_DOCUMENT || |
+ dst->role == ui::AX_ROLE_WEB_AREA) { |
+ dst->AddStringAttribute(ui::AX_ATTR_HTML_TAG, "#document"); |
const WebDocument& document = src.document(); |
if (name.empty()) |
- name = base::UTF16ToUTF8(document.title()); |
- dst->AddStringAttribute(dst->ATTR_DOC_TITLE, |
- base::UTF16ToUTF8(document.title())); |
- dst->AddStringAttribute(dst->ATTR_DOC_URL, document.url().spec()); |
+ name = UTF16ToUTF8(document.title()); |
+ dst->AddStringAttribute(ui::AX_ATTR_DOC_TITLE, |
+ UTF16ToUTF8(document.title())); |
+ dst->AddStringAttribute(ui::AX_ATTR_DOC_URL, document.url().spec()); |
dst->AddStringAttribute( |
- dst->ATTR_DOC_MIMETYPE, |
+ ui::AX_ATTR_DOC_MIMETYPE, |
document.isXHTMLDocument() ? "text/xhtml" : "text/html"); |
- dst->AddBoolAttribute(dst->ATTR_DOC_LOADED, src.isLoaded()); |
- dst->AddFloatAttribute(dst->ATTR_DOC_LOADING_PROGRESS, |
+ dst->AddBoolAttribute(ui::AX_ATTR_DOC_LOADED, src.isLoaded()); |
+ dst->AddFloatAttribute(ui::AX_ATTR_DOC_LOADING_PROGRESS, |
src.estimatedLoadingProgress()); |
const WebDocumentType& doctype = document.doctype(); |
if (!doctype.isNull()) { |
- dst->AddStringAttribute(dst->ATTR_DOC_DOCTYPE, |
- base::UTF16ToUTF8(doctype.name())); |
+ dst->AddStringAttribute(ui::AX_ATTR_DOC_DOCTYPE, |
+ UTF16ToUTF8(doctype.name())); |
} |
const gfx::Size& scroll_offset = document.frame()->scrollOffset(); |
- dst->AddIntAttribute(dst->ATTR_SCROLL_X, scroll_offset.width()); |
- dst->AddIntAttribute(dst->ATTR_SCROLL_Y, scroll_offset.height()); |
+ dst->AddIntAttribute(ui::AX_ATTR_SCROLL_X, scroll_offset.width()); |
+ dst->AddIntAttribute(ui::AX_ATTR_SCROLL_Y, scroll_offset.height()); |
const gfx::Size& min_offset = document.frame()->minimumScrollOffset(); |
- dst->AddIntAttribute(dst->ATTR_SCROLL_X_MIN, min_offset.width()); |
- dst->AddIntAttribute(dst->ATTR_SCROLL_Y_MIN, min_offset.height()); |
+ dst->AddIntAttribute(ui::AX_ATTR_SCROLL_X_MIN, min_offset.width()); |
+ dst->AddIntAttribute(ui::AX_ATTR_SCROLL_Y_MIN, min_offset.height()); |
const gfx::Size& max_offset = document.frame()->maximumScrollOffset(); |
- dst->AddIntAttribute(dst->ATTR_SCROLL_X_MAX, max_offset.width()); |
- dst->AddIntAttribute(dst->ATTR_SCROLL_Y_MAX, max_offset.height()); |
+ dst->AddIntAttribute(ui::AX_ATTR_SCROLL_X_MAX, max_offset.width()); |
+ dst->AddIntAttribute(ui::AX_ATTR_SCROLL_Y_MAX, max_offset.height()); |
} |
- if (dst->role == blink::WebAXRoleTable) { |
+ if (dst->role == ui::AX_ROLE_TABLE) { |
int column_count = src.columnCount(); |
int row_count = src.rowCount(); |
if (column_count > 0 && row_count > 0) { |
std::set<int32> unique_cell_id_set; |
std::vector<int32> cell_ids; |
std::vector<int32> unique_cell_ids; |
- dst->AddIntAttribute(dst->ATTR_TABLE_COLUMN_COUNT, column_count); |
- dst->AddIntAttribute(dst->ATTR_TABLE_ROW_COUNT, row_count); |
+ dst->AddIntAttribute(ui::AX_ATTR_TABLE_COLUMN_COUNT, column_count); |
+ dst->AddIntAttribute(ui::AX_ATTR_TABLE_ROW_COUNT, row_count); |
WebAXObject header = src.headerContainerObject(); |
if (!header.isDetached()) |
- dst->AddIntAttribute(dst->ATTR_TABLE_HEADER_ID, header.axID()); |
+ dst->AddIntAttribute(ui::AX_ATTR_TABLE_HEADER_ID, header.axID()); |
for (int i = 0; i < column_count * row_count; ++i) { |
WebAXObject cell = src.cellForColumnAndRow( |
i % column_count, i / column_count); |
@@ -418,37 +342,37 @@ void SerializeAccessibilityNode( |
} |
cell_ids.push_back(cell_id); |
} |
- dst->AddIntListAttribute(dst->ATTR_CELL_IDS, cell_ids); |
- dst->AddIntListAttribute(dst->ATTR_UNIQUE_CELL_IDS, unique_cell_ids); |
+ dst->AddIntListAttribute(ui::AX_ATTR_CELL_IDS, cell_ids); |
+ dst->AddIntListAttribute(ui::AX_ATTR_UNIQUE_CELL_IDS, unique_cell_ids); |
} |
} |
- if (dst->role == blink::WebAXRoleRow) { |
- dst->AddIntAttribute(dst->ATTR_TABLE_ROW_INDEX, src.rowIndex()); |
+ if (dst->role == ui::AX_ROLE_ROW) { |
+ dst->AddIntAttribute(ui::AX_ATTR_TABLE_ROW_INDEX, src.rowIndex()); |
WebAXObject header = src.rowHeader(); |
if (!header.isDetached()) |
- dst->AddIntAttribute(dst->ATTR_TABLE_ROW_HEADER_ID, header.axID()); |
+ dst->AddIntAttribute(ui::AX_ATTR_TABLE_ROW_HEADER_ID, header.axID()); |
} |
- if (dst->role == blink::WebAXRoleColumn) { |
- dst->AddIntAttribute(dst->ATTR_TABLE_COLUMN_INDEX, src.columnIndex()); |
+ if (dst->role == ui::AX_ROLE_COLUMN) { |
+ dst->AddIntAttribute(ui::AX_ATTR_TABLE_COLUMN_INDEX, src.columnIndex()); |
WebAXObject header = src.columnHeader(); |
if (!header.isDetached()) |
- dst->AddIntAttribute(dst->ATTR_TABLE_COLUMN_HEADER_ID, header.axID()); |
+ dst->AddIntAttribute(ui::AX_ATTR_TABLE_COLUMN_HEADER_ID, header.axID()); |
} |
- if (dst->role == blink::WebAXRoleCell || |
- dst->role == blink::WebAXRoleRowHeader || |
- dst->role == blink::WebAXRoleColumnHeader) { |
- dst->AddIntAttribute(dst->ATTR_TABLE_CELL_COLUMN_INDEX, |
+ if (dst->role == ui::AX_ROLE_CELL || |
+ dst->role == ui::AX_ROLE_ROW_HEADER || |
+ dst->role == ui::AX_ROLE_COLUMN_HEADER) { |
+ dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_COLUMN_INDEX, |
src.cellColumnIndex()); |
- dst->AddIntAttribute(dst->ATTR_TABLE_CELL_COLUMN_SPAN, |
+ dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_COLUMN_SPAN, |
src.cellColumnSpan()); |
- dst->AddIntAttribute(dst->ATTR_TABLE_CELL_ROW_INDEX, src.cellRowIndex()); |
- dst->AddIntAttribute(dst->ATTR_TABLE_CELL_ROW_SPAN, src.cellRowSpan()); |
+ dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_ROW_INDEX, src.cellRowIndex()); |
+ dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_ROW_SPAN, src.cellRowSpan()); |
} |
- dst->AddStringAttribute(dst->ATTR_NAME, name); |
+ dst->AddStringAttribute(ui::AX_ATTR_NAME, name); |
// Add the ids of *indirect* children - those who are children of this node, |
// but whose parent is *not* this node. One example is a table |
@@ -463,7 +387,7 @@ void SerializeAccessibilityNode( |
indirect_child_ids.push_back(child.axID()); |
if (indirect_child_ids.size() > 0) { |
dst->AddIntListAttribute( |
- dst->ATTR_INDIRECT_CHILD_IDS, indirect_child_ids); |
+ ui::AX_ATTR_INDIRECT_CHILD_IDS, indirect_child_ids); |
} |
} |
} |