OSDN Git Service

Ligheten the _getAttr method
authordhrname <dhrname@users.sourceforge.jp>
Wed, 4 Nov 2015 13:56:04 +0000 (22:56 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Wed, 4 Nov 2015 13:56:04 +0000 (22:56 +0900)
org/w3c/dom/smil.js

index e2b78ac..00b62fb 100644 (file)
@@ -795,10 +795,13 @@ base("$calcMode").up("$attribute").mix( {
       nameSpace = "http://www.w3.org/1999/xlink";\r
     }\r
     var s = this._ele.getAttributeNS(nameSpace, name);\r
-    if (this.element && (s === "inherit")) {\r
-      return this.element.ownerDocument.defaultView.getComputedStyle(this.element.parentNode, "").getPropertyValue(this.attrName);\r
-    } else if (this.element && (s === "currentColor")) {\r
-      return this.element.ownerDocument.defaultView.getComputedStyle(this._ele, "").getPropertyValue("color");\r
+    if (this.element) {\r
+        var view = this.element.ownerDocument.defaultView;\r
+      if (s === "inherit") {\r
+        return view.getComputedStyle(this.element.parentNode, "").getPropertyValue(this.attrName);\r
+      } else if (s === "currentColor") {\r
+        return view.getComputedStyle(this._ele, "").getPropertyValue("color");\r
+      }\r
     }\r
     /*DOM Level2やIE11では、getAttributeNSメソッドは空文字を返す。他のブラウザではnullを返すことが多い\r
      * \r