svnno****@sourc*****
svnno****@sourc*****
2011年 5月 4日 (水) 20:34:34 JST
Revision: 2645 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2645 Author: dhrname Date: 2011-05-04 20:34:34 +0900 (Wed, 04 May 2011) Log Message: ----------- 0.76 betaのバグを修正 Modified Paths: -------------- branches/07x/sie.js Modified: branches/07x/sie.js =================================================================== --- branches/07x/sie.js 2011-05-04 11:32:41 UTC (rev 2644) +++ branches/07x/sie.js 2011-05-04 11:34:34 UTC (rev 2645) @@ -1726,7 +1726,7 @@ ti, paintType, v1, uri = null, color = null, - fill, stroke; + fill, stroke, stop; if (!!this[propertyName]) { tg = this.getPropertyCSSValue(propertyName); } @@ -1754,18 +1754,24 @@ uri = RegExp.$1; } else if (value === "currentColor") { paintType = /*SVGPaint.SVG_PAINTTYPE_CURRENTCOLOR*/ 102; - color = this.getPropertyValue("color"); + color = this.getPropertyValue("color") || "rgb(0,0,0)"; } ti.setPaint(paintType, uri, color, null); paintType = v1 = uri = color = null; } else if (this._isStop[propertyName]) { ti = new SVGColor(); - ti.colorType = /*SVGColor.SVG_COLORTYPE_RGBCOLOR*/ 1; + if (value === "currentColor") { + ti.colorType = /*SVGColor.SVG_COLORTYPE_CURRENTCOLOR*/ 3; + value = this.getPropertyValue("color") || "rgb(0,0,0)"; + } else { + ti.colorType = /*SVGColor.SVG_COLORTYPE_RGBCOLOR*/ 1; + } ti.setRGBColor(value); } else if (this._isColor[propertyName]) { ti = new CSSPrimitiveValue(); fill = this.getPropertyCSSValue("fill"); stroke = this.getPropertyCSSValue("stroke"); + stop = this.getPropertyCSSValue("stop-color"); if (fill) { if (fill.paintType === /*SVGPaint.SVG_PAINTTYPE_CURRENTCOLOR*/ 102) { fill.setPaint(fill.paintType, null, value, null); @@ -1774,6 +1780,10 @@ if (stroke.paintType === /*SVGPaint.SVG_PAINTTYPE_CURRENTCOLOR*/ 102) { stroke.setPaint(fill.paintType, null, value, null); } + } else if (stop) { + if (stop.colorType === /*SVGColor.SVG_COLORTYPE_CURRENTCOLOR*/ 3) { + stop.setRGBColor(value); + } } } else { ti = new CSSPrimitiveValue(); @@ -3928,6 +3938,7 @@ /*responseXMLを使うと、時々、空のデータを返すことがあるため(原因は不明)、 *ここでは、responseTextを用いる */ + var dsd = new Date(); var str = this.xmlhttp.responseText, objei = this._tar, s = DOMImplementation.createDocument("http://www.w3.org/2000/svg", "svg"), @@ -6599,9 +6610,13 @@ for (var i = 0; i < length; ++i) { stop = stops[i]; sstyle = stop.ownerDocument.defaultView.getComputedStyle(stop, ""); - ci = sstyle.getPropertyValue("stop-color"); - color[i] = SVGColor.prototype._keywords[ci] || ci; - colors[i] = stop.offset.baseVal + " " + ci; + ci = sstyle.getPropertyCSSValue("stop-color"); + if (ci && (ci.colorType === /*SVGColor.SVG_COLORTYPE_CURRENTCOLOR*/ 3)) { + /*再度、設定。css.jsのsetPropertyを参照*/ + sstyle.setProperty("color", sstyle.getPropertyValue("color")); + } + color[i] = "rgb(" +ci.rgbColor.red.cssText+ "," +ci.rgbColor.green.cssText+ "," +ci.rgbColor.blue.cssText+ ")"; + colors[i] = stop.offset.baseVal + " " + color[i]; opacity[i] = (sstyle.getPropertyValue("stop-opacity") || 1) * t.getPropertyValue("fill-opacity") * t.getPropertyValue("opacity"); } ele["method"] = "none";