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

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

Issue 2716593007: DevTools: Don't show CSS variables in ComputedStyleWidget unless showing all (Closed)
Patch Set: Reset test result Created 3 years, 9 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
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/elements/styles-3/styles-variables-expected.txt ('k') | no next file » | 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) 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 var propertyTraces = this._computePropertyTraces(matchedStyles); 151 var propertyTraces = this._computePropertyTraces(matchedStyles);
152 var inhertiedProperties = this._computeInheritedProperties(matchedStyles); 152 var inhertiedProperties = this._computeInheritedProperties(matchedStyles);
153 var showInherited = this._showInheritedComputedStylePropertiesSetting.get(); 153 var showInherited = this._showInheritedComputedStylePropertiesSetting.get();
154 for (var i = 0; i < uniqueProperties.length; ++i) { 154 for (var i = 0; i < uniqueProperties.length; ++i) {
155 var propertyName = uniqueProperties[i]; 155 var propertyName = uniqueProperties[i];
156 var propertyValue = nodeStyle.computedStyle.get(propertyName); 156 var propertyValue = nodeStyle.computedStyle.get(propertyName);
157 var canonicalName = SDK.cssMetadata().canonicalPropertyName(propertyName); 157 var canonicalName = SDK.cssMetadata().canonicalPropertyName(propertyName);
158 var inherited = !inhertiedProperties.has(canonicalName); 158 var inherited = !inhertiedProperties.has(canonicalName);
159 if (!showInherited && inherited && !(propertyName in this._alwaysShowCompu tedProperties)) 159 if (!showInherited && inherited && !(propertyName in this._alwaysShowCompu tedProperties))
160 continue; 160 continue;
161 if (!showInherited && propertyName.startsWith('--'))
162 continue;
161 if (propertyName !== canonicalName && propertyValue === nodeStyle.computed Style.get(canonicalName)) 163 if (propertyName !== canonicalName && propertyValue === nodeStyle.computed Style.get(canonicalName))
162 continue; 164 continue;
163 165
164 var propertyElement = createElement('div'); 166 var propertyElement = createElement('div');
165 propertyElement.classList.add('computed-style-property'); 167 propertyElement.classList.add('computed-style-property');
166 propertyElement.classList.toggle('computed-style-property-inherited', inhe rited); 168 propertyElement.classList.toggle('computed-style-property-inherited', inhe rited);
167 var renderer = new Elements.StylesSidebarPropertyRenderer( 169 var renderer = new Elements.StylesSidebarPropertyRenderer(
168 null, nodeStyle.node, propertyName, /** @type {string} */ (propertyVal ue)); 170 null, nodeStyle.node, propertyName, /** @type {string} */ (propertyVal ue));
169 renderer.setColorHandler(this._processColor.bind(this)); 171 renderer.setColorHandler(this._processColor.bind(this));
170 var propertyNameElement = renderer.renderName(); 172 var propertyNameElement = renderer.renderName();
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 var property = child[Elements.ComputedStyleWidget._propertySymbol]; 341 var property = child[Elements.ComputedStyleWidget._propertySymbol];
340 var matched = !regex || regex.test(property.name) || regex.test(property.v alue); 342 var matched = !regex || regex.test(property.name) || regex.test(property.v alue);
341 child.hidden = !matched; 343 child.hidden = !matched;
342 } 344 }
343 } 345 }
344 }; 346 };
345 347
346 Elements.ComputedStyleWidget._maxLinkLength = 30; 348 Elements.ComputedStyleWidget._maxLinkLength = 30;
347 349
348 Elements.ComputedStyleWidget._propertySymbol = Symbol('property'); 350 Elements.ComputedStyleWidget._propertySymbol = Symbol('property');
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/elements/styles-3/styles-variables-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698