svnno****@sourc*****
svnno****@sourc*****
2011年 9月 11日 (日) 19:50:29 JST
Revision: 2934
http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2934
Author: dhrname
Date: 2011-09-11 19:50:28 +0900 (Sun, 11 Sep 2011)
Log Message:
-----------
text要素にtext-decoration属性(プロパティ)、font-weight属性(プロパティ)などを実装
Modified Paths:
--------------
branches/08x/085/org/w3c/dom/css.js
branches/08x/085/org/w3c/dom/svg.js
Modified: branches/08x/085/org/w3c/dom/css.js
===================================================================
--- branches/08x/085/org/w3c/dom/css.js 2011-09-10 14:57:18 UTC (rev 2933)
+++ branches/08x/085/org/w3c/dom/css.js 2011-09-11 10:50:28 UTC (rev 2934)
@@ -372,6 +372,23 @@
var s = this._list[index].cssText.substring(0, this._list[index].cssText.indexOf(":"));
}
return s;
+ },
+ /*_setCSSTextメソッド SIE独自のメソッド。
+ *リストをテキストに変換して、cssTextプロパティに格納しておく。cssTextがsetterである場合は、削除しておくこと。
+ */
+ _setCSSText : function () {
+ var tlist = this._list,
+ list = {}, //SIEの設計上、プロパティが重複してしまう恐れがあるので、重複防止のためのチェックするオブジェクト
+ ti;
+ this.length = tlist.length; //setPropertyメソッドを解さないで処理する場合があるため、lengthプロパティを同値にする
+ for (var i=tlist.length-1;i>=0;--i) {
+ ti = this.item(i);
+ if (!list[ti]) {
+ this.cssText += tlist[i].cssText+ ";";
+ list[ti] = 1;
+ }
+ }
+ tlist = list = ti = i = null;
}
};
Modified: branches/08x/085/org/w3c/dom/svg.js
===================================================================
--- branches/08x/085/org/w3c/dom/svg.js 2011-09-10 14:57:18 UTC (rev 2933)
+++ branches/08x/085/org/w3c/dom/svg.js 2011-09-11 10:50:28 UTC (rev 2934)
@@ -4205,8 +4205,10 @@
ttpc = ttp, //ttpcはttpのキャッシュ
tlen = tar.getComputedTextLength(),
anchor = style.getPropertyValue("text-anchor"),
+ tedeco = style.getPropertyValue("text-decoration"), //text-decorationは継承しないので、個々に設定する
ttps = ttp.style;
- ttps.cssText = tar.style.cssText;
+ style._setCSSText();
+ ttps.cssText = style.cssText;
ttps.fontSize = n + "px";
ttps.fontFamily = style.getPropertyValue("font-family");
/*ここでの変数jは前回ノードまでの総文字数*/
@@ -4236,6 +4238,7 @@
sty.height = "0px";
sty.marginTop = tar._isYokogaki ? -n-5+ "px" : "-5px";
sty.lineHeight = n+10+ "px";
+ sty.textDecoration = tedeco;
ttp.appendChild(ti._tars[ij]);
sty = p = null;
}
@@ -4314,7 +4317,7 @@
}
delete tar._cacheMatrix;
delete tar._currentStyle;
- isRect = evt = tar = style = tpp = ttpc = style = color = cursor = disp = vis = ttps = backr = backrs = null;
+ isRect = evt = tar = style = tedeco = tpp = ttpc = style = color = cursor = disp = vis = ttps = backr = backrs = null;
}, false);
evt = tar = null;
},false);