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/elements/ComputedStyleWidget.js

Issue 1434613002: DevTools: kill WebInspector.StylesSectionModel class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 5 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
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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 } 249 }
250 }, 250 },
251 251
252 /** 252 /**
253 * @param {!WebInspector.SectionCascade} matchedCascade 253 * @param {!WebInspector.SectionCascade} matchedCascade
254 * @return {!Map<string, !Array<!WebInspector.CSSProperty>>} 254 * @return {!Map<string, !Array<!WebInspector.CSSProperty>>}
255 */ 255 */
256 _computePropertyTraces: function(matchedCascade) 256 _computePropertyTraces: function(matchedCascade)
257 { 257 {
258 var result = new Map(); 258 var result = new Map();
259 var models = matchedCascade.sectionModels(); 259 var styles = matchedCascade.styles();
260 for (var model of models) { 260 for (var style of styles) {
261 var allProperties = model.style().allProperties; 261 var allProperties = style.allProperties;
262 for (var property of allProperties) { 262 for (var property of allProperties) {
263 if (!property.activeInStyle() || !matchedCascade.propertyState(p roperty)) 263 if (!property.activeInStyle() || !matchedCascade.propertyState(p roperty))
264 continue; 264 continue;
265 if (!result.has(property.name)) 265 if (!result.has(property.name))
266 result.set(property.name, []); 266 result.set(property.name, []);
267 result.get(property.name).push(property); 267 result.get(property.name).push(property);
268 } 268 }
269 } 269 }
270 return result; 270 return result;
271 }, 271 },
272 272
273 /** 273 /**
274 * @param {!WebInspector.SectionCascade} matchedCascade 274 * @param {!WebInspector.SectionCascade} matchedCascade
275 * @return {!Set<string>} 275 * @return {!Set<string>}
276 */ 276 */
277 _computeInheritedProperties: function(matchedCascade) 277 _computeInheritedProperties: function(matchedCascade)
278 { 278 {
279 var result = new Set(); 279 var result = new Set();
280 for (var model of matchedCascade.sectionModels()) { 280 for (var style of matchedCascade.styles()) {
281 for (var property of model.style().allProperties) { 281 for (var property of style.allProperties) {
282 if (!matchedCascade.propertyState(property)) 282 if (!matchedCascade.propertyState(property))
283 continue; 283 continue;
284 result.add(WebInspector.CSSMetadata.canonicalPropertyName(proper ty.name)); 284 result.add(WebInspector.CSSMetadata.canonicalPropertyName(proper ty.name));
285 } 285 }
286 } 286 }
287 return result; 287 return result;
288 }, 288 },
289 289
290 /** 290 /**
291 * @param {?RegExp} regex 291 * @param {?RegExp} regex
292 */ 292 */
293 _updateFilter: function(regex) 293 _updateFilter: function(regex)
294 { 294 {
295 var children = this._propertiesOutline.rootElement().children(); 295 var children = this._propertiesOutline.rootElement().children();
296 for (var child of children) { 296 for (var child of children) {
297 var property = child[WebInspector.ComputedStyleWidget._propertySymbo l]; 297 var property = child[WebInspector.ComputedStyleWidget._propertySymbo l];
298 var matched = !regex || regex.test(property.name) || regex.test(prop erty.value); 298 var matched = !regex || regex.test(property.name) || regex.test(prop erty.value);
299 child.hidden = !matched; 299 child.hidden = !matched;
300 } 300 }
301 }, 301 },
302 302
303 __proto__: WebInspector.ThrottledWidget.prototype 303 __proto__: WebInspector.ThrottledWidget.prototype
304 } 304 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698