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

Side by Side Diff: Source/devtools/front_end/LayerTree.js

Issue 83123002: DevTools: Move DOMNode.appropriateSelectorFor() into DOMPresentationUtil. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 { 191 {
192 var selection = document.createElement("div"); 192 var selection = document.createElement("div");
193 selection.className = "selection"; 193 selection.className = "selection";
194 this.listItemElement.insertBefore(selection, this.listItemElement.firstC hild); 194 this.listItemElement.insertBefore(selection, this.listItemElement.firstC hild);
195 }, 195 },
196 196
197 _update: function() 197 _update: function()
198 { 198 {
199 var layer = /** @type {WebInspector.Layer} */ (this.representedObject); 199 var layer = /** @type {WebInspector.Layer} */ (this.representedObject);
200 var nodeId = layer.nodeIdForSelfOrAncestor(); 200 var nodeId = layer.nodeIdForSelfOrAncestor();
201 var node = nodeId && WebInspector.domAgent.nodeForId(nodeId); 201 var node = nodeId ? WebInspector.domAgent.nodeForId(nodeId) : null;
202 var title = document.createDocumentFragment(); 202 var title = document.createDocumentFragment();
203 title.createChild("div", "selection"); 203 title.createChild("div", "selection");
204 title.appendChild(document.createTextNode(node ? node.appropriateSelecto rFor(false) : "#" + layer.id())); 204 title.appendChild(document.createTextNode(node ? WebInspector.DOMPresent ationUtils.appropriateSelectorFor(node, false) : "#" + layer.id()));
205 var details = title.createChild("span", "dimmed"); 205 var details = title.createChild("span", "dimmed");
206 details.textContent = WebInspector.UIString(" (%d × %d)", layer.width(), layer.height()); 206 details.textContent = WebInspector.UIString(" (%d × %d)", layer.width(), layer.height());
207 this.title = title; 207 this.title = title;
208 }, 208 },
209 209
210 onselect: function() 210 onselect: function()
211 { 211 {
212 this._layerTree._selectedNodeChanged(this); 212 this._layerTree._selectedNodeChanged(this);
213 }, 213 },
214 214
215 /** 215 /**
216 * @param {boolean} hovered 216 * @param {boolean} hovered
217 */ 217 */
218 setHovered: function(hovered) 218 setHovered: function(hovered)
219 { 219 {
220 this.listItemElement.enableStyleClass("hovered", hovered); 220 this.listItemElement.enableStyleClass("hovered", hovered);
221 }, 221 },
222 222
223 __proto__: TreeElement.prototype 223 __proto__: TreeElement.prototype
224 } 224 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/EventListenersSidebarPane.js ('k') | Source/devtools/front_end/StylesSidebarPane.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698