| 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 * @unrestricted | 5 * @unrestricted |
| 6 */ | 6 */ |
| 7 Accessibility.AXNodeSubPane = class extends Accessibility.AccessibilitySubPane { | 7 Accessibility.AXNodeSubPane = class extends Accessibility.AccessibilitySubPane { |
| 8 constructor() { | 8 constructor() { |
| 9 super(Common.UIString('Computed Properties')); | 9 super(Common.UIString('Computed Properties')); |
| 10 | 10 |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 var nodeTreeElement = | 340 var nodeTreeElement = |
| 341 new Accessibility.AXRelatedNodeSourceTreeElement({deferredNode: deferred
Node, idref: idref}, relatedNode); | 341 new Accessibility.AXRelatedNodeSourceTreeElement({deferredNode: deferred
Node, idref: idref}, relatedNode); |
| 342 this.appendChild(nodeTreeElement); | 342 this.appendChild(nodeTreeElement); |
| 343 } | 343 } |
| 344 | 344 |
| 345 /** | 345 /** |
| 346 * @param {!Protocol.Accessibility.AXValue} value | 346 * @param {!Protocol.Accessibility.AXValue} value |
| 347 */ | 347 */ |
| 348 appendIDRefValueElement(value) { | 348 appendIDRefValueElement(value) { |
| 349 var relatedNodes = value.relatedNodes; | 349 var relatedNodes = value.relatedNodes; |
| 350 var numNodes = relatedNodes.length; | |
| 351 var valueElement; | |
| 352 | 350 |
| 353 var idrefs = value.value.trim().split(/\s+/); | 351 var idrefs = value.value.trim().split(/\s+/); |
| 354 if (idrefs.length === 1) { | 352 if (idrefs.length === 1) { |
| 355 var idref = idrefs[0]; | 353 var idref = idrefs[0]; |
| 356 var matchingNode = relatedNodes.find(node => node.idref === idref); | 354 var matchingNode = relatedNodes.find(node => node.idref === idref); |
| 357 if (matchingNode) | 355 if (matchingNode) |
| 358 this.appendRelatedNodeWithIdref(matchingNode, 0, idref); | 356 this.appendRelatedNodeWithIdref(matchingNode, 0, idref); |
| 359 else | 357 else |
| 360 this.listItemElement.appendChild(new Accessibility.AXRelatedNodeElement(
{idref: idref}).render()); | 358 this.listItemElement.appendChild(new Accessibility.AXRelatedNodeElement(
{idref: idref}).render()); |
| 361 | 359 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 this.collapse(); | 391 this.collapse(); |
| 394 } | 392 } |
| 395 | 393 |
| 396 /** | 394 /** |
| 397 * @param {!Protocol.Accessibility.AXValueSource} source | 395 * @param {!Protocol.Accessibility.AXValueSource} source |
| 398 */ | 396 */ |
| 399 appendSourceNameElement(source) { | 397 appendSourceNameElement(source) { |
| 400 var nameElement = createElement('span'); | 398 var nameElement = createElement('span'); |
| 401 var AXValueSourceType = Protocol.Accessibility.AXValueSourceType; | 399 var AXValueSourceType = Protocol.Accessibility.AXValueSourceType; |
| 402 var type = source.type; | 400 var type = source.type; |
| 403 var name; | |
| 404 switch (type) { | 401 switch (type) { |
| 405 case AXValueSourceType.Attribute: | 402 case AXValueSourceType.Attribute: |
| 406 case AXValueSourceType.Placeholder: | 403 case AXValueSourceType.Placeholder: |
| 407 case AXValueSourceType.RelatedElement: | 404 case AXValueSourceType.RelatedElement: |
| 408 if (source.nativeSource) { | 405 if (source.nativeSource) { |
| 409 var AXNativeSourceTypes = Accessibility.AccessibilityStrings.AXNativeS
ourceTypes; | 406 var AXNativeSourceTypes = Accessibility.AccessibilityStrings.AXNativeS
ourceTypes; |
| 410 var nativeSource = source.nativeSource; | 407 var nativeSource = source.nativeSource; |
| 411 nameElement.textContent = Common.UIString(AXNativeSourceTypes[nativeSo
urce].name); | 408 nameElement.textContent = Common.UIString(AXNativeSourceTypes[nativeSo
urce].name); |
| 412 nameElement.title = Common.UIString(AXNativeSourceTypes[nativeSource].
description); | 409 nameElement.title = Common.UIString(AXNativeSourceTypes[nativeSource].
description); |
| 413 nameElement.classList.add('ax-readable-name'); | 410 nameElement.classList.add('ax-readable-name'); |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 | 648 |
| 652 this._reasonElement = | 649 this._reasonElement = |
| 653 Accessibility.AXNodeIgnoredReasonTreeElement.createReasonElement(this._p
roperty.name, this._axNode); | 650 Accessibility.AXNodeIgnoredReasonTreeElement.createReasonElement(this._p
roperty.name, this._axNode); |
| 654 this.listItemElement.appendChild(this._reasonElement); | 651 this.listItemElement.appendChild(this._reasonElement); |
| 655 | 652 |
| 656 var value = this._property.value; | 653 var value = this._property.value; |
| 657 if (value.type === Protocol.Accessibility.AXValueType.Idref) | 654 if (value.type === Protocol.Accessibility.AXValueType.Idref) |
| 658 this.appendRelatedNodeListValueElement(value); | 655 this.appendRelatedNodeListValueElement(value); |
| 659 } | 656 } |
| 660 }; | 657 }; |
| OLD | NEW |