[Sie-announce] SIEコード [3001] CSS2PropertiesやCSSStyleDeclaretionなどの値を整理して軽量化

Zurück zum Archiv-Index

svnno****@sourc***** svnno****@sourc*****
2011年 10月 14日 (金) 21:32:35 JST


Revision: 3001
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=3001
Author:   dhrname
Date:     2011-10-14 21:32:35 +0900 (Fri, 14 Oct 2011)

Log Message:
-----------
CSS2PropertiesやCSSStyleDeclaretionなどの値を整理して軽量化

Modified Paths:
--------------
    branches/08x/087/org/w3c/dom/css.js

Modified: branches/08x/087/org/w3c/dom/css.js
===================================================================
--- branches/08x/087/org/w3c/dom/css.js	2011-10-13 14:26:44 UTC (rev 3000)
+++ branches/08x/087/org/w3c/dom/css.js	2011-10-14 12:32:35 UTC (rev 3001)
@@ -569,31 +569,35 @@
 };
 
 function RGBColor() {
-  this.red = new CSSPrimitiveValue();
-  this.green = new CSSPrimitiveValue();
-  this.blue = new CSSPrimitiveValue();
+  var cs = CSSPrimitiveValue;
+  this.red = new cs();
+  this.green = new cs();
+  this.blue = new cs();
+  cs = void 0;
   this.red.primitiveType = this.green.primitiveType = this.blue.primitiveType = /*CSSPrimitiveValue.CSS_NUMBER*/ 1;
   return this;
 };
 
 function Rect() {
-  this.top = new CSSPrimitiveValue();
-  this.right = new CSSPrimitiveValue();
-  this.bottom = new CSSPrimitiveValue();
-  this.left = new CSSPrimitiveValue();
+  var cs = CSSPrimitiveValue;
+  this.top = new cs();
+  this.right = new cs();
+  this.bottom = new cs();
+  this.left = new cs();
+  cs = void 0; 
   return this;
 };
 
 function Counter() {
-  this.identifier = "";
-  this.listStyle = "";
-  this.separator = "";
+  this.identifier = this.listStyle = this.separator = "";
   return this;
 };
 
 function ElementCSSInlineStyle() {
-  this.style = new CSSStyleDeclaration();
-  this._attributeStyle = new CSSStyleDeclaration(); //プレゼンテーション属性の値を格納する
+  var cs = CSSStyleDeclaration;
+  this.style = new cs();
+  this._attributeStyle = new cs(); //プレゼンテーション属性の値を格納する
+  cs = void 0;
   return this;
 };
 
@@ -601,16 +605,19 @@
  *削除不可
  *さらにSVG CSSを付け加えている
  */
-var CSS2Properties = {
+var n = "none",
+    m = "normal",
+    a = "auto",
+    CSS2Properties = {
   fill : "black",
-  stroke : "none",
-  cursor : "auto",
+  stroke : n,
+  cursor : a,
   visibility : "visible",
   display : "inline-block",
   opacity : "1",
   fillOpacity : "1",
   strokeWidth : "1",
-  strokeDasharray : "none",
+  strokeDasharray : n,
   strokeDashoffset : "0",
   strokeLinecap : "butt",
   strokeLinejoin : "miter",
@@ -620,11 +627,11 @@
   fontFamily : "serif",
   fontSize : "12",
   color : "black",
-  fontSizeAdjust : "none",
-  fontStretch : "normal",
-  fontStyle : "normal",
-  fontVariant : "normal",
-  fontWeight : "normal",
+  fontSizeAdjust : n,
+  fontStretch : m,
+  fontStyle : m,
+  fontVariant : m,
+  fontWeight : m,
   font : "inline",
 
 //# Gradient properties:
@@ -635,29 +642,29 @@
   azimuth : "center",
                                         // raises(dom::DOMException) on setting
   //簡略プロパティに関しては、初期値を再考せよ
-  clip : "auto",
+  clip : a,
   direction : "ltr",
-  letterSpacing : "normal",
-  lineHeight : "normal",
+  letterSpacing : m,
+  lineHeight : m,
   overflow : "visible",
   textAlign : "left",
-  textDecoration : "none",
+  textDecoration : n,
   textIndent : "0",
-  textShadow : "none",
-  textTransform : "none",
-  unicodeBidi : "normal",
+  textShadow : n,
+  textTransform : n,
+  unicodeBidi : m,
   verticalAlign : "baseline",
-  whiteSpace : "normal",
-  wordSpacing : "normal",
-  zIndex : "auto",
+  whiteSpace : m,
+  wordSpacing : m,
+  zIndex : a,
 //  #
 
-  mask : "none",
+  mask : n,
 
 //# Filter Effects properties:
 
   enableBackground : "accumulate",
-  filter : "none",
+  filter : n,
   floodColor : "black",
   floodOpacity : "1",
   lightingColor : "white",
@@ -670,26 +677,27 @@
 
   colorInterpolation : "sRGB",
   colorInterpolationFilters : "linearRGB",
-  colorProfile : "auto",
-  colorRendering : "auto",
-  imageRendering : "auto",
+  colorProfile : a,
+  colorRendering : a,
+  imageRendering : a,
   marker : "",
-  markerEnd : "none",
-  markerMid : "none",
-  markerStart : "none",
-  shapeRendering : "auto",
-  textRendering : "auto",
+  markerEnd : n,
+  markerMid : n,
+  markerStart : n,
+  shapeRendering : a,
+  textRendering : a,
 
 //# Text properties:
 
   alignmentBaseline : "",
   baselineShift : "baseline",
-  dominantBaseline : "auto",
+  dominantBaseline : a,
   glyphOrientationHorizontal : "0deg",
-  glyphOrientationVertical : "auto",
-  kerning : "auto",
+  glyphOrientationVertical : a,
+  kerning : a,
   fillRule : "nonzero"
 };
+n = m = a = void 0;
 CSS2Properties.visibility._n = 1; //初期値の設定(_setPaintで使う)
 
 function CSSStyleSheet() {




Sie-announce メーリングリストの案内
Zurück zum Archiv-Index