From: dhrname Date: Sat, 3 Dec 2011 14:56:07 +0000 (+0900) Subject: Test Suiteのstruct-frag-05-tで、a要素の前に空白文字のテキストノードがあったため、Validという文字を表示できなかったバグを修正 X-Git-Tag: v16beta~754^2~4 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=ff5420001b5a18434f9d2c9999fea41ef25cde3b;p=sie%2Fsie.git Test Suiteのstruct-frag-05-tで、a要素の前に空白文字のテキストノードがあったため、Validという文字を表示できなかったバグを修正 --- diff --git a/org/w3c/dom/svg.js b/org/w3c/dom/svg.js index b2e04e3..6721e26 100644 --- a/org/w3c/dom/svg.js +++ b/org/w3c/dom/svg.js @@ -4255,8 +4255,8 @@ function SVGTextElement(_doc) { vis = style.getPropertyCSSValue("visibility"), disp = style.getPropertyCSSValue("display"), tts = tar._tar.style, - tft = tar.firstChild._tars, - ttt = tft[0].innerText.charAt(0), //あらかじめ初期化しておく + tft = tar.firstChild._tars, //空白のテキストノードの場合、tftがundefinedになる恐れがある + ttt = tft[0] ? tft[0].innerText.charAt(0) : [""], //あらかじめ初期化しておく tfti; if (color === "none"){ tts.color = "transparent"; @@ -4281,7 +4281,9 @@ function SVGTextElement(_doc) { tfti.parentNode.removeChild(tfti); } //以下でinnerTextやinnerHTMLを使うのは、IE6でエラーとなる可能性がある - tft[0].replaceChild(_doc.createTextNode(ttt), tft[0].firstChild); + if (tft[0] && tft[0].replaceChild) { + tft[0].replaceChild(_doc.createTextNode(ttt), tft[0].firstChild); + } ttt = void 0; } var isRect = true, @@ -4323,7 +4325,7 @@ function SVGTextElement(_doc) { ae[j]._tars[l].style.display = di; } l = void 0; - ++j; + ++j; } delete tar._cacheMatrix; ae = isRect = evt = tar = style = tedeco = tpp = ttpc = style = color = cursor = disp = vis = ttps = backr = backrs = di = tft = jt = void 0;