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

Unified Diff: third_party/WebKit/Source/devtools/front_end/common/CSSShadowModel.js

Issue 2252913002: DevTools: Box-shadow editor initial implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shadowIcon
Patch Set: Merge 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/common/CSSShadowModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/common/CSSShadowModel.js b/third_party/WebKit/Source/devtools/front_end/common/CSSShadowModel.js
index 6d8b440078a82109d2c07d965450c421bec03991..f372d6f85f29efded224526226c5ba6852594944 100644
--- a/third_party/WebKit/Source/devtools/front_end/common/CSSShadowModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/common/CSSShadowModel.js
@@ -4,9 +4,11 @@
/**
* @constructor
+ * @param {boolean} isBoxShadow
*/
-WebInspector.CSSShadowModel = function()
+WebInspector.CSSShadowModel = function(isBoxShadow)
{
+ this._isBoxShadow = isBoxShadow;
this._inset = false;
this._offsetX = WebInspector.CSSLength.zero();
this._offsetY = WebInspector.CSSLength.zero();
@@ -59,11 +61,17 @@ WebInspector.CSSShadowModel.prototype = {
/**
* @param {!WebInspector.CSSLength} offsetX
- * @param {!WebInspector.CSSLength} offsetY
*/
- setOffset: function(offsetX, offsetY)
+ setOffsetX: function(offsetX)
{
this._offsetX = offsetX;
+ },
+
+ /**
+ * @param {!WebInspector.CSSLength} offsetY
+ */
+ setOffsetY: function(offsetY)
+ {
this._offsetY = offsetY;
},
@@ -105,6 +113,14 @@ WebInspector.CSSShadowModel.prototype = {
/**
* @return {boolean}
*/
+ isBoxShadow: function()
+ {
+ return this._isBoxShadow;
+ },
+
+ /**
+ * @return {boolean}
+ */
inset: function()
{
return this._inset;
@@ -197,7 +213,7 @@ WebInspector.CSSShadowModel._parseShadow = function(text, isBoxShadow)
var shadows = [];
for (var i = 0; i < shadowTexts.length; i++) {
- var shadow = new WebInspector.CSSShadowModel();
+ var shadow = new WebInspector.CSSShadowModel(isBoxShadow);
shadow._format = [];
var nextPartAllowed = true;
var regexes = [/inset/gi, WebInspector.Color.Regex, WebInspector.CSSLength.Regex];

Powered by Google App Engine
This is Rietveld 408576698