| 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.ARIAAttributesPane = class extends Accessibility.AccessibilitySubP
ane { | 7 Accessibility.ARIAAttributesPane = class extends Accessibility.AccessibilitySubP
ane { |
| 8 constructor() { | 8 constructor() { |
| 9 super(Common.UIString('ARIA Attributes')); | 9 super(Common.UIString('ARIA Attributes')); |
| 10 | 10 |
| 11 this._noPropertiesInfo = this.createInfo(Common.UIString('No ARIA attributes
')); | 11 this._noPropertiesInfo = this.createInfo(Common.UIString('No ARIA attributes
')); |
| 12 this._treeOutline = this.createTreeOutline(); | 12 this._treeOutline = this.createTreeOutline(); |
| 13 } | 13 } |
| 14 | 14 |
| 15 /** | 15 /** |
| 16 * @override | 16 * @override |
| 17 * @param {?SDK.DOMNode} node | 17 * @param {?SDK.DOMNode} node |
| 18 */ | 18 */ |
| 19 setNode(node) { | 19 setNode(node) { |
| 20 super.setNode(node); | 20 super.setNode(node); |
| 21 this._treeOutline.removeChildren(); | 21 this._treeOutline.removeChildren(); |
| 22 if (!this.node()) | 22 if (!this.node()) |
| 23 return; | 23 return; |
| 24 var target = this.node().target(); | 24 var target = this.node().domModel().target(); |
| 25 var attributes = node.attributes(); | 25 var attributes = node.attributes(); |
| 26 for (var i = 0; i < attributes.length; ++i) { | 26 for (var i = 0; i < attributes.length; ++i) { |
| 27 var attribute = attributes[i]; | 27 var attribute = attributes[i]; |
| 28 if (Accessibility.ARIAAttributesPane._attributes.indexOf(attribute.name) <
0) | 28 if (Accessibility.ARIAAttributesPane._attributes.indexOf(attribute.name) <
0) |
| 29 continue; | 29 continue; |
| 30 this._treeOutline.appendChild(new Accessibility.ARIAAttributesTreeElement(
this, attribute, target)); | 30 this._treeOutline.appendChild(new Accessibility.ARIAAttributesTreeElement(
this, attribute, target)); |
| 31 } | 31 } |
| 32 | 32 |
| 33 var foundAttributes = (this._treeOutline.rootElement().childCount() !== 0); | 33 var foundAttributes = (this._treeOutline.rootElement().childCount() !== 0); |
| 34 this._noPropertiesInfo.classList.toggle('hidden', foundAttributes); | 34 this._noPropertiesInfo.classList.toggle('hidden', foundAttributes); |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 'aria-readonly', | 247 'aria-readonly', |
| 248 'aria-relevant', | 248 'aria-relevant', |
| 249 'aria-required', | 249 'aria-required', |
| 250 'aria-setsize', | 250 'aria-setsize', |
| 251 'aria-sort', | 251 'aria-sort', |
| 252 'aria-valuemax', | 252 'aria-valuemax', |
| 253 'aria-valuemin', | 253 'aria-valuemin', |
| 254 'aria-valuenow', | 254 'aria-valuenow', |
| 255 'aria-valuetext', | 255 'aria-valuetext', |
| 256 ]; | 256 ]; |
| OLD | NEW |