svnno****@sourc*****
svnno****@sourc*****
2010年 3月 24日 (水) 23:10:26 JST
Revision: 1750
http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=1750
Author: dhrname
Date: 2010-03-24 23:10:26 +0900 (Wed, 24 Mar 2010)
Log Message:
-----------
Modified Paths:
--------------
branches/ufltima/dom/css.js
Modified: branches/ufltima/dom/css.js
===================================================================
--- branches/ufltima/dom/css.js 2010-03-22 14:26:16 UTC (rev 1749)
+++ branches/ufltima/dom/css.js 2010-03-24 14:10:26 UTC (rev 1750)
@@ -185,6 +185,7 @@
*/
function CSSStyleDeclaration() {
this.cssText = "";
+ this.cssText._rewrite = 1;
/*long*/ this.length = 0;
/*CSSRule*/ this.parentRule = null;
this._list = []; //内部のリスト
@@ -197,8 +198,8 @@
/*string*/ getPropertyValue : function( /*string*/ propertyName) {
var tg = this.getPropertyCSSValue(propertyName);
if (tg) { //見つかった場合
- var pn = new RegExp(propertyName+":\s*");
- return (tg.cssText.replace(pn, ""));
+ var tc = tg.cssText;
+ return (tc.substring(tc.indexOf(":")+1, tc.length));
} else {
return "";
}
@@ -210,16 +211,17 @@
propertyName += ":";
for (var i=0,tli=this._list.length;i<tli;++i) {
var ti = this._list[i], tc = ti.cssText;
- if (tc.indexOf(propertyName) > -1) { //プロパティ名に合致するCSSValueオブジェクトが見つかった場合
- if (propertyName === "fill" || propertyName === "stroke") { //fill、strokeプロパティは別途、SVGPaintで処理
+ if (tc.indexOf(propertyName) > -1) { //プロパティ名に合致するCSSValueオブジェクトが見つかった場合
+ if (propertyName === "fill:" || propertyName === "stroke:") { //fill、strokeプロパティは別途、SVGPaintで処理
ti = new SVGPaint();
+ ti.cssText = tc;
var _urlreg = /url\(#([^)]+)/;
var paintType = SVGPaint.SVG_PAINTTYPE_UNKNOWN, uri = null, color = null;
if (tc.indexOf("none") > -1) {
paintType = SVGPaint.SVG_PAINTTYPE_NONE;
} else if (tc.indexOf("currentColor") > -1) {
paintType = SVGPaint.SVG_PAINTTYPE_CURRENTCOLOR;
- color = style.getPropertyValue("color");
+ color = this.getPropertyValue("color");
} else {
if (_urlreg.test(tc)) { //fill属性の値がurl(#id)ならば
paintType = SVGPaint.SVG_PAINTTYPE_URI;
@@ -687,7 +689,6 @@
var s = new CSSStyleDeclaration();
do {
//リストを連結することによって、カスケーディングを実現する
- s._list = s._list.concat(elt.ownerDocument.getOverrideStyle(elt)._list); //まず、上書きスタイルシートから処理
s._list = s._list.concat(elt.style._list);
s._list = s._list.concat(elt._attributeStyle._list); //プレゼンテーション属性を結びつける
elt = elt.parentNode;