OLD | NEW |
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 if (!layer.drawsContent() && !showInternalLayers) | 120 if (!layer.drawsContent() && !showInternalLayers) |
121 return; | 121 return; |
122 if (seenLayers.get(layer)) | 122 if (seenLayers.get(layer)) |
123 console.assert(false, "Duplicate layer: " + layer.id()); | 123 console.assert(false, "Duplicate layer: " + layer.id()); |
124 seenLayers.set(layer, true); | 124 seenLayers.set(layer, true); |
125 var node = layer[WebInspector.LayerTreeElement._symbol]; | 125 var node = layer[WebInspector.LayerTreeElement._symbol]; |
126 var parentLayer = layer.parent(); | 126 var parentLayer = layer.parent(); |
127 // Skip till nearest visible ancestor. | 127 // Skip till nearest visible ancestor. |
128 while (parentLayer && parentLayer !== root && !parentLayer.drawsCont
ent() && !showInternalLayers) | 128 while (parentLayer && parentLayer !== root && !parentLayer.drawsCont
ent() && !showInternalLayers) |
129 parentLayer = parentLayer.parent(); | 129 parentLayer = parentLayer.parent(); |
130 var parent = layer === root ? this._treeOutline : parentLayer[WebIns
pector.LayerTreeElement._symbol]; | 130 var parent = layer === root ? this._treeOutline.rootElement() : pare
ntLayer[WebInspector.LayerTreeElement._symbol]; |
131 if (!parent) { | 131 if (!parent) { |
132 console.assert(false, "Parent is not in the tree"); | 132 console.assert(false, "Parent is not in the tree"); |
133 return; | 133 return; |
134 } | 134 } |
135 if (!node) { | 135 if (!node) { |
136 node = new WebInspector.LayerTreeElement(this, layer); | 136 node = new WebInspector.LayerTreeElement(this, layer); |
137 parent.appendChild(node); | 137 parent.appendChild(node); |
138 // Expand all new non-content layers to expose content layers be
tter. | 138 // Expand all new non-content layers to expose content layers be
tter. |
139 if (!layer.drawsContent()) | 139 if (!layer.drawsContent()) |
140 node.expand(); | 140 node.expand(); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 /** | 252 /** |
253 * @param {boolean} hovered | 253 * @param {boolean} hovered |
254 */ | 254 */ |
255 setHovered: function(hovered) | 255 setHovered: function(hovered) |
256 { | 256 { |
257 this.listItemElement.classList.toggle("hovered", hovered); | 257 this.listItemElement.classList.toggle("hovered", hovered); |
258 }, | 258 }, |
259 | 259 |
260 __proto__: TreeElement.prototype | 260 __proto__: TreeElement.prototype |
261 } | 261 } |
OLD | NEW |