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 c2ca4ef477543a70210e16cff3f19ff754666ebe..51d753121b738a11b97a0be6cd895bdbfc46262a 100644 |
--- a/content/renderer/accessibility/blink_ax_tree_source.cc |
+++ b/content/renderer/accessibility/blink_ax_tree_source.cc |
@@ -60,10 +60,6 @@ bool IsParentUnignoredOf(WebAXObject ancestor, |
return parent.equals(ancestor); |
} |
-bool IsTrue(std::string html_value) { |
- return LowerCaseEqualsASCII(html_value, "true"); |
-} |
- |
std::string GetEquivalentAriaRoleString(const ui::AXRole role) { |
switch (role) { |
case ui::AX_ROLE_ARTICLE: |
@@ -313,10 +309,6 @@ void BlinkAXTreeSource::SerializeNode(blink::WebAXObject src, |
WebNode node = src.node(); |
bool is_iframe = false; |
- std::string live_atomic; |
- std::string live_busy; |
- std::string live_status; |
- std::string live_relevant; |
if (!node.isNull() && node.isElementNode()) { |
WebElement element = node.to<WebElement>(); |
@@ -371,12 +363,6 @@ void BlinkAXTreeSource::SerializeNode(blink::WebAXObject src, |
dst->AddStringAttribute(ui::AX_ATTR_ROLE, role); |
} |
- // Live region attributes |
- live_atomic = UTF16ToUTF8(element.getAttribute("aria-atomic")); |
- live_busy = UTF16ToUTF8(element.getAttribute("aria-busy")); |
- live_status = UTF16ToUTF8(element.getAttribute("aria-live")); |
- live_relevant = UTF16ToUTF8(element.getAttribute("aria-relevant")); |
- |
// Browser plugin (used in a <webview>). |
if (node_to_browser_plugin_instance_id_map_) { |
BrowserPlugin* browser_plugin = BrowserPlugin::GetFromNode(element); |
@@ -388,64 +374,21 @@ void BlinkAXTreeSource::SerializeNode(blink::WebAXObject src, |
} |
} |
- // Walk up the parent chain to set live region attributes of containers |
- std::string container_live_atomic; |
- std::string container_live_busy; |
- std::string container_live_status; |
- std::string container_live_relevant; |
- WebAXObject container_accessible = src; |
- while (!container_accessible.isDetached()) { |
- WebNode container_node = container_accessible.node(); |
- if (!container_node.isNull() && container_node.isElementNode()) { |
- WebElement container_elem = container_node.to<WebElement>(); |
- if (container_elem.hasAttribute("aria-atomic") && |
- container_live_atomic.empty()) { |
- container_live_atomic = |
- UTF16ToUTF8(container_elem.getAttribute("aria-atomic")); |
- } |
- if (container_elem.hasAttribute("aria-busy") && |
- container_live_busy.empty()) { |
- container_live_busy = |
- UTF16ToUTF8(container_elem.getAttribute("aria-busy")); |
- } |
- if (container_elem.hasAttribute("aria-live") && |
- container_live_status.empty()) { |
- container_live_status = |
- UTF16ToUTF8(container_elem.getAttribute("aria-live")); |
- } |
- if (container_elem.hasAttribute("aria-relevant") && |
- container_live_relevant.empty()) { |
- container_live_relevant = |
- UTF16ToUTF8(container_elem.getAttribute("aria-relevant")); |
- } |
- } |
- container_accessible = container_accessible.parentObject(); |
- } |
- |
- if (!live_atomic.empty()) |
- dst->AddBoolAttribute(ui::AX_ATTR_LIVE_ATOMIC, IsTrue(live_atomic)); |
- if (!live_busy.empty()) |
- dst->AddBoolAttribute(ui::AX_ATTR_LIVE_BUSY, IsTrue(live_busy)); |
- if (!live_status.empty()) |
- dst->AddStringAttribute(ui::AX_ATTR_LIVE_STATUS, live_status); |
- if (!live_relevant.empty()) |
- dst->AddStringAttribute(ui::AX_ATTR_LIVE_RELEVANT, live_relevant); |
- |
- if (!container_live_atomic.empty()) { |
+ if (src.isInLiveRegion()) { |
+ dst->AddBoolAttribute(ui::AX_ATTR_LIVE_ATOMIC, src.liveRegionAtomic()); |
+ dst->AddBoolAttribute(ui::AX_ATTR_LIVE_BUSY, src.liveRegionBusy()); |
+ dst->AddStringAttribute(ui::AX_ATTR_LIVE_STATUS, |
+ UTF16ToUTF8(src.liveRegionStatus())); |
+ dst->AddStringAttribute(ui::AX_ATTR_LIVE_RELEVANT, |
+ UTF16ToUTF8(src.liveRegionRelevant())); |
dst->AddBoolAttribute(ui::AX_ATTR_CONTAINER_LIVE_ATOMIC, |
- IsTrue(container_live_atomic)); |
- } |
- if (!container_live_busy.empty()) { |
+ src.containerLiveRegionAtomic()); |
dst->AddBoolAttribute(ui::AX_ATTR_CONTAINER_LIVE_BUSY, |
- IsTrue(container_live_busy)); |
- } |
- if (!container_live_status.empty()) { |
+ src.containerLiveRegionBusy()); |
dst->AddStringAttribute(ui::AX_ATTR_CONTAINER_LIVE_STATUS, |
- container_live_status); |
- } |
- if (!container_live_relevant.empty()) { |
+ UTF16ToUTF8(src.containerLiveRegionStatus())); |
dst->AddStringAttribute(ui::AX_ATTR_CONTAINER_LIVE_RELEVANT, |
- container_live_relevant); |
+ UTF16ToUTF8(src.containerLiveRegionRelevant())); |
} |
if (dst->role == ui::AX_ROLE_PROGRESS_INDICATOR || |