svnno****@sourc*****
svnno****@sourc*****
2010年 12月 24日 (金) 20:18:19 JST
Revision: 2239 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2239 Author: dhrname Date: 2010-12-24 20:18:19 +0900 (Fri, 24 Dec 2010) Log Message: ----------- Firefoxでも外部のSVG Fontを表示できるように改良 Modified Paths: -------------- branches/06x/066/org/w3c/dom/svg.js Modified: branches/06x/066/org/w3c/dom/svg.js =================================================================== --- branches/06x/066/org/w3c/dom/svg.js 2010-12-23 13:06:42 UTC (rev 2238) +++ branches/06x/066/org/w3c/dom/svg.js 2010-12-24 11:18:19 UTC (rev 2239) @@ -5422,7 +5422,7 @@ xmlhttp.onreadystatechange = function() { if ((xmlhttp.readyState === 4) && (xmlhttp.status === 200)) { var doce = (new DOMParser()).parseFromString(xmlhttp.responseText, "text/xml"); - NAIBU._font({document:doce, docu:doc}); + NAIBU._font({document:doce, docu:doc, id:ids}); xmlhttp = doc = doce = null; } }; @@ -5435,12 +5435,12 @@ //getElementByIdは使えないので注意(DOMParserを使った場合、DTDでの指定が必要) var font = doc.getElementsByTagNameNS(svgns, "font").item(0); var familyName = font.getElementsByTagNameNS(svgns, "font-face").item(0).getAttributeNS(null, "font-family"); - if (familyName && font.getAttributeNS(null, "id") === data.obj[0].id) { + if (familyName && (font.getAttributeNS(null, "id") === data.id)) { var textElements = data.docu.getElementsByTagNameNS(svgns, "text"); for (var i=0,tli=textElements.length;i<tli;++i) { var ti = textElements[i], style = data.docu.defaultView.getComputedStyle(ti, ''); if (style.getPropertyValue("font-family", null).indexOf(familyName) > -1) { - NAIBU._noie_createFont(ti, font, true); + NAIBU._noie_createFont(ti, font, false); } } } @@ -5697,11 +5697,12 @@ } } else { var ob = document.getElementsByTagName("object"); - for (var i=0;i<ob;++i) { + for (var i=0;i<ob.length;++i) { if (ob[i].contentDocument) { - ob[i].contentDocument.documentElement.addEventListener("SVGLoad", NAIBU._fontSearchURI, false); + NAIBU._fontSearchURI({target:{ownerDocument:ob[i].contentDocument}}); } else if (ob[i].getSVGDocument) { ob[i].getSVGDocument().documentElement.addEventListener("SVGLoad", NAIBU._fontSearchURI, false); + } else { } } }