svnno****@sourc*****
svnno****@sourc*****
2011年 3月 23日 (水) 23:30:35 JST
Revision: 2502 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2502 Author: dhrname Date: 2011-03-23 23:30:35 +0900 (Wed, 23 Mar 2011) Log Message: ----------- createAtrributeNSメソッドについて整理と、Attrのnodevalueプロパティを修正 Modified Paths: -------------- branches/07x/073/org/w3c/core.js Modified: branches/07x/073/org/w3c/core.js =================================================================== --- branches/07x/073/org/w3c/core.js 2011-03-23 14:21:16 UTC (rev 2501) +++ branches/07x/073/org/w3c/core.js 2011-03-23 14:30:35 UTC (rev 2502) @@ -530,6 +530,7 @@ Attr.prototype = new Node(); //ノードのプロトタイプチェーンを作って、継承 Attr.constructor = Node; Attr.prototype.nodeType = Node.ATTRIBUTE_NODE; +Attr.prototype.nodeValue = null; /*Element *要素ノード。削除不可。 @@ -797,7 +798,7 @@ /*Text*/ Document.prototype.createTextNode = function( /*string*/ data) { var s = new Text(); s.data = s.nodeValue = data+""; - s.length = (data+"").length; + s.length = s.data.length; s.ownerDocument = this; return s; }; @@ -929,7 +930,9 @@ *例:var s = DOC.createElementNS("http://www.w3.org/2000/svg", "svg:svg"); */ /*Element*/ Document.prototype.createElementNS = function( /*string*/ namespaceURI, /*string*/ qualifiedName) { - var ele, prefix = null, localName = null; + var ele, + prefix = null, + localName = null; if (!qualifiedName) { throw (new DOMException(DOMException.INVALID_CHARACTER_ERR)); } @@ -966,12 +969,12 @@ *属性ノードを作る。setAttributeNSで使うため、削除不可 */ /*Attr*/ Document.prototype.createAttributeNS = function( /*string*/ namespaceURI, /*string*/ qualifiedName) { - var attr = new Attr(); + var attr = new Attr(), + p; attr.namespaceURI = namespaceURI; attr.nodeName = attr.name = qualifiedName; - attr.nodeValue = null; if (qualifiedName.indexOf(":") !== -1){ - var p = qualifiedName.split(":"); + p = qualifiedName.split(":"); attr.prefix = p[0]; attr.localName = p[1]; } else { @@ -979,6 +982,7 @@ attr.localName = qualifiedName; } attr.ownerDocument = this; + p = qualifiedName = null; return attr; }; /*getElementsByTagNameNSメソッド