svnno****@sourc*****
svnno****@sourc*****
2010年 7月 15日 (木) 22:50:31 JST
Revision: 1946
http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=1946
Author: dhrname
Date: 2010-07-15 22:50:31 +0900 (Thu, 15 Jul 2010)
Log Message:
-----------
opacityプロパティに関する処理の修正
Modified Paths:
--------------
branches/06x/061/org/w3c/dom/css.js
branches/06x/061/org/w3c/dom/svg.js
Modified: branches/06x/061/org/w3c/dom/css.js
===================================================================
--- branches/06x/061/org/w3c/dom/css.js 2010-07-14 14:43:51 UTC (rev 1945)
+++ branches/06x/061/org/w3c/dom/css.js 2010-07-15 13:50:31 UTC (rev 1946)
@@ -188,6 +188,7 @@
/*long*/ this.length = 0;
/*CSSRule*/ this.parentRule = null;
this._list = []; //内部のリスト
+ this._list._opacity = null;
return this;
};
CSSStyleDeclaration.prototype = {
@@ -293,9 +294,6 @@
} else {
var ti = new CSSPrimitiveValue();
}
- if (value === "inherit") {
- ti.cssValueType = CSSValue.CSS_INHERIT;
- }
ti._priority = priority;
ti.cssText = cssText;
//_numプロパティはremovePropertyメソッドで利用する
@@ -304,6 +302,11 @@
this[propertyName] = 1;
++this.length;
}
+ if (value === "inherit") {
+ ti.cssValueType = CSSValue.CSS_INHERIT;
+ } else if (propertyName === "opacity") {
+ this._list._opacity = parseFloat(value);
+ }
cssText = null;
},
/*itemメソッド
@@ -624,6 +627,8 @@
n = p = m = i = t = u = null;
}
}
+ s._opacity = 1;
+ s._fontSize = 12;
CSS2Properties._list = s;
})();
@@ -670,20 +675,16 @@
}
var q = s._list.concat(elt.style._list)
.concat(elt._attributeStyle._list); //プレゼンテーション属性を結びつける
- s._opacity = 1;
- s._fontSize = 12;
for (var i=0,qli=q.length;i<qli;++i) {
- var prop = q[i].cssText.substring(0, 7);
if (q[i].cssValueType === CSSValue.CSS_INHERIT) {
q.splice(i, 1);
--qli;
- } else if (prop === "opacity") {
- s._opacity *= parseFloat(q[i].cssText.substring(8, q[i].length))
- } else if (prop === "font-si") {
- s._fontSize = q[i].getFloatValue(0);
}
}
s._list = q.concat(p);
+ var eso = elt.style._list._opacity || elt._attributeStyle._list._opacity;
+ s._list._opacity = p._opacity * (eso || 1);
+ s._list._fontSize = p._fontSize;
p = q = null;
s._document = elt.ownerDocument;
return s;
Modified: branches/06x/061/org/w3c/dom/svg.js
===================================================================
--- branches/06x/061/org/w3c/dom/svg.js 2010-07-14 14:43:51 UTC (rev 1945)
+++ branches/06x/061/org/w3c/dom/svg.js 2010-07-15 13:50:31 UTC (rev 1946)
@@ -1901,7 +1901,7 @@
var fillElement = !!tar._fillElement ? tar._fillElement : document.createElement("v:fill");
var fc = fill.rgbColor, num = CSSPrimitiveValue.CSS_NUMBER;
fillElement.setAttribute("color", "rgb(" +fc.red.getFloatValue(num)+ "," +fc.green.getFloatValue(num)+ "," +fc.blue.getFloatValue(num)+ ")");
- var fillOpacity = parseFloat(style.getPropertyValue("fill-opacity")) * parseFloat(style.getPropertyValue("opacity")); //opacityを掛け合わせる
+ var fillOpacity = parseFloat(style.getPropertyValue("fill-opacity")) * style._list._opacity; //opacityを掛け合わせる
if (fillOpacity < 1) {
fillElement.setAttribute("opacity", fillOpacity+"");
}
@@ -1985,7 +1985,7 @@
}
var vis = style.getPropertyValue("visibility");
el.style.visibility = vis;
- style = cursor = tar = matrix = null;
+ tod = el = fill = stroke = style = cursor = tar = matrix = null;
};
function SVGPathElement() {
@@ -4128,7 +4128,7 @@
};
function unsvgtovml() {
try {
- CSSValue = CSSPrimitiveValue = NAIBU.xmlhttp = Node = Event = NAIBU = stlog = STLog = document = null;
+ CSS2Properties = CSSValue = CSSPrimitiveValue = NAIBU.xmlhttp = Node = Event = NAIBU = stlog = STLog = document = null;
Array = ActiveXObject = window = null;
} catch(e) {}
}