svnno****@sourc*****
svnno****@sourc*****
2011年 8月 28日 (日) 22:31:58 JST
Revision: 2899 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2899 Author: dhrname Date: 2011-08-28 22:31:58 +0900 (Sun, 28 Aug 2011) Log Message: ----------- _ca関数にローカル関数_searchを導入して、軽量化 Modified Paths: -------------- branches/08x/084/org/w3c/dom/svg.js Modified: branches/08x/084/org/w3c/dom/svg.js =================================================================== --- branches/08x/084/org/w3c/dom/svg.js 2011-08-28 13:16:40 UTC (rev 2898) +++ branches/08x/084/org/w3c/dom/svg.js 2011-08-28 13:31:58 UTC (rev 2899) @@ -6258,38 +6258,29 @@ em = _doc.getElementsByTagName("embed"), i = 0, s=[], - ifr, obi, n; - for (;ob[i];++i) { - obi = ob[i]; - s[s.length] = new GetSVGDocument(obi); - ifr = _doc.createElement("iframe"); - ifr.style.background = "black"; - n = obi.getAttribute("width"); - n && ifr.setAttribute("width", n); - n = obi.getAttribute("height"); - n && ifr.setAttribute("height", n); - ifr.marginWidth = ifr.marginHeight = "0px"; //このマージン設定がないと、全体がずれてしまう - ifr.scrolling = "no"; - ifr.frameBorder = "0"; - /*iframe要素を使って、描画のプロセスを分離する - *したがって、_docはdocumentとは別のオブジェクトとなる - */ - obi.parentNode.insertBefore(ifr, obi); - } - for (i=0;em[i];++i) { - obi = em[i]; - s[s.length] = new GetSVGDocument(obi); - ifr = _doc.createElement("iframe"); - ifr.style.background = "black"; - n = obi.getAttribute("width"); - n && ifr.setAttribute("width", n); - n = obi.getAttribute("height"); - n && ifr.setAttribute("height", n); - ifr.marginWidth = ifr.marginHeight = "0px"; //このマージン設定がないと、全体がずれてしまう - ifr.scrolling = "no"; - ifr.frameBorder = "0"; - obi.parentNode.insertBefore(ifr, obi); - } + ifr, obi, n, + _search = function(_ob) { + for (;_ob[i];++i) { + obi = _ob[i]; + s[s.length] = new GetSVGDocument(obi); + ifr = _doc.createElement("iframe"); + ifr.style.background = "black"; + n = obi.getAttribute("width"); + n && ifr.setAttribute("width", n); + n = obi.getAttribute("height"); + n && ifr.setAttribute("height", n); + ifr.marginWidth = ifr.marginHeight = "0px"; //このマージン設定がないと、全体がずれてしまう + ifr.scrolling = "no"; + ifr.frameBorder = "0"; + /*iframe要素を使って、描画のプロセスを分離する + *したがって、_docはdocumentとは別のオブジェクトとなる + */ + obi.parentNode.insertBefore(ifr, obi); + } + _ob = null; + }; + _search(ob); + _search(em); ob = em = i = obi = ifr = null; for (i=0;i<s.length;++i) { if (i < s.length-1) {