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

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

Issue 2310633002: DevTools: Reduce color parsing by passing in Color to ColorSwatch (Closed)
Patch Set: Get color from model Created 4 years, 3 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 /** 122 /**
123 * @param {string} text 123 * @param {string} text
124 * @return {!Node} 124 * @return {!Node}
125 */ 125 */
126 _processColor: function(text) 126 _processColor: function(text)
127 { 127 {
128 var color = WebInspector.Color.parse(text); 128 var color = WebInspector.Color.parse(text);
129 if (!color) 129 if (!color)
130 return createTextNode(text); 130 return createTextNode(text);
131 var swatch = WebInspector.ColorSwatch.create(); 131 var swatch = WebInspector.ColorSwatch.create();
132 swatch.setColorText(text); 132 swatch.setColor(color);
133 swatch.setFormat(WebInspector.Color.detectColorFormat(color)); 133 swatch.setFormat(WebInspector.Color.detectColorFormat(color));
134 return swatch; 134 return swatch;
135 }, 135 },
136 136
137 /** 137 /**
138 * @param {?WebInspector.ComputedStyleModel.ComputedStyle} nodeStyle 138 * @param {?WebInspector.ComputedStyleModel.ComputedStyle} nodeStyle
139 * @param {?WebInspector.CSSMatchedStyles} matchedStyles 139 * @param {?WebInspector.CSSMatchedStyles} matchedStyles
140 */ 140 */
141 _innerRebuildUpdate: function(nodeStyle, matchedStyles) 141 _innerRebuildUpdate: function(nodeStyle, matchedStyles)
142 { 142 {
(...skipping 208 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