/*$fromオブジェクトを作るためのひな形となるオブジェクト*/\r
$from: base("$from").up(),\r
\r
+ /*attributeName属性の値*/\r
+ attrName: "",\r
+ \r
/*指定した要素の属性値を取得するメソッド*/\r
_getAttr: function(/*string*/ name, def) {\r
var nameSpace = null;\r
if (name.indexOf("xlink:") > -1) {\r
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
+ }\r
/*DOM Level2やIE11では、getAttributeNSメソッドは空文字を返す。他のブラウザではnullを返すことが多い\r
* \r
* >the empty string if that attribute does not have a specified or default value\r
* http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-ElGetAttrNS*/\r
- return (this._ele.getAttributeNS(nameSpace, name) || def);\r
+ return (s || def);\r
},\r
\r
_ele: document.documentElement,\r
}\r
/*_getAttrメソッドで必要*/\r
this._ele = ele;\r
+ this.attrName = this._getAttr("attributeName", "");\r
/*eleの属性の値を、それぞれオブジェクトに割り当て*/\r
var $frame = base("$frame"),\r
begin = $frame.$begin,\r
/*to属性の値、文字列*/\r
to: "",\r
\r
- /*attributeName属性の値*/\r
- attrName: "",\r
- \r
/*指定された属性の規定値*/\r
defaultValue: "",\r
\r
if (ele && ele.getAttributeNS) {\r
this._ele = ele;\r
this.to = this._getAttr("to", "");\r
- this.attrName = this._getAttr("attributeName", "");\r
this.fill = this._getAttr("fill", "remove");\r
}\r
var thisele = this.element;\r