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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline/LayerTreeOutline.js

Issue 1463143005: DevTools: avoid layout thrashing on Layers panel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: extracted reveal() change Created 5 years 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/timeline/LayerViewHost.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/timeline/LayerViewHost.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698