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

Unified Diff: third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js

Issue 2252913002: DevTools: Box-shadow editor initial implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shadowIcon
Patch Set: Heavily updated Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
index ecce5577c5b26f8c001591d64c9801b97ae7414a..da64fe5b9065423470e4a884362f4de0df8128a2 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
@@ -2027,11 +2027,14 @@ WebInspector.StylePropertyTreeElement.prototype = {
{
if (!this._editable())
return createTextNode(propertyValue);
- var shadows;
- if (propertyName === "text-shadow")
+ var shadows, isBoxShadow;
dgozman 2016/08/24 19:18:30 style: one variable per declaration
flandy 2016/08/24 22:08:41 Done.
+ if (propertyName === "text-shadow") {
shadows = WebInspector.CSSShadowModel.parseTextShadow(propertyValue);
- else
+ isBoxShadow = false;
+ } else {
shadows = WebInspector.CSSShadowModel.parseBoxShadow(propertyValue);
+ isBoxShadow = true;
+ }
if (!shadows.length)
return createTextNode(propertyValue);
var container = createDocumentFragment();
@@ -2042,6 +2045,7 @@ WebInspector.StylePropertyTreeElement.prototype = {
// TODO(flandy): editing the property value should use the original value with all spaces.
var cssShadowSwatch = WebInspector.CSSShadowSwatch.create();
cssShadowSwatch.setCSSShadow(shadows[i]);
+ new WebInspector.ShadowSwatchPopoverHelper(this, swatchPopoverHelper, cssShadowSwatch, isBoxShadow);
container.appendChild(cssShadowSwatch);
}
return container;

Powered by Google App Engine
This is Rietveld 408576698