svnno****@sourc*****
svnno****@sourc*****
2011年 11月 10日 (木) 23:24:54 JST
Revision: 3088 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=3088 Author: dhrname Date: 2011-11-10 23:24:54 +0900 (Thu, 10 Nov 2011) Log Message: ----------- Modified Paths: -------------- branches/08x/089/org/w3c/dom/css.js Modified: branches/08x/089/org/w3c/dom/css.js =================================================================== --- branches/08x/089/org/w3c/dom/css.js 2011-11-09 12:06:48 UTC (rev 3087) +++ branches/08x/089/org/w3c/dom/css.js 2011-11-10 14:24:54 UTC (rev 3088) @@ -703,7 +703,7 @@ }; /*CSSStyleDeclaration*/ ViewCSS.prototype.getComputedStyle = function( /*Element*/ elt, /*string*/ pseudoElt) { var s = new CSSStyleDeclaration(), - ct, p; + ct, p, el, eso; ct = null p = {length:0, _opacity:1, _fontSize:12}; //クロージャを利用して、カスケーディングを実現する @@ -738,13 +738,16 @@ return css; }; })(elt, this._defaultCSS, s); //_defaultCSSはデフォルト値の設定 - if (!!elt.style) { - var eso = elt.style._list._opacity || elt._attributeStyle._list._opacity; - } else { - var eso = 1; + el = elt; + while (el) { + if (!!el.style) { + eso = el.style._list._opacity || el._attributeStyle._list._opacity; + } else { + eso = 1; + } } s._list._opacity = p._opacity * (eso || 1); - s._list._fontSize = p._fontSize; + s._list._fontSize = elt.style && elt.style._list._fontSize; pelt = eso = p = void 0; s._document = elt.ownerDocument; return s;