svnno****@sourc*****
svnno****@sourc*****
2009年 12月 27日 (日) 22:13:42 JST
Revision: 1505 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=1505 Author: dhrname Date: 2009-12-27 22:13:42 +0900 (Sun, 27 Dec 2009) Log Message: ----------- chsetの最適化 Modified Paths: -------------- branches/05x/057/sie.js Modified: branches/05x/057/sie.js =================================================================== --- branches/05x/057/sie.js 2009-12-27 10:38:25 UTC (rev 1504) +++ branches/05x/057/sie.js 2009-12-27 13:13:42 UTC (rev 1505) @@ -252,6 +252,9 @@ isShape = { shape : 1 }, + isText = { + DIV : 1 + }, STElement = { "path" : STPath, "rect" : STRectElement, @@ -262,11 +265,11 @@ "line" : STLine }; SVGtoVML.prototype.chset = function _s_chset( /*element*/ ele, /*Matrix*/ matrix, /*float*/w, /*float*/h){ - var nods = ele.childNodes, s = null, _isGroup = isGroup, _isShape = isShape, _STElement = STElement; + var s = null, _isGroup = isGroup, _isShape = isShape, _STElement = STElement, _isText = isText; var name = "group|shape|defs|STOP|fill|stroke|DIV|SPAN|A|image|rect|USE|FONTFACEURI|set", gname = "DIV|group"; //要素名に合致させる文字列 var cmatrix = matrix; //子要素に継がせるCTM - var te = nods[0]; - if (te !== void 0) { + var te = ele.firstChild; + if (!!te) { do { try{ if (name.indexOf(te.nodeName) === -1) { //タグ名が一致しないのであれば @@ -276,9 +279,9 @@ te = ns; } else { if (te.nodeType === 1) { //要素ならば - if (isShape[te.nodeName]) { + if (_isShape[te.nodeName]) { s = new (_STElement[te.getAttribute("tag")])(te, matrix, w, h); - } else if (te.nodeName === "DIV") { + } else if (_isText[te.nodeName]) { s = new STText(te, matrix, w, h); } else if (_isGroup[te.nodeName]) { s = new STGroupElement(te, matrix, w, h);