Index: content/renderer/accessibility/blink_ax_tree_source.cc |
diff --git a/content/renderer/accessibility/blink_ax_tree_source.cc b/content/renderer/accessibility/blink_ax_tree_source.cc |
index b4094e0ded3c604bcc591f5515576fec3c302cec..858c3a0581aa53fd6fdaeb4f560449b0268aa107 100644 |
--- a/content/renderer/accessibility/blink_ax_tree_source.cc |
+++ b/content/renderer/accessibility/blink_ax_tree_source.cc |
@@ -138,12 +138,12 @@ AXContentTreeData BlinkAXTreeSource::GetTreeData() const { |
blink::WebDocument document = BlinkAXTreeSource::GetMainDocument(); |
const blink::WebAXObject& root = GetRoot(); |
- tree_data.title = document.title().utf8(); |
- tree_data.url = document.url().string().utf8(); |
- tree_data.mimetype = document.isXHTMLDocument() ? "text/xhtml" : "text/html"; |
+ tree_data.doctype = "html"; |
tree_data.loaded = root.isLoaded(); |
tree_data.loading_progress = root.estimatedLoadingProgress(); |
- tree_data.doctype = "html"; |
+ tree_data.mimetype = document.isXHTMLDocument() ? "text/xhtml" : "text/html"; |
+ tree_data.title = document.title().utf8(); |
+ tree_data.url = document.url().string().utf8(); |
WebAXObject focus = document.focusedAccessibilityObject(); |
if (!focus.isNull()) |
@@ -312,6 +312,12 @@ void BlinkAXTreeSource::SerializeNode(blink::WebAXObject src, |
if (src.color()) |
dst->AddIntAttribute(ui::AX_ATTR_COLOR, src.color()); |
+ if (src.fontFamily().length()) { |
+ WebAXObject parent = src.parentObject(); |
+ if (parent.isNull() || parent.fontFamily() != src.fontFamily()) |
+ dst->AddStringAttribute(ui::AX_ATTR_FONT_FAMILY, src.fontFamily().utf8()); |
+ } |
+ |
// Font size is in pixels. |
if (src.fontSize()) |
dst->AddFloatAttribute(ui::AX_ATTR_FONT_SIZE, src.fontSize()); |
@@ -320,7 +326,8 @@ void BlinkAXTreeSource::SerializeNode(blink::WebAXObject src, |
dst->AddIntAttribute(ui::AX_ATTR_INVALID_STATE, |
AXInvalidStateFromBlink(src.invalidState())); |
} |
- if (src.invalidState() == blink::WebAXInvalidStateOther) { |
+ if (src.invalidState() == blink::WebAXInvalidStateOther && |
+ src.ariaInvalidValue().length()) { |
dst->AddStringAttribute( |
ui::AX_ATTR_ARIA_INVALID_VALUE, src.ariaInvalidValue().utf8()); |
} |
@@ -367,25 +374,39 @@ void BlinkAXTreeSource::SerializeNode(blink::WebAXObject src, |
if (src.actionVerb().length()) { |
dst->AddStringAttribute(ui::AX_ATTR_ACTION, src.actionVerb().utf8()); |
} |
- if (src.ariaAutoComplete().length()) |
+ |
+ if (src.ariaAutoComplete().length()) { |
dst->AddStringAttribute( |
ui::AX_ATTR_AUTO_COMPLETE, |
src.ariaAutoComplete().utf8()); |
+ } |
+ |
if (src.isAriaReadOnly()) |
dst->AddBoolAttribute(ui::AX_ATTR_ARIA_READONLY, true); |
+ |
if (src.isButtonStateMixed()) |
dst->AddBoolAttribute(ui::AX_ATTR_STATE_MIXED, true); |
+ |
if (src.canSetValueAttribute()) |
dst->AddBoolAttribute(ui::AX_ATTR_CAN_SET_VALUE, true); |
+ |
if (src.hasComputedStyle()) { |
dst->AddStringAttribute( |
ui::AX_ATTR_DISPLAY, src.computedStyleDisplay().utf8()); |
} |
+ |
+ if (src.language().length()) { |
+ WebAXObject parent = src.parentObject(); |
+ if (parent.isNull() || parent.language() != src.language()) |
+ dst->AddStringAttribute(ui::AX_ATTR_LANGUAGE, src.language().utf8()); |
+ } |
+ |
if (src.keyboardShortcut().length()) { |
dst->AddStringAttribute( |
ui::AX_ATTR_SHORTCUT, |
src.keyboardShortcut().utf8()); |
} |
+ |
if (!src.ariaActiveDescendant().isDetached()) { |
dst->AddIntAttribute(ui::AX_ATTR_ACTIVEDESCENDANT_ID, |
src.ariaActiveDescendant().axID()); |