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

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

Issue 1599503002: DevTools: computed properties should copy-paste with delimeters (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update tests Created 4 years, 11 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 continue; 152 continue;
153 153
154 var propertyElement = createElement("div"); 154 var propertyElement = createElement("div");
155 propertyElement.classList.add("computed-style-property"); 155 propertyElement.classList.add("computed-style-property");
156 propertyElement.classList.toggle("computed-style-property-inherited" , inherited); 156 propertyElement.classList.toggle("computed-style-property-inherited" , inherited);
157 var renderer = new WebInspector.StylesSidebarPropertyRenderer(null, nodeStyle.node, propertyName, /** @type {string} */(propertyValue)); 157 var renderer = new WebInspector.StylesSidebarPropertyRenderer(null, nodeStyle.node, propertyName, /** @type {string} */(propertyValue));
158 renderer.setColorHandler(this._processColor.bind(this)); 158 renderer.setColorHandler(this._processColor.bind(this));
159 var propertyNameElement = renderer.renderName(); 159 var propertyNameElement = renderer.renderName();
160 propertyNameElement.classList.add("property-name"); 160 propertyNameElement.classList.add("property-name");
161 propertyElement.appendChild(propertyNameElement); 161 propertyElement.appendChild(propertyNameElement);
162
163 var colon = createElementWithClass("span", "delimeter");
164 colon.textContent = ":";
165 propertyNameElement.appendChild(colon);
166
162 var propertyValueElement = renderer.renderValue(); 167 var propertyValueElement = renderer.renderValue();
163 propertyValueElement.classList.add("property-value"); 168 propertyValueElement.classList.add("property-value");
164 propertyElement.appendChild(propertyValueElement); 169 propertyElement.appendChild(propertyValueElement);
165 170
171 var semicolon = createElementWithClass("span", "delimeter");
172 semicolon.textContent = ";";
173 propertyValueElement.appendChild(semicolon);
174
166 var treeElement = new TreeElement(); 175 var treeElement = new TreeElement();
167 treeElement.selectable = false; 176 treeElement.selectable = false;
168 treeElement.title = propertyElement; 177 treeElement.title = propertyElement;
169 treeElement[WebInspector.ComputedStyleWidget._propertySymbol] = { 178 treeElement[WebInspector.ComputedStyleWidget._propertySymbol] = {
170 name: propertyName, 179 name: propertyName,
171 value: propertyValue 180 value: propertyValue
172 }; 181 };
173 var isOdd = this._propertiesOutline.rootElement().children().length % 2 === 0; 182 var isOdd = this._propertiesOutline.rootElement().children().length % 2 === 0;
174 treeElement.listItemElement.classList.toggle("odd-row", isOdd); 183 treeElement.listItemElement.classList.toggle("odd-row", isOdd);
175 this._propertiesOutline.appendChild(treeElement); 184 this._propertiesOutline.appendChild(treeElement);
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 var children = this._propertiesOutline.rootElement().children(); 304 var children = this._propertiesOutline.rootElement().children();
296 for (var child of children) { 305 for (var child of children) {
297 var property = child[WebInspector.ComputedStyleWidget._propertySymbo l]; 306 var property = child[WebInspector.ComputedStyleWidget._propertySymbo l];
298 var matched = !regex || regex.test(property.name) || regex.test(prop erty.value); 307 var matched = !regex || regex.test(property.name) || regex.test(prop erty.value);
299 child.hidden = !matched; 308 child.hidden = !matched;
300 } 309 }
301 }, 310 },
302 311
303 __proto__: WebInspector.ThrottledWidget.prototype 312 __proto__: WebInspector.ThrottledWidget.prototype
304 } 313 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698