Commit 1c9cce4c authored by David Tseng's avatar David Tseng Committed by Commit Bot

Expose autoComplete and className in automation

Bug: 
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I96565fa693ae9598636927c953abfd68c57359d4
Reviewed-on: https://chromium-review.googlesource.com/801777Reviewed-by: default avatarMichael Giuffrida <michaelpg@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: default avatarYuki Awano <yawano@chromium.org>
Commit-Queue: David Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521484}
parent 4e931006
......@@ -191,8 +191,11 @@ void PopulateAXRole(arc::mojom::AccessibilityNodeInfoData* node,
}
std::string class_name;
GetStringProperty(node, arc::mojom::AccessibilityStringProperty::CLASS_NAME,
&class_name);
if (GetStringProperty(node,
arc::mojom::AccessibilityStringProperty::CLASS_NAME,
&class_name)) {
out_data->AddStringAttribute(ui::AX_ATTR_CLASS_NAME, class_name);
}
#define MAP_ROLE(android_class_name, chrome_role) \
if (class_name == android_class_name) { \
......
......@@ -643,6 +643,12 @@
// Miscellaneous attributes.
//
// Aria auto complete.
DOMString? autoComplete;
// The name of the programmatic backing object.
DOMString? className;
// A map containing all HTML attributes and their values
// <jsexterns>@type {Object<string>}</jsexterns>
object? htmlAttributes;
......
......@@ -819,6 +819,8 @@ AutomationNodeImpl.prototype = {
var stringAttributes = [
'accessKey',
'ariaInvalidValue',
'autoComplete',
'className',
'containerLiveRelevant',
'containerLiveStatus',
'description',
......
......@@ -431,8 +431,7 @@ chrome.automation.AutomationNode.prototype.location;
chrome.automation.AutomationNode.prototype.boundsForRange = function(startIndex, endIndex) {};
/**
* The location (as a bounding box) of this node in global screen coordinates.
* This is the same as location but not clipped by ancestors.
* The location (as a bounding box) of this node in global screen coordinates without applying any clipping from ancestors.
* @type {(!chrome.automation.Rect|undefined)}
* @see https://developer.chrome.com/extensions/automation#type-unclippedLocation
*/
......@@ -894,6 +893,20 @@ chrome.automation.AutomationNode.prototype.containerLiveAtomic;
*/
chrome.automation.AutomationNode.prototype.containerLiveBusy;
/**
* Aria auto complete.
* @type {(string|undefined)}
* @see https://developer.chrome.com/extensions/automation#type-autoComplete
*/
chrome.automation.AutomationNode.prototype.autoComplete;
/**
* The name of the programmatic backing object.
* @type {(string|undefined)}
* @see https://developer.chrome.com/extensions/automation#type-className
*/
chrome.automation.AutomationNode.prototype.className;
/**
* A map containing all HTML attributes and their values
* @type {Object<string>}
......
......@@ -340,6 +340,7 @@
aria_invalid_value,
auto_complete,
chrome_channel, // Automation only.
class_name, // views and Android
container_live_relevant,
container_live_status,
description,
......
......@@ -831,6 +831,9 @@ std::string AXNodeData::ToString() const {
case AX_ATTR_CHROME_CHANNEL:
result += " chrome_channel=" + value;
break;
case AX_ATTR_CLASS_NAME:
result += " class_name=" + value;
break;
case AX_ATTR_DESCRIPTION:
result += " description=" + value;
break;
......
......@@ -62,6 +62,9 @@ void AXViewObjWrapper::Serialize(ui::AXNodeData* out_node_data) {
base::UTF16ToUTF8(description));
}
out_node_data->AddStringAttribute(ui::AX_ATTR_CLASS_NAME,
view_->GetClassName());
out_node_data->location = gfx::RectF(view_->GetBoundsInScreen());
}
......
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