|
| 1 | +# Copyright 2017 The Chromium Authors |
| 2 | +# Use of this source code is governed by a BSD-style license that can be |
| 3 | +# found in the LICENSE file. |
| 4 | +# |
| 5 | +# Contributing to Chrome DevTools Protocol: https://goo.gle/devtools-contribution-guide-cdp |
| 6 | + |
| 7 | +experimental domain Accessibility |
| 8 | + depends on DOM |
| 9 | + |
| 10 | + # Unique accessibility node identifier. |
| 11 | + type AXNodeId extends string |
| 12 | + |
| 13 | + # Enum of possible property types. |
| 14 | + type AXValueType extends string |
| 15 | + enum |
| 16 | + boolean |
| 17 | + tristate |
| 18 | + booleanOrUndefined |
| 19 | + idref |
| 20 | + idrefList |
| 21 | + integer |
| 22 | + node |
| 23 | + nodeList |
| 24 | + number |
| 25 | + string |
| 26 | + computedString |
| 27 | + token |
| 28 | + tokenList |
| 29 | + domRelation |
| 30 | + role |
| 31 | + internalRole |
| 32 | + valueUndefined |
| 33 | + |
| 34 | + # Enum of possible property sources. |
| 35 | + type AXValueSourceType extends string |
| 36 | + enum |
| 37 | + attribute |
| 38 | + implicit |
| 39 | + style |
| 40 | + contents |
| 41 | + placeholder |
| 42 | + relatedElement |
| 43 | + |
| 44 | + # Enum of possible native property sources (as a subtype of a particular AXValueSourceType). |
| 45 | + type AXValueNativeSourceType extends string |
| 46 | + enum |
| 47 | + description |
| 48 | + figcaption |
| 49 | + label |
| 50 | + labelfor |
| 51 | + labelwrapped |
| 52 | + legend |
| 53 | + rubyannotation |
| 54 | + tablecaption |
| 55 | + title |
| 56 | + other |
| 57 | + |
| 58 | + # A single source for a computed AX property. |
| 59 | + type AXValueSource extends object |
| 60 | + properties |
| 61 | + # What type of source this is. |
| 62 | + AXValueSourceType type |
| 63 | + # The value of this property source. |
| 64 | + optional AXValue value |
| 65 | + # The name of the relevant attribute, if any. |
| 66 | + optional string attribute |
| 67 | + # The value of the relevant attribute, if any. |
| 68 | + optional AXValue attributeValue |
| 69 | + # Whether this source is superseded by a higher priority source. |
| 70 | + optional boolean superseded |
| 71 | + # The native markup source for this value, e.g. a `<label>` element. |
| 72 | + optional AXValueNativeSourceType nativeSource |
| 73 | + # The value, such as a node or node list, of the native source. |
| 74 | + optional AXValue nativeSourceValue |
| 75 | + # Whether the value for this property is invalid. |
| 76 | + optional boolean invalid |
| 77 | + # Reason for the value being invalid, if it is. |
| 78 | + optional string invalidReason |
| 79 | + |
| 80 | + type AXRelatedNode extends object |
| 81 | + properties |
| 82 | + # The BackendNodeId of the related DOM node. |
| 83 | + DOM.BackendNodeId backendDOMNodeId |
| 84 | + # The IDRef value provided, if any. |
| 85 | + optional string idref |
| 86 | + # The text alternative of this node in the current context. |
| 87 | + optional string text |
| 88 | + |
| 89 | + type AXProperty extends object |
| 90 | + properties |
| 91 | + # The name of this property. |
| 92 | + AXPropertyName name |
| 93 | + # The value of this property. |
| 94 | + AXValue value |
| 95 | + |
| 96 | + # A single computed AX property. |
| 97 | + type AXValue extends object |
| 98 | + properties |
| 99 | + # The type of this value. |
| 100 | + AXValueType type |
| 101 | + # The computed value of this property. |
| 102 | + optional any value |
| 103 | + # One or more related nodes, if applicable. |
| 104 | + optional array of AXRelatedNode relatedNodes |
| 105 | + # The sources which contributed to the computation of this property. |
| 106 | + optional array of AXValueSource sources |
| 107 | + |
| 108 | + # Values of AXProperty name: |
| 109 | + # - from 'busy' to 'roledescription': states which apply to every AX node |
| 110 | + # - from 'live' to 'root': attributes which apply to nodes in live regions |
| 111 | + # - from 'autocomplete' to 'valuetext': attributes which apply to widgets |
| 112 | + # - from 'checked' to 'selected': states which apply to widgets |
| 113 | + # - from 'activedescendant' to 'owns' - relationships between elements other than parent/child/sibling. |
| 114 | + type AXPropertyName extends string |
| 115 | + enum |
| 116 | + actions |
| 117 | + busy |
| 118 | + disabled |
| 119 | + editable |
| 120 | + focusable |
| 121 | + focused |
| 122 | + hidden |
| 123 | + hiddenRoot |
| 124 | + invalid |
| 125 | + keyshortcuts |
| 126 | + settable |
| 127 | + roledescription |
| 128 | + live |
| 129 | + atomic |
| 130 | + relevant |
| 131 | + root |
| 132 | + autocomplete |
| 133 | + hasPopup |
| 134 | + level |
| 135 | + multiselectable |
| 136 | + orientation |
| 137 | + multiline |
| 138 | + readonly |
| 139 | + required |
| 140 | + valuemin |
| 141 | + valuemax |
| 142 | + valuetext |
| 143 | + checked |
| 144 | + expanded |
| 145 | + modal |
| 146 | + pressed |
| 147 | + selected |
| 148 | + activedescendant |
| 149 | + controls |
| 150 | + describedby |
| 151 | + details |
| 152 | + errormessage |
| 153 | + flowto |
| 154 | + labelledby |
| 155 | + owns |
| 156 | + url |
| 157 | + |
| 158 | + # A node in the accessibility tree. |
| 159 | + type AXNode extends object |
| 160 | + properties |
| 161 | + # Unique identifier for this node. |
| 162 | + AXNodeId nodeId |
| 163 | + # Whether this node is ignored for accessibility |
| 164 | + boolean ignored |
| 165 | + # Collection of reasons why this node is hidden. |
| 166 | + optional array of AXProperty ignoredReasons |
| 167 | + # This `Node`'s role, whether explicit or implicit. |
| 168 | + optional AXValue role |
| 169 | + # This `Node`'s Chrome raw role. |
| 170 | + optional AXValue chromeRole |
| 171 | + # The accessible name for this `Node`. |
| 172 | + optional AXValue name |
| 173 | + # The accessible description for this `Node`. |
| 174 | + optional AXValue description |
| 175 | + # The value for this `Node`. |
| 176 | + optional AXValue value |
| 177 | + # All other properties |
| 178 | + optional array of AXProperty properties |
| 179 | + # ID for this node's parent. |
| 180 | + optional AXNodeId parentId |
| 181 | + # IDs for each of this node's child nodes. |
| 182 | + optional array of AXNodeId childIds |
| 183 | + # The backend ID for the associated DOM node, if any. |
| 184 | + optional DOM.BackendNodeId backendDOMNodeId |
| 185 | + # The frame ID for the frame associated with this nodes document. |
| 186 | + optional Page.FrameId frameId |
| 187 | + |
| 188 | + # Disables the accessibility domain. |
| 189 | + command disable |
| 190 | + |
| 191 | + # Enables the accessibility domain which causes `AXNodeId`s to remain consistent between method calls. |
| 192 | + # This turns on accessibility for the page, which can impact performance until accessibility is disabled. |
| 193 | + command enable |
| 194 | + |
| 195 | + # Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists. |
| 196 | + experimental command getPartialAXTree |
| 197 | + parameters |
| 198 | + # Identifier of the node to get the partial accessibility tree for. |
| 199 | + optional DOM.NodeId nodeId |
| 200 | + # Identifier of the backend node to get the partial accessibility tree for. |
| 201 | + optional DOM.BackendNodeId backendNodeId |
| 202 | + # JavaScript object id of the node wrapper to get the partial accessibility tree for. |
| 203 | + optional Runtime.RemoteObjectId objectId |
| 204 | + # Whether to fetch this node's ancestors, siblings and children. Defaults to true. |
| 205 | + optional boolean fetchRelatives |
| 206 | + returns |
| 207 | + # The `Accessibility.AXNode` for this DOM node, if it exists, plus its ancestors, siblings and |
| 208 | + # children, if requested. |
| 209 | + array of AXNode nodes |
| 210 | + |
| 211 | + # Fetches the entire accessibility tree for the root Document |
| 212 | + experimental command getFullAXTree |
| 213 | + parameters |
| 214 | + # The maximum depth at which descendants of the root node should be retrieved. |
| 215 | + # If omitted, the full tree is returned. |
| 216 | + optional integer depth |
| 217 | + # The frame for whose document the AX tree should be retrieved. |
| 218 | + # If omitted, the root frame is used. |
| 219 | + optional Page.FrameId frameId |
| 220 | + returns |
| 221 | + array of AXNode nodes |
| 222 | + |
| 223 | + # Fetches the root node. |
| 224 | + # Requires `enable()` to have been called previously. |
| 225 | + experimental command getRootAXNode |
| 226 | + parameters |
| 227 | + # The frame in whose document the node resides. |
| 228 | + # If omitted, the root frame is used. |
| 229 | + optional Page.FrameId frameId |
| 230 | + returns |
| 231 | + AXNode node |
| 232 | + |
| 233 | + # Fetches a node and all ancestors up to and including the root. |
| 234 | + # Requires `enable()` to have been called previously. |
| 235 | + experimental command getAXNodeAndAncestors |
| 236 | + parameters |
| 237 | + # Identifier of the node to get. |
| 238 | + optional DOM.NodeId nodeId |
| 239 | + # Identifier of the backend node to get. |
| 240 | + optional DOM.BackendNodeId backendNodeId |
| 241 | + # JavaScript object id of the node wrapper to get. |
| 242 | + optional Runtime.RemoteObjectId objectId |
| 243 | + returns |
| 244 | + array of AXNode nodes |
| 245 | + |
| 246 | + # Fetches a particular accessibility node by AXNodeId. |
| 247 | + # Requires `enable()` to have been called previously. |
| 248 | + experimental command getChildAXNodes |
| 249 | + parameters |
| 250 | + AXNodeId id |
| 251 | + # The frame in whose document the node resides. |
| 252 | + # If omitted, the root frame is used. |
| 253 | + optional Page.FrameId frameId |
| 254 | + returns |
| 255 | + array of AXNode nodes |
| 256 | + |
| 257 | + # Query a DOM node's accessibility subtree for accessible name and role. |
| 258 | + # This command computes the name and role for all nodes in the subtree, including those that are |
| 259 | + # ignored for accessibility, and returns those that match the specified name and role. If no DOM |
| 260 | + # node is specified, or the DOM node does not exist, the command returns an error. If neither |
| 261 | + # `accessibleName` or `role` is specified, it returns all the accessibility nodes in the subtree. |
| 262 | + experimental command queryAXTree |
| 263 | + parameters |
| 264 | + # Identifier of the node for the root to query. |
| 265 | + optional DOM.NodeId nodeId |
| 266 | + # Identifier of the backend node for the root to query. |
| 267 | + optional DOM.BackendNodeId backendNodeId |
| 268 | + # JavaScript object id of the node wrapper for the root to query. |
| 269 | + optional Runtime.RemoteObjectId objectId |
| 270 | + # Find nodes with this computed name. |
| 271 | + optional string accessibleName |
| 272 | + # Find nodes with this computed role. |
| 273 | + optional string role |
| 274 | + returns |
| 275 | + # A list of `Accessibility.AXNode` matching the specified attributes, |
| 276 | + # including nodes that are ignored for accessibility. |
| 277 | + array of AXNode nodes |
| 278 | + |
| 279 | + # The loadComplete event mirrors the load complete event sent by the browser to assistive |
| 280 | + # technology when the web page has finished loading. |
| 281 | + experimental event loadComplete |
| 282 | + parameters |
| 283 | + # New document root node. |
| 284 | + AXNode root |
| 285 | + |
| 286 | + # The nodesUpdated event is sent every time a previously requested node has changed the in tree. |
| 287 | + experimental event nodesUpdated |
| 288 | + parameters |
| 289 | + # Updated node data. |
| 290 | + array of AXNode nodes |
0 commit comments