Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/accessibility/ARIAAttributesView.js

Issue 2436703003: DevTools: Flesh out AccessibilityModel and use SDK objects instead of protocol objects (Closed)
Patch Set: revert accessibilityNode.css Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.ARIAAttributesPane = function() 9 WebInspector.ARIAAttributesPane = function()
10 { 10 {
(...skipping 28 matching lines...) Expand all
39 this._noPropertiesInfo.classList.toggle("hidden", foundAttributes); 39 this._noPropertiesInfo.classList.toggle("hidden", foundAttributes);
40 this._treeOutline.element.classList.toggle("hidden", !foundAttributes); 40 this._treeOutline.element.classList.toggle("hidden", !foundAttributes);
41 }, 41 },
42 42
43 __proto__: WebInspector.AccessibilitySubPane.prototype 43 __proto__: WebInspector.AccessibilitySubPane.prototype
44 }; 44 };
45 45
46 46
47 /** 47 /**
48 * @constructor 48 * @constructor
49 * @extends {WebInspector.AXNodePropertyTreeElement} 49 * @extends {TreeElement}
50 * @param {!WebInspector.ARIAAttributesPane} parentPane 50 * @param {!WebInspector.ARIAAttributesPane} parentPane
51 * @param {!WebInspector.DOMNode.Attribute} attribute 51 * @param {!WebInspector.DOMNode.Attribute} attribute
52 * @param {!WebInspector.Target} target 52 * @param {!WebInspector.Target} target
53 */ 53 */
54 WebInspector.ARIAAttributesTreeElement = function(parentPane, attribute, target) 54 WebInspector.ARIAAttributesTreeElement = function(parentPane, attribute, target)
55 { 55 {
56 WebInspector.AXNodePropertyTreeElement.call(this, target); 56 TreeElement.call(this, "");
57 57
58 this._parentPane = parentPane; 58 this._parentPane = parentPane;
59 this._attribute = attribute; 59 this._attribute = attribute;
60 60
61 this.selectable = false; 61 this.selectable = false;
62 }; 62 };
63 63
64 WebInspector.ARIAAttributesTreeElement.prototype = { 64 WebInspector.ARIAAttributesTreeElement.prototype = {
65 /** 65 /**
66 * @override 66 * @override
67 */ 67 */
68 onattach: function() 68 onattach: function()
69 { 69 {
70 this._populateListItem(); 70 this._populateListItem();
71 this.listItemElement.addEventListener("click", this._mouseClick.bind(thi s)); 71 this.listItemElement.addEventListener("click", this._mouseClick.bind(thi s));
72 }, 72 },
73 73
74 _populateListItem: function() 74 _populateListItem: function()
75 { 75 {
76 this.listItemElement.removeChildren(); 76 this.listItemElement.removeChildren();
77 this.appendNameElement(this._attribute.name); 77 this.appendNameElement(this._attribute.name);
78 this.listItemElement.createChild("span", "separator").textContent = ":\u 00A0"; 78 this.listItemElement.createChild("span", "separator").textContent = ":\u 00A0";
79 this.appendAttributeValueElement(this._attribute.value); 79 this.appendAttributeValueElement(this._attribute.value);
80 }, 80 },
81 81
82 /** 82 /**
83 * @override
84 * @param {string} name 83 * @param {string} name
85 */ 84 */
86 appendNameElement: function(name) 85 appendNameElement: function(name)
87 { 86 {
88 this._nameElement = createElement("span"); 87 this._nameElement = createElement("span");
89 this._nameElement.textContent = name; 88 this._nameElement.textContent = name;
90 this._nameElement.classList.add("ax-name"); 89 this._nameElement.classList.add("ax-name");
91 this._nameElement.classList.add("monospace"); 90 this._nameElement.classList.add("monospace");
92 this.listItemElement.appendChild(this._nameElement); 91 this.listItemElement.appendChild(this._nameElement);
93 }, 92 },
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 return; 184 return;
186 } 185 }
187 186
188 if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Esc.code || eve nt.keyIdentifier === "U+001B") { 187 if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Esc.code || eve nt.keyIdentifier === "U+001B") {
189 this._editingCancelled(); 188 this._editingCancelled();
190 event.consume(); 189 event.consume();
191 return; 190 return;
192 } 191 }
193 }, 192 },
194 193
195 __proto__: WebInspector.AXNodePropertyTreeElement.prototype 194 __proto__: TreeElement.prototype
196 }; 195 };
197 196
198 /** 197 /**
199 * @param {string} value 198 * @param {string} value
200 * @return {!Element} 199 * @return {!Element}
201 */ 200 */
202 WebInspector.ARIAAttributesTreeElement.createARIAValueElement = function(value) 201 WebInspector.ARIAAttributesTreeElement.createARIAValueElement = function(value)
203 { 202 {
204 var valueElement = createElementWithClass("span", "monospace"); 203 var valueElement = createElementWithClass("span", "monospace");
205 // TODO(aboxhall): quotation marks? 204 // TODO(aboxhall): quotation marks?
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 "aria-readonly", 277 "aria-readonly",
279 "aria-relevant", 278 "aria-relevant",
280 "aria-required", 279 "aria-required",
281 "aria-setsize", 280 "aria-setsize",
282 "aria-sort", 281 "aria-sort",
283 "aria-valuemax", 282 "aria-valuemax",
284 "aria-valuemin", 283 "aria-valuemin",
285 "aria-valuenow", 284 "aria-valuenow",
286 "aria-valuetext", 285 "aria-valuetext",
287 ]; 286 ];
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698