[Sie-announce] SIEコード [1947] em単位をサポート

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 7月 15日 (木) 23:01:37 JST


Revision: 1947
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=1947
Author:   dhrname
Date:     2010-07-15 23:01:37 +0900 (Thu, 15 Jul 2010)

Log Message:
-----------
em単位をサポート

Modified Paths:
--------------
    branches/06x/061/org/w3c/dom/css.js

Modified: branches/06x/061/org/w3c/dom/css.js
===================================================================
--- branches/06x/061/org/w3c/dom/css.js	2010-07-15 13:50:31 UTC (rev 1946)
+++ branches/06x/061/org/w3c/dom/css.js	2010-07-15 14:01:37 UTC (rev 1947)
@@ -188,7 +188,7 @@
 /*long*/ this.length = 0;
 /*CSSRule*/ this.parentRule = null;
   this._list = []; //内部のリスト
-  this._list._opacity = null;
+  this._list._fontSize = this._list._opacity = null;
   return this;
 };
 CSSStyleDeclaration.prototype = {
@@ -215,6 +215,7 @@
     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オブジェクトが見つかった場合 
+        ti._empercents = this._list._fontSize;
         return ti;
       }
     }
@@ -306,6 +307,10 @@
       ti.cssValueType = CSSValue.CSS_INHERIT;
     } else if (propertyName === "opacity") {
       this._list._opacity = parseFloat(value);
+    } else if (propertyName === "font-size") {
+      if (/(%|em)/.test(value)) {
+        this._list.fontSize = parseFloat(value);
+      }
     }
     cssText = null;
   },
@@ -685,7 +690,7 @@
   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;
+  eso = p = q = null;
   s._document = elt.ownerDocument;
   return s;
 };




Sie-announce メーリングリストの案内
Back to archive index