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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleWidget.js

Issue 2393763002: [DevTools] Cleanup DOMExtension.js. (Closed)
Patch Set: review comments 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 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 name: propertyName, 200 name: propertyName,
201 value: propertyValue 201 value: propertyValue
202 }; 202 };
203 var isOdd = this._propertiesOutline.rootElement().children().length % 2 === 0; 203 var isOdd = this._propertiesOutline.rootElement().children().length % 2 === 0;
204 treeElement.listItemElement.classList.toggle("odd-row", isOdd); 204 treeElement.listItemElement.classList.toggle("odd-row", isOdd);
205 this._propertiesOutline.appendChild(treeElement); 205 this._propertiesOutline.appendChild(treeElement);
206 206
207 var trace = propertyTraces.get(propertyName); 207 var trace = propertyTraces.get(propertyName);
208 if (trace) { 208 if (trace) {
209 var activeProperty = this._renderPropertyTrace(cssModel, matched Styles, nodeStyle.node, treeElement, trace); 209 var activeProperty = this._renderPropertyTrace(cssModel, matched Styles, nodeStyle.node, treeElement, trace);
210 treeElement.listItemElement.addEventListener("mousedown", consum eEvent, false); 210 treeElement.listItemElement.addEventListener("mousedown", (e) => e.consume(), false);
211 treeElement.listItemElement.addEventListener("dblclick", consume Event, false); 211 treeElement.listItemElement.addEventListener("dblclick", (e) => e.consume(), false);
212 treeElement.listItemElement.addEventListener("click", handleClic k.bind(null, treeElement), false); 212 treeElement.listItemElement.addEventListener("click", handleClic k.bind(null, treeElement), false);
213 var gotoSourceElement = propertyValueElement.createChild("div", "goto-source-icon"); 213 var gotoSourceElement = propertyValueElement.createChild("div", "goto-source-icon");
214 gotoSourceElement.addEventListener("click", this._navigateToSour ce.bind(this, activeProperty)); 214 gotoSourceElement.addEventListener("click", this._navigateToSour ce.bind(this, activeProperty));
215 if (expandedProperties.has(propertyName)) 215 if (expandedProperties.has(propertyName))
216 treeElement.expand(); 216 treeElement.expand();
217 } 217 }
218 } 218 }
219 219
220 this._updateFilter(this._filterRegex); 220 this._updateFilter(this._filterRegex);
221 221
(...skipping 14 matching lines...) Expand all
236 /** 236 /**
237 * @param {!TreeElement} treeElement 237 * @param {!TreeElement} treeElement
238 * @param {!Event} event 238 * @param {!Event} event
239 */ 239 */
240 function handleClick(treeElement, event) 240 function handleClick(treeElement, event)
241 { 241 {
242 if (!treeElement.expanded) 242 if (!treeElement.expanded)
243 treeElement.expand(); 243 treeElement.expand();
244 else 244 else
245 treeElement.collapse(); 245 treeElement.collapse();
246 consumeEvent(event); 246 event.consume();
247 } 247 }
248 }, 248 },
249 249
250 /** 250 /**
251 * @param {!WebInspector.CSSProperty} cssProperty 251 * @param {!WebInspector.CSSProperty} cssProperty
252 * @param {!Event} event 252 * @param {!Event} event
253 */ 253 */
254 _navigateToSource: function(cssProperty, event) 254 _navigateToSource: function(cssProperty, event)
255 { 255 {
256 WebInspector.Revealer.reveal(cssProperty); 256 WebInspector.Revealer.reveal(cssProperty);
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 var children = this._propertiesOutline.rootElement().children(); 351 var children = this._propertiesOutline.rootElement().children();
352 for (var child of children) { 352 for (var child of children) {
353 var property = child[WebInspector.ComputedStyleWidget._propertySymbo l]; 353 var property = child[WebInspector.ComputedStyleWidget._propertySymbo l];
354 var matched = !regex || regex.test(property.name) || regex.test(prop erty.value); 354 var matched = !regex || regex.test(property.name) || regex.test(prop erty.value);
355 child.hidden = !matched; 355 child.hidden = !matched;
356 } 356 }
357 }, 357 },
358 358
359 __proto__: WebInspector.ThrottledWidget.prototype 359 __proto__: WebInspector.ThrottledWidget.prototype
360 } 360 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698