From 482eef51e9e76b11f51ce22447061cc8140f0cb1 Mon Sep 17 00:00:00 2001 From: dhrname Date: Wed, 7 Aug 2013 23:07:00 +0900 Subject: [PATCH] =?utf8?q?setProperty=E3=83=A1=E3=82=BD=E3=83=83=E3=83=89?= =?utf8?q?=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=E3=80=81=E4=B8=89=E9=A0=85?= =?utf8?q?=E6=BC=94=E7=AE=97=E5=AD=90=E3=81=AB=E7=BD=AE=E3=81=8D=E6=8F=9B?= =?utf8?q?=E3=81=88=E3=81=9F=E8=BB=BD=E9=87=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- org/w3c/dom/css.js | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/org/w3c/dom/css.js b/org/w3c/dom/css.js index ce7679b..0f0ea71 100644 --- a/org/w3c/dom/css.js +++ b/org/w3c/dom/css.js @@ -256,7 +256,7 @@ CSSStyleDeclaration.prototype = { uri = null, color = null, fill, stroke, stop; - if (!!this[propertyName]) { + if (this[propertyName]) { tg = this.getPropertyCSSValue(propertyName); } cssText += ":"; @@ -265,11 +265,7 @@ CSSStyleDeclaration.prototype = { /*fill、strokeプロパティは別途、SVGPaintで処理(JavaScriptでは、型キャストを使えないため) *CSSPrimitiveValueオブジェクトとSVGPaintオブジェクトを最後に置き換える */ - if (tg) { //見つかった場合 - ti = tg; - } else { - ti = new SVGPaint(); - } + ti = tg ? tg : new SVGPaint(); paintType = /*SVGPaint.SVG_PAINTTYPE_UNKNOWN*/ 0; v1 = value.charAt(0); if (this._isRS[v1] || ti._keywords[value]) { @@ -286,11 +282,7 @@ CSSStyleDeclaration.prototype = { ti.setPaint(paintType, uri, color, null); paintType = v1 = uri = color = void 0; } else if (this._isStop[propertyName]) { - if (tg) { //見つかった場合 - ti = tg; - } else { - ti = new SVGColor(); - } + ti = tg ? tg : new SVGColor(); if (value === "currentColor") { ti.colorType = /*SVGColor.SVG_COLORTYPE_CURRENTCOLOR*/ 3; } else { @@ -298,11 +290,7 @@ CSSStyleDeclaration.prototype = { ti.setRGBColor(value); } } else { - if (tg) { //見つかった場合 - ti = tg; - } else { - ti = new CSSPrimitiveValue(); - } + ti = tg ? tg : new CSSPrimitiveValue(); } ti._priority = priority; ti.cssText = cssText; @@ -326,7 +314,7 @@ CSSStyleDeclaration.prototype = { this._list._fontSize = parseFloat(value); } } - cssText = void 0; + cssText = ti = tg = void 0; }, /*itemメソッド *リストの位置にあるプロパティ名を取得する。宣言内のすべてのプロパティ名を取得するのに便利 -- 2.11.0