svnno****@sourc*****
svnno****@sourc*****
2011年 6月 22日 (水) 20:18:29 JST
Revision: 2787 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2787 Author: dhrname Date: 2011-06-22 20:18:29 +0900 (Wed, 22 Jun 2011) Log Message: ----------- 0.80モジュールを結合 Modified Paths: -------------- branches/08x/sie.js Modified: branches/08x/sie.js =================================================================== --- branches/08x/sie.js 2011-06-22 10:56:51 UTC (rev 2786) +++ branches/08x/sie.js 2011-06-22 11:18:29 UTC (rev 2787) @@ -1,4 +1,4 @@ -/*SIE-SVG without Plugin under LGPL2.1 & GPL2.0 & Mozilla Public Lisence +/*SIE-SVG without Plugin under LGPL2.1 & GPL2.0 & Mozilla Public Lisence *公式ページは http://sie.sourceforge.jp/ *利用方法は <script defer="defer" type="text/javascript" src="sie.js"></script> *http://sie.sourceforge.jp/ @@ -867,7 +867,7 @@ } } if (isSpecified) { - ele = new (ti[namespaceURI][localName]); + ele = new (ti[namespaceURI][localName])(this._document_); } else { ele = new Element(); } @@ -879,6 +879,7 @@ ti = namespaceURI = qualifiedName = prefix = localName = isSpecified = null; return ele; }; +Document.prototype._document_ = document /*createAttributeNSメソッド *属性ノードを作る。setAttributeNSで使うため、削除不可 */ @@ -2449,10 +2450,12 @@ degli, s, cm, - degz; + degz, + etod = evt.target.ownerDocument.documentElement, + ttb = tar.transform.baseVal; //transform属性の値を、SVGTransformListであるtransformプロパティに結びつける for (var j=0,cli=coma.length;j<cli;j++) { - s = evt.target.ownerDocument.documentElement.createSVGTransform(); + s = etod.createSVGTransform(); lis = list[j], com = coma[j]; deg = lis.match(degR); @@ -2484,9 +2487,9 @@ } } } - tar.transform.baseVal.appendItem(s); + ttb.appendItem(s); } - tft = degR = coma = list = a = b = c = d = e = f = lis = com = deg = rad = degli = s = cm = degz = null; + tft = degR = coma = list = a = b = c = d = e = f = lis = com = deg = rad = degli = s = cm = degz = etod = ttb = null; } else if (name === "style") { var sc = evt.newValue, style = tar.style, @@ -3411,9 +3414,10 @@ /*SVGSVGElement *svg要素をあらわすオブジェクト */ -function SVGSVGElement() { +function SVGSVGElement(_doc) { SVGElement.apply(this, arguments); - this._tar = document.createElement("v:group"); + this._tar = _doc.createElement("v:group"); + _doc = null; /*_svgload_limitedはSVGLoadイベントを発火させる判定基準。 * Xlink言語が使われていない限り0であり、SVGLoadイベントが発火される*/ this._svgload_limited = 0; @@ -3710,9 +3714,10 @@ SVGViewSpec.constructor = SVGFitToViewBox; SVGViewSpec.prototype = new SVGFitToViewBox(); -function SVGGElement() { +function SVGGElement(_doc) { SVGElement.apply(this); - this._tar = document.createElement("v:group"); + this._tar = _doc.createElement("v:group"); + _doc = null; /*以下の処理は、この子要素ノードがDOMツリーに追加されて初めて、 *描画が開始されることを示す。つまり、appendChildで挿入されない限り、描画をしない。 */ @@ -3865,9 +3870,10 @@ /*SVGElementInstance*/ SVGElementInstanceList.prototype.item = function(/*unsigned long*/ index ) { return (this[index]); } -function SVGImageElement() { +function SVGImageElement(_doc) { SVGElement.apply(this, arguments); - this._tar = document.createElement("v:image"); + this._tar = _doc.createElement("v:image"); + _doc = null; //以下は、与えられた属性の値に対応する /*readonly SVGAnimatedLength*/ this.x = new SVGAnimatedLength(); /*readonly SVGAnimatedLength*/ this.y = new SVGAnimatedLength(); @@ -3974,15 +3980,16 @@ *ここでは、responseTextを用いる */ var str = this.xmlhttp.responseText, + _doc = document, objei = this._tar, s = DOMImplementation.createDocument("http://www.w3.org/2000/svg", "svg"), tar = s.documentElement, tview = tar.viewport, objw, objh, fi, n, attr, att, sdt = tar._tar, - sp = document.createElement("div"), - dcp = document.createElement("v:group"), - backr = document.createElement("v:rect"), + sp = _doc.createElement("div"), + dcp = _doc.createElement("v:group"), + backr = _doc.createElement("v:rect"), style, fontSize, w, h, sw, sh, trstyle, tpstyle, backrs, viewWidth, viewHeight, bfl, bft, bl, backright, backdown, text, _parseFloat = parseFloat, @@ -4128,7 +4135,7 @@ } } s.defaultView._cache = s.defaultView._cache_ele = null; - evt = objei = tar = tview = objw = objh = n = att = sdt = sp = dcp = backr = w = h = sw = sh = style = fontSize = null; + evt = _doc = objei = tar = tview = objw = objh = n = att = sdt = sp = dcp = backr = w = h = sw = sh = style = fontSize = null; trstyle = tpstyle = backrs = viewWidth = viewHeight = text = texti = i = bfl = bft = bl = bt = backdown = backright = null; text = _parseFloat = null; /*IEのメモリリーク対策として、空関数を入力*/ @@ -4186,7 +4193,7 @@ /*SVGStyleElement *style要素をあらわすオブジェクト */ -function SVGStyleElement() { +function SVGStyleElement(_doc) { SVGElement.apply(this); LinkStyle.apply(this); /*LinkStyleに関しては、以下の仕様を参照のこと。なお、これはSVG DOMでは継承されていないので要注意。 @@ -4214,13 +4221,13 @@ sheet = tar.sheet, styleText = tar._text, tod = tar.ownerDocument, - style = document.createElement("style"), + style = _doc.createElement("style"), ri, rsc, scri, rsi; NAIBU._temp_doc = tod; sheet = tod.styleSheets[tod.styleSheets.length] = DOMImplementation.createCSSStyleSheet(tar.title, tar.media); sheet.ownerNode = tar; /*以下は、IEのCSSパーサを使って、スタイルシートのルールを実装していく*/ - document.documentElement.firstChild.appendChild(style); + _doc.documentElement.firstChild.appendChild(style); style.styleSheet.cssText = styleText; for (var i=0, rules=style.styleSheet.rules, rli=rules.length;i<rli;++i) { ri = rules[i]; @@ -4764,6 +4771,7 @@ *処理を行う。SVGPaintインターフェースをも用いる */ var tod = tar.ownerDocument, + _doc = tod._document_, el = tar._tar, style = tod.defaultView.getComputedStyle(tar, ""), fill = style.getPropertyCSSValue("fill"), @@ -4884,10 +4892,10 @@ } else if (disp && !disp._isDefault && (disp.indexOf("inline-block") === -1)) { el.style.display = "inline-block"; } - tod = el = fill = stroke = sp = fp = style = cursor = tar = matrix = vis = disp = num = null; + tod = _doc = el = fill = stroke = sp = fp = style = cursor = tar = matrix = vis = disp = num = null; }; -function SVGPathElement() { +function SVGPathElement(_doc) { SVGElement.apply(this); this._tar = _doc.createElement("v:shape"); //interface SVGAnimatedPathData @@ -5271,7 +5279,8 @@ tt.path = dat.join(" "); tt.coordsize = vi.width.baseVal.value + " " + vi.height.baseVal.value; NAIBU._setPaint(tar, matrix); - delete tar._cacheMatrix, tar._currentStyle; + delete tar._cacheMatrix; + delete tar._currentStyle; evt = tar = dat = t = tx = ty = matrix = tlist = x = y = _parseInt = ma = mb = mc = md = me = mf = vi = isZ = isC = i = tli = tps = ti = cname = tt = null; }; SVGPathElement.prototype._com = { @@ -5554,9 +5563,10 @@ NAIBU.SVGPathElement = SVGPathElement; //IE8では、SVGPathElementはローカル変数 })(document, parseInt, Math); -function SVGRectElement() { +function SVGRectElement(_doc) { SVGElement.apply(this); - this._tar = document.createElement("v:shape"); + this._tar = _doc.createElement("v:shape"); + _doc = null; /*readonly SVGAnimatedLength*/ this.x = new SVGAnimatedLength(); /*readonly SVGAnimatedLength*/ this.y = new SVGAnimatedLength(); /*readonly SVGAnimatedLength*/ this.width = new SVGAnimatedLength(); @@ -5644,7 +5654,8 @@ ele.path = dat; ele.coordsize = w + " " + h; NAIBU._setPaint(tar, ctm); - delete tar._cacheMatrix, tar._currentStyle; + delete tar._cacheMatrix; + delete tar._currentStyle; evt = tar = style = list = dat = ele = vi = fontSize = null; }, false); evt = tar = null; @@ -5654,9 +5665,9 @@ SVGRectElement.constructor = SVGElement; SVGRectElement.prototype = new SVGElement(); -function SVGCircleElement() { +function SVGCircleElement(_doc) { SVGElement.apply(this); - this._tar = document.createElement("v:shape"); + this._tar = _doc.createElement("v:shape"); /*readonly SVGAnimatedLength*/ this.cx = new SVGAnimatedLength(); /*readonly SVGAnimatedLength*/ this.cy = new SVGAnimatedLength(); /*readonly SVGAnimatedLength*/ this.r = new SVGAnimatedLength(); @@ -5720,7 +5731,8 @@ ele.path = dat; ele.coordsize = w + " " + h; NAIBU._setPaint(tar, ctm); - delete tar._cacheMatrix, tar._currentStyle; + delete tar._cacheMatrix; + delete tar._currentStyle; evt = tar = list = style = fontSize = dat = ele = null; }, false); evt = tar = null; @@ -5730,9 +5742,10 @@ SVGCircleElement.constructor = SVGElement; SVGCircleElement.prototype = new SVGElement(); -function SVGEllipseElement() { +function SVGEllipseElement(_doc) { SVGElement.apply(this); - this._tar = document.createElement("v:shape"); + this._tar = _doc.createElement("v:shape"); + _doc = null; /*readonly SVGAnimatedLength*/ this.cx = new SVGAnimatedLength(); /*readonly SVGAnimatedLength*/ this.cy = new SVGAnimatedLength(); /*readonly SVGAnimatedLength*/ this.rx = new SVGAnimatedLength(); @@ -5798,7 +5811,8 @@ ele.path = dat; ele.coordsize = w + " " + h; NAIBU._setPaint(tar, ctm); - delete tar._cacheMatrix, tar._currentStyle; + delete tar._cacheMatrix; + delete tar._currentStyle; evt = ele = tar = style = fontSize = dat = list = ctm = w = h = null; }, false); evt = tar = null; @@ -5808,9 +5822,10 @@ SVGEllipseElement.constructor = SVGElement; SVGEllipseElement.prototype = new SVGElement(); -function SVGLineElement() { +function SVGLineElement(_doc) { SVGElement.apply(this); - this._tar = document.createElement("v:shape"); + this._tar = _doc.createElement("v:shape"); + _doc = null; /*readonly SVGAnimatedLength*/ this.x1 = new SVGAnimatedLength(); /*readonly SVGAnimatedLength*/ this.y1 = new SVGAnimatedLength(); /*readonly SVGAnimatedLength*/ this.x2 = new SVGAnimatedLength(); @@ -5866,7 +5881,8 @@ ele.path = dat; ele.coordsize = w + " " + h; NAIBU._setPaint(tar, ctm); - delete tar._cacheMatrix, tar._currentStyle; + delete tar._cacheMatrix; + delete tar._currentStyle; evt = ele = tar = style = fontSize = dat = list = ctm = vi = w = h = null; }, false); evt = tar = null; @@ -5876,9 +5892,10 @@ SVGLineElement.constructor = SVGElement; SVGLineElement.prototype = new SVGElement(); -function SVGPolylineElement() { +function SVGPolylineElement(_doc) { SVGElement.apply(this); - this._tar = document.createElement("v:shape"); + this._tar = _doc.createElement("v:shape"); + _doc = null; //interface SVGAnimatedPoints /*readonly SVGPointList*/ this.animatedPoints = this.points = new SVGPointList(); this.addEventListener("DOMAttrModified", function(evt){ @@ -5944,7 +5961,8 @@ ele.path = dat; ele.coordsize = w + " " + h; NAIBU._setPaint(tar, ctm); - delete tar._cacheMatrix, tar._currentStyle; + delete tar._cacheMatrix; + delete tar._currentStyle; evt = ele = tar = dat = list = ctm = w = h = null; }, false); evt = tar = null; @@ -5954,9 +5972,10 @@ SVGPolylineElement.constructor = SVGElement; SVGPolylineElement.prototype = new SVGElement(); -function SVGPolygonElement() { +function SVGPolygonElement(_doc) { SVGElement.apply(this); - this._tar = document.createElement("v:shape"); + this._tar = _doc.createElement("v:shape"); + _doc = null; //interface SVGAnimatedPoints /*readonly SVGPointList*/ this.animatedPoints = this.points = new SVGPointList(); this.addEventListener("DOMAttrModified", function(evt){ @@ -6026,7 +6045,8 @@ ele.path = dat; ele.coordsize = w + " " + h; NAIBU._setPaint(tar, ctm); - delete tar._cacheMatrix, tar._currentStyle; + delete tar._cacheMatrix; + delete tar._currentStyle; evt = ele = tar = dat = list = ctm = w = h = null; }, false); evt = tar = null; @@ -6036,7 +6056,7 @@ SVGPolygonElement.constructor = SVGElement; SVGPolygonElement.prototype = new SVGElement(); -function SVGTextContentElement() { +function SVGTextContentElement(_doc) { SVGElement.apply(this); this._list = null; //文字の位置を格納しておくリストのキャッシュ this._length = 0; //全文字数 @@ -6061,13 +6081,13 @@ tar.data = data; data = data.split(''); for (var i=0, tdli=data.length;i<tdli;++i) { - var d = document.createElement("div"), dstyle = d.style; + var d = _doc.createElement("div"), dstyle = d.style; dstyle.position = "absolute"; dstyle.marginLeft = dstyle.marginRight = dstyle.marginTop = "0px"; dstyle.paddingTop = dstyle.paddingLeft = "0px"; dstyle.whiteSpace = "nowrap"; dstyle.textIndent = "0px"; - d.appendChild(document.createTextNode(data[i])); + d.appendChild(_doc.createTextNode(data[i])); tar._tars[tar._tars.length] = d; } data = null; @@ -6297,8 +6317,8 @@ }; -function SVGTextPositioningElement() { - SVGTextContentElement.apply(this); +function SVGTextPositioningElement(_doc) { + SVGTextContentElement.apply(this, arguments); /*readonly SVGAnimatedLengthList*/ this.x = new SVGAnimatedLengthList(); /*readonly SVGAnimatedLengthList*/ this.y = new SVGAnimatedLengthList(); /*readonly SVGAnimatedLengthList*/ this.dx = new SVGAnimatedLengthList(); @@ -6368,9 +6388,9 @@ SVGTextPositioningElement.constructor = SVGTextContentElement; SVGTextPositioningElement.prototype = new SVGTextContentElement(); -function SVGTextElement() { - SVGTextPositioningElement.apply(this); - this._tar = document.createElement("v:group"); +function SVGTextElement(_doc) { + SVGTextPositioningElement.apply(this, arguments); + this._tar = _doc.createElement("v:group"); this.addEventListener("DOMNodeInserted", function(evt){ if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { return; //強制終了させる @@ -6481,7 +6501,7 @@ isRect = false; } if (!isRect) { - var backr = document.createElement("v:rect"); + var backr = _doc.createElement("v:rect"); var backrs = backr.style; //ずれを修正するためのもの backrs.width = "1px"; backrs.height = "1px"; @@ -6491,7 +6511,8 @@ backr.filled = "false"; ttp.appendChild(backr); } - delete tar._cacheMatrix, tar._currentStyle; + delete tar._cacheMatrix; + delete tar._currentStyle; isRect = evt = tar = style = tpp = ttpc = null; }, false); evt = tar = null; @@ -6764,7 +6785,7 @@ SVGLinearGradientElement.constructor = SVGGradientElement; SVGLinearGradientElement.prototype = new SVGGradientElement(); -function SVGRadialGradientElement() { +function SVGRadialGradientElement(_doc) { SVGGradientElement.apply(this); /*readonly SVGAnimatedLength*/ this.cx = new SVGAnimatedLength(); /*readonly SVGAnimatedLength*/ this.cy = new SVGAnimatedLength(); @@ -6830,8 +6851,8 @@ p = pmt = null; } var ellipse = list.join(" "); - var outline = document.getElementById("_NAIBU_outline"); - var background = document.createElement("div"), bstyle = background.style; + var outline = _doc.getElementById("_NAIBU_outline"); + var background = _doc.createElement("div"), bstyle = background.style; bstyle.position = "absolute"; bstyle.display = "inline-block"; var w = vi.width, h = vi.height; @@ -6983,9 +7004,10 @@ SVGCursorElement.constructor = SVGElement; SVGCursorElement.prototype = new SVGElement(); -function SVGAElement() { +function SVGAElement(_doc) { SVGElement.apply(this); - this._tar = document.createElement("a"); + this._tar = _doc.createElement("a"); + _doc = null; /*readonly SVGAnimatedString*/ this.target = new SVGAnimatedString(); this.addEventListener("DOMAttrModified", function(evt){ var tar = evt.target; @@ -7709,46 +7731,108 @@ d = null; } }, false); + this.addEventListener("DOMNodeInserted", function(evt){ + if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { + return; //強制終了させる + } + var tar = evt.target; + tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt){ + var vlist = [], + ti; + if (tar._values) { + for (var i=0, tav=tar._values, tvli=tav.length;i<tvli;++i) { + ti = tav[i]; + ti = ti.split(","); + vlist[i] = [+ti[0], +ti[1]]; + } + tar._valueList = vlist; + } + }, false); + }, false); this.addEventListener("beginEvent", function(evt) { - var tar = evt.target, trans = tar.targetElement.transform; + var tar = evt.target, + trans = tar.targetElement.transform; /*アニメーション中に変化すべき値をanimValプロパティに入力して、 *baseValと同じような値に設定。 */ trans.animVal = new SVGTransformList(); if (trans.baseVal.numberOfItems !== 0) { + trans.baseVal.consolidate(); trans.animVal.initialize(trans.baseVal.createSVGTransformFromMatrix(trans.baseVal.getItem(0).matrix)); - } - trans.animVal.appendItem(tar.ownerDocument.documentElement.createSVGTransform()); + } else { + trans.animVal.appendItem(tar.ownerDocument.documentElement.createSVGTransform()); + } tar._frame = function() { - var _tar = tar, tpn = _tar._path; - if (!!tpn) { //path属性が指定されていた場合、tpnは属性値となる - var tgsd = _tar.getSimpleDuration(); - if (tgsd === 0) { - tgsd = null; + var _tar = tar, + tpn = _tar._path, + tgsd = _tar.getSimpleDuration(), + d = tgsd * 0.8, + tg = _tar.getCurrentTime(), + ii; + if (tgsd === 0) { + tgsd = null; + return; + } + if (tpn) { //path属性が指定されていた場合、tpnは属性値となる + var st = tpn.getTotalLength() * tg / d, //stは現在に至るまでの距離 + p = tpn.getPointAtLength(st), + trans = _tar.targetElement.transform; + trans.animVal.getItem(trans.animVal.numberOfItems-1).setTranslate(p.x, p.y); + var base = trans.baseVal; + trans.baseVal = trans.animVal; + _tar.targetElement._cacheMatrix = null; + var evtt = _tar.ownerDocument.createEvent("MutationEvents"); + evtt.initMutationEvent("DOMNodeInsertedIntoDocument", false, false, null, null, null, null, null); + _tar.targetElement.dispatchEvent(evtt); + trans.baseVal = base; + evtt = base = trans = st = p = null; + } else if (tar._valueList) { + var total = 0, //totalは総距離 + st = 0, //stは現在にいたるまでの距離 + tav = tar._valueList, + n = tav.length - 1; + if ((n !== -1) && (d !== 0) && (tg <= d)) { + ii = Math.floor((tg*n) / d); + if (ii === n) { //iiが境い目のときは、n-2を適用 + ii -= 1; + } + } else { return; } - var st = (tpn.getTotalLength() / tgsd) * _tar.getCurrentTime() / 125 * 0.8; - var p = tpn.getPointAtLength(st), trans = _tar.targetElement.transform; - p = p.matrixTransform(_tar.targetElement.getScreenCTM()); + for (var i=1, tvli=tav.length;i<tvli;i+=2) { + total += Math.sqrt(Math.pow(tav[i][1] - tav[i-1][1], 2) + Math.pow(tav[i][0] - tav[i-1][0], 2)); + } + for (var i=1;i<ii;i+=2) { + st += Math.sqrt(Math.pow(tav[i][1] - tav[i-1][1], 2) + Math.pow(tav[i][0] - tav[i-1][0], 2)); + } + var p = tar.ownerDocument.documentElement.createSVGPoint(), + trans = _tar.targetElement.transform; + st = (st / total) * d; + p.x = tav[ii][0] + (tav[ii+1][0] - tav[ii][0]) * (tg - st) / d; + p.y = tav[ii][1] + (tav[ii+1][1] - tav[ii][1]) * (tg - st) / d; trans.animVal.getItem(trans.animVal.numberOfItems-1).setTranslate(p.x, p.y); var base = trans.baseVal; trans.baseVal = trans.animVal; + _tar.targetElement._cacheMatrix = null; var evtt = _tar.ownerDocument.createEvent("MutationEvents"); evtt.initMutationEvent("DOMNodeInsertedIntoDocument", false, false, null, null, null, null, null); _tar.targetElement.dispatchEvent(evtt); trans.baseVal = base; - evtt = base = trans = st = tgsd = p = null; - } else { + evtt = base = trans = st = p = null; } } - evt = trans = null; + evt = trans = tpn = tgsd = null; }, false); this.addEventListener("endEvent", function(evt) { - var tar = evt.target, trans = tar.targetElement.transform; - trans.animVal = trans.baseVal; - var evtt = tar.ownerDocument.createEvent("MutationEvents"); - evtt.initMutationEvent("DOMNodeInsertedIntoDocument", false, false, null, null, null, null, null); - tar.targetElement.dispatchEvent(evtt); + var tar = evt.target, + trans = tar.targetElement.transform, + fill = tar.getAttributeNS(null, "fill"); + if (!fill || (fill === "remove")) { + trans.animVal = trans.baseVal; + var evtt = tar.ownerDocument.createEvent("MutationEvents"); + evtt.initMutationEvent("DOMNodeInsertedIntoDocument", false, false, null, null, null, null, null); + tar.targetElement.dispatchEvent(evtt); + } tar._frame = evt = evtt = null; }, false); this.addEventListener("repeatEvent", function(evt) { @@ -7817,9 +7901,10 @@ */ var d = _tar.getSimpleDuration() * 0.8, n = _tar._valueList.length - 1, - tg = _tar.getCurrentTime(); + tg = _tar.getCurrentTime(), + ii, di, ti; if ((n !== -1) && (d !== 0) && (tg <= d)) { - var ii = Math.floor((tg*n) / d); + ii = Math.floor((tg*n) / d); if (ii === n) { //iiが境い目のときは、n-2を適用 ii -= 1; } @@ -7827,17 +7912,22 @@ return; } if (tar._keyTimes) { - var di = (tar._keyTimes[ii+1] - tar._keyTimes[ii]) * d; - var ti = tar._keyTimes[ii]; + di = (tar._keyTimes[ii+1] - tar._keyTimes[ii]) * d; + ti = tar._keyTimes[ii]; } else { - var di = d / n; //keyTimesがなければ均等に時間を配分しておく - var ti = ii / n; + di = d / n; //keyTimesがなければ均等に時間を配分しておく + ti = ii / n; } - var fc = _tar._valueList[ii].rgbColor, tc = _tar._valueList[ii+1].rgbColor, durd = (tg-ti*d) / di, num = CSSPrimitiveValue.CSS_NUMBER; - var fr = fc.red.getFloatValue(num), fg = fc.green.getFloatValue(num), fb = fc.blue.getFloatValue(num); - var r = fr + (tc.red.getFloatValue(num) - fr) * durd; - var g = fg + (tc.green.getFloatValue(num) - fg) * durd; - var b = fb + (tc.blue.getFloatValue(num) - fb) * durd; + var fc = _tar._valueList[ii].rgbColor, + tc = _tar._valueList[ii+1].rgbColor, + durd = (tg-ti*d) / di, + num = CSSPrimitiveValue.CSS_NUMBER, + fr = fc.red.getFloatValue(num), + fg = fc.green.getFloatValue(num), + fb = fc.blue.getFloatValue(num), + r = fr + (tc.red.getFloatValue(num) - fr) * durd, + g = fg + (tc.green.getFloatValue(num) - fg) * durd, + b = fb + (tc.blue.getFloatValue(num) - fb) * durd; style.setProperty(attrName, "rgb(" +Math.ceil(r)+ "," +Math.ceil(g)+ "," +Math.ceil(b)+ ")", null); _tar = d = n = tg = fc = tc = fr = fg = fb = num = r = g = b = null; } @@ -8170,7 +8260,7 @@ if (isMSIE) { var rand = "n" +Math.random(); ti._tar.firstChild.setAttribute("id", rand); - var titf = document.getElementById(rand); + var titf = ti.ownerDocument._document_.getElementById(rand); /*IEのみ、font-sizeは自動で調整されている(つまり、DOMからよびだされた)ものを使った方がよい*/ fontSize = parseFloat(titf.currentStyle.fontSize); fe = fontSize / em;