| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.AccessibilitySubPane} | 7 * @extends {WebInspector.AccessibilitySubPane} |
| 8 */ | 8 */ |
| 9 WebInspector.AXNodeSubPane = function() | 9 WebInspector.AXNodeSubPane = function() |
| 10 { | 10 { |
| 11 WebInspector.AccessibilitySubPane.call(this, WebInspector.UIString("Computed
Properties")); | 11 WebInspector.AccessibilitySubPane.call(this, WebInspector.UIString("Computed
Properties")); |
| 12 | 12 |
| 13 this._noNodeInfo = this.createInfo(WebInspector.UIString("No accessibility n
ode")); | 13 this._noNodeInfo = this.createInfo(WebInspector.UIString("No accessibility n
ode")); |
| 14 this._ignoredInfo = this.createInfo(WebInspector.UIString("Accessibility nod
e not exposed"), "ax-ignored-info hidden"); | 14 this._ignoredInfo = this.createInfo(WebInspector.UIString("Accessibility nod
e not exposed"), "ax-ignored-info hidden"); |
| 15 | 15 |
| 16 this._treeOutline = this.createTreeOutline(); | 16 this._treeOutline = this.createTreeOutline(); |
| 17 this._ignoredReasonsTree = this.createTreeOutline(); | 17 this._ignoredReasonsTree = this.createTreeOutline(); |
| 18 | 18 |
| 19 this.element.classList.add("accessibility-computed"); | 19 this.element.classList.add("accessibility-computed"); |
| 20 }; | 20 }; |
| 21 | 21 |
| 22 | 22 |
| 23 WebInspector.AXNodeSubPane.prototype = { | 23 WebInspector.AXNodeSubPane.prototype = { |
| 24 /** | 24 /** |
| 25 * @param {?AccessibilityAgent.AXNode} axNode | 25 * @param {?WebInspector.AccessibilityNode} axNode |
| 26 * @override | 26 * @override |
| 27 */ | 27 */ |
| 28 setAXNode: function(axNode) | 28 setAXNode: function(axNode) |
| 29 { | 29 { |
| 30 if (this._axNode === axNode) | 30 if (this._axNode === axNode) |
| 31 return; | 31 return; |
| 32 this._axNode = axNode; | 32 this._axNode = axNode; |
| 33 | 33 |
| 34 var treeOutline = this._treeOutline; | 34 var treeOutline = this._treeOutline; |
| 35 treeOutline.removeChildren(); | 35 treeOutline.removeChildren(); |
| 36 var ignoredReasons = this._ignoredReasonsTree; | 36 var ignoredReasons = this._ignoredReasonsTree; |
| 37 ignoredReasons.removeChildren(); | 37 ignoredReasons.removeChildren(); |
| 38 var target = this.node().target(); | |
| 39 | 38 |
| 40 if (!axNode) { | 39 if (!axNode) { |
| 41 treeOutline.element.classList.add("hidden"); | 40 treeOutline.element.classList.add("hidden"); |
| 42 this._ignoredInfo.classList.add("hidden"); | 41 this._ignoredInfo.classList.add("hidden"); |
| 43 ignoredReasons.element.classList.add("hidden"); | 42 ignoredReasons.element.classList.add("hidden"); |
| 44 | 43 |
| 45 this._noNodeInfo.classList.remove("hidden"); | 44 this._noNodeInfo.classList.remove("hidden"); |
| 46 this.element.classList.add("ax-ignored-node-pane"); | 45 this.element.classList.add("ax-ignored-node-pane"); |
| 47 | 46 |
| 48 return; | 47 return; |
| 49 } else if (axNode.ignored) { | 48 } |
| 49 |
| 50 if (axNode.ignored()) { |
| 50 this._noNodeInfo.classList.add("hidden"); | 51 this._noNodeInfo.classList.add("hidden"); |
| 51 treeOutline.element.classList.add("hidden"); | 52 treeOutline.element.classList.add("hidden"); |
| 52 this.element.classList.add("ax-ignored-node-pane"); | 53 this.element.classList.add("ax-ignored-node-pane"); |
| 53 | 54 |
| 54 this._ignoredInfo.classList.remove("hidden"); | 55 this._ignoredInfo.classList.remove("hidden"); |
| 55 ignoredReasons.element.classList.remove("hidden"); | 56 ignoredReasons.element.classList.remove("hidden"); |
| 56 /** | 57 /** |
| 57 * @param {!AccessibilityAgent.AXProperty} property | 58 * @param {!AccessibilityAgent.AXProperty} property |
| 58 */ | 59 */ |
| 59 function addIgnoredReason(property) | 60 function addIgnoredReason(property) |
| 60 { | 61 { |
| 61 ignoredReasons.appendChild(new WebInspector.AXNodeIgnoredReasonT
reeElement(property, axNode, target)); | 62 ignoredReasons.appendChild(new WebInspector.AXNodeIgnoredReasonT
reeElement(property, /** @type {!WebInspector.AccessibilityNode} */ (axNode))); |
| 62 } | 63 } |
| 63 var ignoredReasonsArray = /** @type {!Array<!AccessibilityAgent.AXPr
operty>} */(axNode.ignoredReasons); | 64 var ignoredReasonsArray = /** @type {!Array<!AccessibilityAgent.AXPr
operty>} */(axNode.ignoredReasons()); |
| 64 for (var reason of ignoredReasonsArray) | 65 for (var reason of ignoredReasonsArray) |
| 65 addIgnoredReason(reason); | 66 addIgnoredReason(reason); |
| 66 if (!ignoredReasons.firstChild()) | 67 if (!ignoredReasons.firstChild()) |
| 67 ignoredReasons.element.classList.add("hidden"); | 68 ignoredReasons.element.classList.add("hidden"); |
| 68 return; | 69 return; |
| 69 } | 70 } |
| 70 this.element.classList.remove("ax-ignored-node-pane"); | 71 this.element.classList.remove("ax-ignored-node-pane"); |
| 71 | 72 |
| 72 this._ignoredInfo.classList.add("hidden"); | 73 this._ignoredInfo.classList.add("hidden"); |
| 73 ignoredReasons.element.classList.add("hidden"); | 74 ignoredReasons.element.classList.add("hidden"); |
| 74 this._noNodeInfo.classList.add("hidden"); | 75 this._noNodeInfo.classList.add("hidden"); |
| 75 | 76 |
| 76 treeOutline.element.classList.remove("hidden"); | 77 treeOutline.element.classList.remove("hidden"); |
| 77 | 78 |
| 78 /** | 79 /** |
| 79 * @param {!AccessibilityAgent.AXProperty} property | 80 * @param {!AccessibilityAgent.AXProperty} property |
| 80 */ | 81 */ |
| 81 function addProperty(property) | 82 function addProperty(property) |
| 82 { | 83 { |
| 83 treeOutline.appendChild(new WebInspector.AXNodePropertyTreePropertyE
lement(property, target)); | 84 treeOutline.appendChild(new WebInspector.AXNodePropertyTreePropertyE
lement(property, /** @type {!WebInspector.AccessibilityNode} */ (axNode))); |
| 84 } | 85 } |
| 85 | 86 |
| 86 for (var propertyName of ["name", "description", "help", "value"]) { | 87 for (var property of axNode.coreProperties()) |
| 87 if (propertyName in axNode) { | 88 addProperty(property); |
| 88 var defaultProperty = /** @type {!AccessibilityAgent.AXProperty}
*/ ({name: propertyName, value: axNode[propertyName]}); | |
| 89 addProperty(defaultProperty); | |
| 90 } | |
| 91 } | |
| 92 | 89 |
| 93 var roleProperty = /** @type {!AccessibilityAgent.AXProperty} */ ({name:
"role", value: axNode.role}); | 90 var roleProperty = /** @type {!AccessibilityAgent.AXProperty} */ ({name:
"role", value: axNode.role()}); |
| 94 addProperty(roleProperty); | 91 addProperty(roleProperty); |
| 95 | 92 |
| 96 var propertyMap = {}; | 93 var propertyMap = {}; |
| 97 var propertiesArray = /** @type {!Array.<!AccessibilityAgent.AXProperty>
} */ (axNode.properties); | 94 var propertiesArray = /** @type {!Array.<!AccessibilityAgent.AXProperty>
} */ (axNode.properties()); |
| 98 for (var property of propertiesArray) | 95 for (var property of propertiesArray) |
| 99 propertyMap[property.name] = property; | 96 propertyMap[property.name] = property; |
| 100 | 97 |
| 101 for (var propertySet of [AccessibilityAgent.AXWidgetAttributes, Accessib
ilityAgent.AXWidgetStates, AccessibilityAgent.AXGlobalStates, AccessibilityAgent
.AXLiveRegionAttributes, AccessibilityAgent.AXRelationshipAttributes]) { | 98 for (var propertySet of [AccessibilityAgent.AXWidgetAttributes, Accessib
ilityAgent.AXWidgetStates, AccessibilityAgent.AXGlobalStates, AccessibilityAgent
.AXLiveRegionAttributes, AccessibilityAgent.AXRelationshipAttributes]) { |
| 102 for (var propertyKey in propertySet) { | 99 for (var propertyKey in propertySet) { |
| 103 var property = propertySet[propertyKey]; | 100 var property = propertySet[propertyKey]; |
| 104 if (property in propertyMap) | 101 if (property in propertyMap) |
| 105 addProperty(propertyMap[property]); | 102 addProperty(propertyMap[property]); |
| 106 } | 103 } |
| 107 } | 104 } |
| 108 }, | 105 }, |
| 109 | 106 |
| 110 /** | 107 /** |
| 111 * @override | 108 * @override |
| 112 * @param {?WebInspector.DOMNode} node | 109 * @param {?WebInspector.DOMNode} node |
| 113 */ | 110 */ |
| 114 setNode: function(node) | 111 setNode: function(node) |
| 115 { | 112 { |
| 116 WebInspector.AccessibilitySubPane.prototype.setNode.call(this, node); | 113 WebInspector.AccessibilitySubPane.prototype.setNode.call(this, node); |
| 117 this._axNode = null; | 114 this._axNode = null; |
| 118 }, | 115 }, |
| 119 | 116 |
| 120 __proto__: WebInspector.AccessibilitySubPane.prototype | 117 __proto__: WebInspector.AccessibilitySubPane.prototype |
| 121 }; | 118 }; |
| 122 | 119 |
| 123 /** | 120 /** |
| 124 * @constructor | 121 * @constructor |
| 122 * @param {!WebInspector.AccessibilityNode} axNode |
| 125 * @extends {TreeElement} | 123 * @extends {TreeElement} |
| 126 * @param {!WebInspector.Target} target | |
| 127 */ | 124 */ |
| 128 WebInspector.AXNodePropertyTreeElement = function(target) | 125 WebInspector.AXNodePropertyTreeElement = function(axNode) |
| 129 { | 126 { |
| 130 this._target = target; | 127 this._axNode = axNode; |
| 131 | 128 |
| 132 // Pass an empty title, the title gets made later in onattach. | 129 // Pass an empty title, the title gets made later in onattach. |
| 133 TreeElement.call(this, ""); | 130 TreeElement.call(this, ""); |
| 134 }; | 131 }; |
| 135 | 132 |
| 136 /** | 133 /** |
| 137 * @param {?AccessibilityAgent.AXValueType} type | 134 * @param {?AccessibilityAgent.AXValueType} type |
| 138 * @param {string} value | 135 * @param {string} value |
| 139 * @return {!Element} | 136 * @return {!Element} |
| 140 */ | 137 */ |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 var AXValueType = AccessibilityAgent.AXValueType; | 229 var AXValueType = AccessibilityAgent.AXValueType; |
| 233 if (value.type === AXValueType.Idref || value.type === AXValueType.Node
|| | 230 if (value.type === AXValueType.Idref || value.type === AXValueType.Node
|| |
| 234 value.type === AXValueType.IdrefList || value.type === AXValueType.N
odeList) { | 231 value.type === AXValueType.IdrefList || value.type === AXValueType.N
odeList) { |
| 235 this.appendRelatedNodeListValueElement(value); | 232 this.appendRelatedNodeListValueElement(value); |
| 236 if (!value.value) | 233 if (!value.value) |
| 237 return null; | 234 return null; |
| 238 } else if (value.sources) { | 235 } else if (value.sources) { |
| 239 var sources = value.sources; | 236 var sources = value.sources; |
| 240 for (var i = 0; i < sources.length; i++) { | 237 for (var i = 0; i < sources.length; i++) { |
| 241 var source = sources[i]; | 238 var source = sources[i]; |
| 242 var child = new WebInspector.AXValueSourceTreeElement(source, th
is._target); | 239 var child = new WebInspector.AXValueSourceTreeElement(source, th
is._axNode); |
| 243 this.appendChild(child); | 240 this.appendChild(child); |
| 244 } | 241 } |
| 245 this.expand(); | 242 this.expand(); |
| 246 } | 243 } |
| 247 var element = WebInspector.AXNodePropertyTreeElement.createSimpleValueEl
ement(value.type, String(value.value)); | 244 var element = WebInspector.AXNodePropertyTreeElement.createSimpleValueEl
ement(value.type, String(value.value)); |
| 248 this.listItemElement.appendChild(element); | 245 this.listItemElement.appendChild(element); |
| 249 return element; | 246 return element; |
| 250 }, | 247 }, |
| 251 | 248 |
| 252 /** | 249 /** |
| 253 * @param {!AccessibilityAgent.AXRelatedNode} relatedNode | 250 * @param {!AccessibilityAgent.AXRelatedNode} relatedNode |
| 254 * @param {number} index | 251 * @param {number} index |
| 255 */ | 252 */ |
| 256 appendRelatedNode: function(relatedNode, index) | 253 appendRelatedNode: function(relatedNode, index) |
| 257 { | 254 { |
| 258 var deferredNode = new WebInspector.DeferredDOMNode(this._target, relate
dNode.backendNodeId); | 255 var deferredNode = new WebInspector.DeferredDOMNode(this._axNode.target(
), relatedNode.backendNodeId); |
| 259 var nodeTreeElement = new WebInspector.AXRelatedNodeSourceTreeElement({
deferredNode: deferredNode }, relatedNode); | 256 var nodeTreeElement = new WebInspector.AXRelatedNodeSourceTreeElement({
deferredNode: deferredNode }, relatedNode); |
| 260 this.appendChild(nodeTreeElement); | 257 this.appendChild(nodeTreeElement); |
| 261 }, | 258 }, |
| 262 | 259 |
| 263 /** | 260 /** |
| 264 * @param {!AccessibilityAgent.AXRelatedNode} relatedNode | 261 * @param {!AccessibilityAgent.AXRelatedNode} relatedNode |
| 265 */ | 262 */ |
| 266 appendRelatedNodeInline: function(relatedNode) | 263 appendRelatedNodeInline: function(relatedNode) |
| 267 { | 264 { |
| 268 var deferredNode = new WebInspector.DeferredDOMNode(this._target, relate
dNode.backendNodeId); | 265 var deferredNode = new WebInspector.DeferredDOMNode(this._axNode.target(
), relatedNode.backendNodeId); |
| 269 var linkedNode = new WebInspector.AXRelatedNodeElement({ deferredNode: d
eferredNode }, relatedNode); | 266 var linkedNode = new WebInspector.AXRelatedNodeElement({ deferredNode: d
eferredNode }, relatedNode); |
| 270 this.listItemElement.appendChild(linkedNode.render()); | 267 this.listItemElement.appendChild(linkedNode.render()); |
| 271 }, | 268 }, |
| 272 | 269 |
| 273 /** | 270 /** |
| 274 * @param {!AccessibilityAgent.AXValue} value | 271 * @param {!AccessibilityAgent.AXValue} value |
| 275 */ | 272 */ |
| 276 appendRelatedNodeListValueElement: function(value) | 273 appendRelatedNodeListValueElement: function(value) |
| 277 { | 274 { |
| 278 if (value.relatedNodes.length === 1 && !value.value) { | 275 if (value.relatedNodes.length === 1 && !value.value) { |
| 279 this.appendRelatedNodeInline(value.relatedNodes[0]); | 276 this.appendRelatedNodeInline(value.relatedNodes[0]); |
| 280 return; | 277 return; |
| 281 } | 278 } |
| 282 | 279 |
| 283 value.relatedNodes.forEach(this.appendRelatedNode, this); | 280 value.relatedNodes.forEach(this.appendRelatedNode, this); |
| 284 if (value.relatedNodes.length <= 3) | 281 if (value.relatedNodes.length <= 3) |
| 285 this.expand(); | 282 this.expand(); |
| 286 else | 283 else |
| 287 this.collapse(); | 284 this.collapse(); |
| 288 }, | 285 }, |
| 289 | 286 |
| 290 __proto__: TreeElement.prototype | 287 __proto__: TreeElement.prototype |
| 291 }; | 288 }; |
| 292 | 289 |
| 293 /** | 290 /** |
| 294 * @constructor | 291 * @constructor |
| 295 * @extends {WebInspector.AXNodePropertyTreeElement} | 292 * @extends {WebInspector.AXNodePropertyTreeElement} |
| 296 * @param {!AccessibilityAgent.AXProperty} property | 293 * @param {!AccessibilityAgent.AXProperty} property |
| 297 * @param {!WebInspector.Target} target | 294 * @param {!WebInspector.AccessibilityNode} axNode |
| 298 */ | 295 */ |
| 299 WebInspector.AXNodePropertyTreePropertyElement = function(property, target) | 296 WebInspector.AXNodePropertyTreePropertyElement = function(property, axNode) |
| 300 { | 297 { |
| 301 this._property = property; | 298 this._property = property; |
| 302 this.toggleOnClick = true; | 299 this.toggleOnClick = true; |
| 303 this.selectable = false; | 300 this.selectable = false; |
| 304 | 301 |
| 305 WebInspector.AXNodePropertyTreeElement.call(this, target); | 302 WebInspector.AXNodePropertyTreeElement.call(this, axNode); |
| 306 this.listItemElement.classList.add("property"); | 303 this.listItemElement.classList.add("property"); |
| 307 } | 304 } |
| 308 | 305 |
| 309 WebInspector.AXNodePropertyTreePropertyElement.prototype = { | 306 WebInspector.AXNodePropertyTreePropertyElement.prototype = { |
| 310 /** | 307 /** |
| 311 * @override | 308 * @override |
| 312 */ | 309 */ |
| 313 onattach: function() | 310 onattach: function() |
| 314 { | 311 { |
| 315 this._update(); | 312 this._update(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 328 valueElement.classList.add("ax-computed-text"); | 325 valueElement.classList.add("ax-computed-text"); |
| 329 }, | 326 }, |
| 330 | 327 |
| 331 __proto__: WebInspector.AXNodePropertyTreeElement.prototype | 328 __proto__: WebInspector.AXNodePropertyTreeElement.prototype |
| 332 }; | 329 }; |
| 333 | 330 |
| 334 /** | 331 /** |
| 335 * @constructor | 332 * @constructor |
| 336 * @extends {WebInspector.AXNodePropertyTreeElement} | 333 * @extends {WebInspector.AXNodePropertyTreeElement} |
| 337 * @param {!AccessibilityAgent.AXValueSource} source | 334 * @param {!AccessibilityAgent.AXValueSource} source |
| 338 * @param {!WebInspector.Target} target | 335 * @param {!WebInspector.AccessibilityNode} axNode |
| 339 */ | 336 */ |
| 340 WebInspector.AXValueSourceTreeElement = function(source, target) | 337 WebInspector.AXValueSourceTreeElement = function(source, axNode) |
| 341 { | 338 { |
| 342 this._source = source; | 339 this._source = source; |
| 343 WebInspector.AXNodePropertyTreeElement.call(this, target); | 340 WebInspector.AXNodePropertyTreeElement.call(this, axNode); |
| 344 this.selectable = false; | 341 this.selectable = false; |
| 345 } | 342 } |
| 346 | 343 |
| 347 WebInspector.AXValueSourceTreeElement.prototype = { | 344 WebInspector.AXValueSourceTreeElement.prototype = { |
| 348 /** | 345 /** |
| 349 * @override | 346 * @override |
| 350 */ | 347 */ |
| 351 onattach: function() | 348 onattach: function() |
| 352 { | 349 { |
| 353 this._update(); | 350 this._update(); |
| 354 }, | 351 }, |
| 355 | 352 |
| 356 /** | 353 /** |
| 357 * @param {!AccessibilityAgent.AXRelatedNode} relatedNode | 354 * @param {!AccessibilityAgent.AXRelatedNode} relatedNode |
| 358 * @param {number} index | 355 * @param {number} index |
| 359 * @param {string} idref | 356 * @param {string} idref |
| 360 */ | 357 */ |
| 361 appendRelatedNodeWithIdref: function(relatedNode, index, idref) | 358 appendRelatedNodeWithIdref: function(relatedNode, index, idref) |
| 362 { | 359 { |
| 363 var deferredNode = new WebInspector.DeferredDOMNode(this._target, relate
dNode.backendNodeId); | 360 var deferredNode = new WebInspector.DeferredDOMNode(this._axNode.target(
), relatedNode.backendNodeId); |
| 364 var nodeTreeElement = new WebInspector.AXRelatedNodeSourceTreeElement({
deferredNode: deferredNode, idref: idref }, relatedNode); | 361 var nodeTreeElement = new WebInspector.AXRelatedNodeSourceTreeElement({
deferredNode: deferredNode, idref: idref }, relatedNode); |
| 365 this.appendChild(nodeTreeElement); | 362 this.appendChild(nodeTreeElement); |
| 366 }, | 363 }, |
| 367 | 364 |
| 368 /** | 365 /** |
| 369 * @param {!AccessibilityAgent.AXValue} value | 366 * @param {!AccessibilityAgent.AXValue} value |
| 370 */ | 367 */ |
| 371 appendIDRefValueElement: function(value) | 368 appendIDRefValueElement: function(value) |
| 372 { | 369 { |
| 373 var relatedNodes = value.relatedNodes; | 370 var relatedNodes = value.relatedNodes; |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 } | 583 } |
| 587 | 584 |
| 588 return element; | 585 return element; |
| 589 } | 586 } |
| 590 }; | 587 }; |
| 591 | 588 |
| 592 /** | 589 /** |
| 593 * @constructor | 590 * @constructor |
| 594 * @extends {WebInspector.AXNodePropertyTreeElement} | 591 * @extends {WebInspector.AXNodePropertyTreeElement} |
| 595 * @param {!AccessibilityAgent.AXProperty} property | 592 * @param {!AccessibilityAgent.AXProperty} property |
| 596 * @param {?AccessibilityAgent.AXNode} axNode | 593 * @param {!WebInspector.AccessibilityNode} axNode |
| 597 * @param {!WebInspector.Target} target | |
| 598 */ | 594 */ |
| 599 WebInspector.AXNodeIgnoredReasonTreeElement = function(property, axNode, target) | 595 WebInspector.AXNodeIgnoredReasonTreeElement = function(property, axNode) |
| 600 { | 596 { |
| 601 this._property = property; | 597 this._property = property; |
| 602 this._axNode = axNode; | 598 this._axNode = axNode; |
| 603 | 599 |
| 604 WebInspector.AXNodePropertyTreeElement.call(this, target); | 600 WebInspector.AXNodePropertyTreeElement.call(this, axNode); |
| 605 this.toggleOnClick = true; | 601 this.toggleOnClick = true; |
| 606 this.selectable = false; | 602 this.selectable = false; |
| 607 } | 603 } |
| 608 | 604 |
| 609 WebInspector.AXNodeIgnoredReasonTreeElement.prototype = { | 605 WebInspector.AXNodeIgnoredReasonTreeElement.prototype = { |
| 610 /** | 606 /** |
| 611 * @override | 607 * @override |
| 612 */ | 608 */ |
| 613 onattach: function() | 609 onattach: function() |
| 614 { | 610 { |
| 615 this.listItemElement.removeChildren(); | 611 this.listItemElement.removeChildren(); |
| 616 | 612 |
| 617 this._reasonElement = WebInspector.AXNodeIgnoredReasonTreeElement.create
ReasonElement(this._property.name, this._axNode); | 613 this._reasonElement = WebInspector.AXNodeIgnoredReasonTreeElement.create
ReasonElement(this._property.name, this._axNode); |
| 618 this.listItemElement.appendChild(this._reasonElement); | 614 this.listItemElement.appendChild(this._reasonElement); |
| 619 | 615 |
| 620 var value = this._property.value; | 616 var value = this._property.value; |
| 621 if (value.type === AccessibilityAgent.AXValueType.Idref) | 617 if (value.type === AccessibilityAgent.AXValueType.Idref) |
| 622 this.appendRelatedNodeListValueElement(value); | 618 this.appendRelatedNodeListValueElement(value); |
| 623 }, | 619 }, |
| 624 | 620 |
| 625 __proto__: WebInspector.AXNodePropertyTreeElement.prototype | 621 __proto__: WebInspector.AXNodePropertyTreeElement.prototype |
| 626 }; | 622 }; |
| 627 | 623 |
| 628 /** | 624 /** |
| 629 * @param {?string} reason | 625 * @param {?string} reason |
| 630 * @param {?AccessibilityAgent.AXNode} axNode | 626 * @param {?WebInspector.AccessibilityNode} axNode |
| 631 * @return {?Element} | 627 * @return {?Element} |
| 632 */ | 628 */ |
| 633 WebInspector.AXNodeIgnoredReasonTreeElement.createReasonElement = function(reaso
n, axNode) | 629 WebInspector.AXNodeIgnoredReasonTreeElement.createReasonElement = function(reaso
n, axNode) |
| 634 { | 630 { |
| 635 var reasonElement = null; | 631 var reasonElement = null; |
| 636 switch (reason) { | 632 switch (reason) { |
| 637 case "activeModalDialog": | 633 case "activeModalDialog": |
| 638 reasonElement = WebInspector.formatLocalized("Element is hidden by activ
e modal dialog:\u00a0", []); | 634 reasonElement = WebInspector.formatLocalized("Element is hidden by activ
e modal dialog:\u00a0", []); |
| 639 break; | 635 break; |
| 640 case "ancestorDisallowsChild": | 636 case "ancestorDisallowsChild": |
| (...skipping 30 matching lines...) Expand all Loading... |
| 671 case "labelFor": | 667 case "labelFor": |
| 672 reasonElement = WebInspector.formatLocalized("Label for\u00a0", []); | 668 reasonElement = WebInspector.formatLocalized("Label for\u00a0", []); |
| 673 break; | 669 break; |
| 674 case "notRendered": | 670 case "notRendered": |
| 675 reasonElement = WebInspector.formatLocalized("Element is not rendered.",
[]); | 671 reasonElement = WebInspector.formatLocalized("Element is not rendered.",
[]); |
| 676 break; | 672 break; |
| 677 case "notVisible": | 673 case "notVisible": |
| 678 reasonElement = WebInspector.formatLocalized("Element is not visible.",
[]); | 674 reasonElement = WebInspector.formatLocalized("Element is not visible.",
[]); |
| 679 break; | 675 break; |
| 680 case "presentationalRole": | 676 case "presentationalRole": |
| 681 var rolePresentationSpan = createElement("span", "source-code").textCont
ent = "role=" + axNode.role.value; | 677 var rolePresentationSpan = createElement("span", "source-code").textCont
ent = "role=" + axNode.role().value; |
| 682 reasonElement = WebInspector.formatLocalized("Element has %s.", [ rolePr
esentationSpan ]); | 678 reasonElement = WebInspector.formatLocalized("Element has %s.", [ rolePr
esentationSpan ]); |
| 683 break; | 679 break; |
| 684 case "probablyPresentational": | 680 case "probablyPresentational": |
| 685 reasonElement = WebInspector.formatLocalized("Element is presentational.
", []); | 681 reasonElement = WebInspector.formatLocalized("Element is presentational.
", []); |
| 686 break; | 682 break; |
| 687 case "staticTextUsedAsNameFor": | 683 case "staticTextUsedAsNameFor": |
| 688 reasonElement = WebInspector.formatLocalized("Static text node is used a
s name for\u00a0", []); | 684 reasonElement = WebInspector.formatLocalized("Static text node is used a
s name for\u00a0", []); |
| 689 break; | 685 break; |
| 690 case "uninteresting": | 686 case "uninteresting": |
| 691 reasonElement = WebInspector.formatLocalized("Element not interesting fo
r accessibility.", []); | 687 reasonElement = WebInspector.formatLocalized("Element not interesting fo
r accessibility.", []); |
| 692 break; | 688 break; |
| 693 } | 689 } |
| 694 if (reasonElement) | 690 if (reasonElement) |
| 695 reasonElement.classList.add("ax-reason"); | 691 reasonElement.classList.add("ax-reason"); |
| 696 return reasonElement; | 692 return reasonElement; |
| 697 }; | 693 }; |
| OLD | NEW |