Commit 8a160ce4 authored by David Tseng's avatar David Tseng Committed by Commit Bot

Support clickable boolean property for ARC++

 Test: manually click (with ChromeVox using Search+Space) ARC++ notification; verify app opens.
Bug: 786981

Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I6809ff0371e5315e0fe6aaf01e9c567215c77fc4
Reviewed-on: https://chromium-review.googlesource.com/783669
Commit-Queue: David Tseng <dtseng@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519532}
parent 68ce7e28
...@@ -501,6 +501,10 @@ void AXTreeSourceArc::SerializeNode(mojom::AccessibilityNodeInfoData* node, ...@@ -501,6 +501,10 @@ void AXTreeSourceArc::SerializeNode(mojom::AccessibilityNodeInfoData* node,
node, arc::mojom::AccessibilityBooleanProperty::SCROLLABLE)) { node, arc::mojom::AccessibilityBooleanProperty::SCROLLABLE)) {
out_data->AddBoolAttribute(ui::AX_ATTR_SCROLLABLE, true); out_data->AddBoolAttribute(ui::AX_ATTR_SCROLLABLE, true);
} }
if (GetBooleanProperty(node,
arc::mojom::AccessibilityBooleanProperty::CLICKABLE)) {
out_data->AddBoolAttribute(ui::AX_ATTR_CLICKABLE, true);
}
exo::WMHelper* wm_helper = exo::WMHelper* wm_helper =
exo::WMHelper::HasInstance() ? exo::WMHelper::GetInstance() : nullptr; exo::WMHelper::HasInstance() ? exo::WMHelper::GetInstance() : nullptr;
......
...@@ -477,7 +477,11 @@ CommandHandler.onCommand = function(command) { ...@@ -477,7 +477,11 @@ CommandHandler.onCommand = function(command) {
ChromeVoxState.instance.navigateToRange( ChromeVoxState.instance.navigateToRange(
cursors.Range.fromNode(actionNode.inPageLinkTarget)); cursors.Range.fromNode(actionNode.inPageLinkTarget));
} else { } else {
actionNode.doDefault(); // Scan for a clickable, which overrides the |actionNode|.
var clickable = actionNode;
while (clickable && !clickable.clickable)
clickable = clickable.parent;
clickable ? clickable.doDefault() : actionNode.doDefault();
} }
} }
// Skip all other processing; if focus changes, we should get an event // Skip all other processing; if focus changes, we should get an event
......
...@@ -822,6 +822,7 @@ var stringAttributes = [ ...@@ -822,6 +822,7 @@ var stringAttributes = [
var boolAttributes = [ var boolAttributes = [
'busy', 'busy',
'clickable',
'containerLiveAtomic', 'containerLiveAtomic',
'containerLiveBusy', 'containerLiveBusy',
'liveAtomic', 'liveAtomic',
......
...@@ -495,7 +495,10 @@ ...@@ -495,7 +495,10 @@
canvas_has_fallback, canvas_has_fallback,
// Indicates this node is scrollable (Android only). // Indicates this node is scrollable (Android only).
scrollable scrollable,
// A hint to clients that the node is clickable.
clickable
}; };
[cpp_enum_prefix_override="ax_attr"] enum AXIntListAttribute { [cpp_enum_prefix_override="ax_attr"] enum AXIntListAttribute {
......
...@@ -943,6 +943,9 @@ std::string AXNodeData::ToString() const { ...@@ -943,6 +943,9 @@ std::string AXNodeData::ToString() const {
case AX_ATTR_SCROLLABLE: case AX_ATTR_SCROLLABLE:
result += " scrollable=" + value; result += " scrollable=" + value;
break; break;
case AX_ATTR_CLICKABLE:
result += " clickable=" + value;
break;
case AX_BOOL_ATTRIBUTE_NONE: case AX_BOOL_ATTRIBUTE_NONE:
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment