OSDN Git Service

Version 0.6.74, bugfix X.Dom.Node.className(), new X.Dom.Style.VENDER_PREFIX detection.
authoritozyun <itozyun@user.sourceforge.jp>
Thu, 4 Sep 2014 13:17:36 +0000 (22:17 +0900)
committeritozyun <itozyun@user.sourceforge.jp>
Thu, 4 Sep 2014 13:17:36 +0000 (22:17 +0900)
0.6.x/js/01_dom/11_XDomNode.js
0.6.x/js/01_dom/12_XDomEvent.js
0.6.x/js/01_dom/15_XDomStyle.js

index e40d14f..0834efd 100644 (file)
@@ -626,7 +626,8 @@ Node.prototype.contains = function( v ){
        //      \r
        //};\r
        xnodes = this._xnodes;\r
-       if( xnodes.indexOf( v ) !== -1 ) return true;\r
+       if( !xnodes || !xnodes.length ) return false;\r
+       if( xnodes.indexOf( v ) !== -1 ) return true; // fast\r
        if( elm === v.parentNode ) return false;\r
        for( i = xnodes.length; i; ){\r
                if( xnodes[ --i ].contains( v ) ) return true;\r
@@ -1050,7 +1051,7 @@ Node.prototype._updateRawNode =
                        };\r
                        // className\r
                        if( this._dirty & X.Dom.Dirty.CLASSNAME ){\r
-                               this._className ? ( elm.className = this._className ) : ( elm.className && elm.removeAttribute( X.UA.IE ? 'className' : 'class' ) );                                    \r
+                               this._className ? ( elm.className = this._className ) : ( elm.className && elm.removeAttribute( X.UA.IE5678 ? 'className' : 'class' ) ); // className は ie7-?                         \r
 \r
                                // ie5 only\r
                                if( X.Dom.State.IE5_DISPLAY_NONE_FIX && elm.currentStyle.display === 'none' ){\r
index 591c479..0615482 100644 (file)
@@ -47,8 +47,8 @@ if( !X.UA.IE || 9 <= X.UA.IE ){
                // https://w3g.jp/blog/tools/wheelevent_crossbrowser\r
                // ホイール系イベント2014年版クロスブラウザ\r
                if( e.deltaY !== undefined ){\r
-                       this.deltaX = e.deltaX / 100;\r
-                       this.deltaY = e.deltaY / 100;\r
+                       this.deltaX = e.deltaX;\r
+                       this.deltaY = e.deltaY;\r
                } else\r
                if( e.wheelDeltaY !== undefined ){\r
                        this.deltaX = e.wheelDeltaX / 120;\r
index 968557b..dea4304 100644 (file)
@@ -111,6 +111,8 @@ _ABSOLUTE_BOX
 _FLOAT_BOX
 _GRNERAL
  */
+       VENDER_PREFIX : {},
+
        objToCssText : function( obj ){
                var css           = [],
                        me            = X.Dom.Style,
@@ -1183,40 +1185,36 @@ X.Dom.Node.prototype._getCharSize =
                });
 
 
-X.Dom.listenOnce( X.Dom.Event.DOM_PRE_INIT, function(){
-       var testStyle = X.Dom._root.style,
-               temp      = testStyle.cssText;
-       
-       X.Dom.Style.VENDER_PREFIX = (function(){
-               var ret       = {},
-                       vendors   = 'webkit,Webkit,Moz,moz,Ms,ms,O,o,khtml,Khtml'.split( ',' ),
-                       searches  = (
-                               'opacity,boxSizing,' +
-                               'transform,transformOrigin,perspective,' +
-                               'transisiton,transitionDelay,transitionProperty,transitionDuration,transitionTimingFunction,' +
-                               'userSelect,touchSelect,touchAction,touchCallout,contentZooming,userDrag,tapHighlightColor' ).split( ',' ),
-                       vendor, i, search, prop, j, v;
+( function(){
+       var testStyle = X.UA.IE4 ? {} : ( document.documentElement || document.createElement( 'div' ) ).style,
+               temp      = testStyle.cssText,
+               prefix    = X.Dom.Style.VENDER_PREFIX,
+               vendors   = 'webkit,Webkit,Moz,moz,Ms,ms,O,o,khtml,Khtml'.split( ',' ),
+               searches  = (
+                       'opacity,boxSizing,' +
+                       'transform,transformOrigin,perspective,' +
+                       'transisiton,transitionDelay,transitionProperty,transitionDuration,transitionTimingFunction,' +
+                       'userSelect,touchSelect,touchAction,touchCallout,contentZooming,userDrag,tapHighlightColor' ).split( ',' ),
+               vendor, i, search, prop, j, v;
 
-               for( i = searches.length; i; ){
-                       search = prop = searches[ --i ];
-                       
-                       if( testStyle[ prop ] === undefined ){
-                               prop = prop.charAt( 0 ).toUpperCase() + prop.substr( 1 );
-                               for( j = vendors.length; j; ){
-                                       v = vendors[ --j ];
-                                       if( testStyle[ v + prop ] !== undefined ){
-                                               if( v === 'ms' ) v = 'Ms';// for ie9
-                                               if( v === 'o' ) v = 'O';//for opera12
-                                               ret[ search ] = v + prop;
-                                               break;
-                                       };
-                               };                              
-                       } else {
-                               ret[ search ] = prop;
-                       };
+       for( i = searches.length; i; ){
+               search = prop = searches[ --i ];
+               
+               if( testStyle[ prop ] === undefined ){
+                       prop = prop.charAt( 0 ).toUpperCase() + prop.substr( 1 );
+                       for( j = vendors.length; j; ){
+                               v = vendors[ --j ];
+                               if( testStyle[ v + prop ] !== undefined ){
+                                       if( v === 'ms' ) v = 'Ms';// for ie9
+                                       if( v === 'o' ) v = 'O';//for opera12
+                                       prefix[ search ] = v + prop;
+                                       break;
+                               };
+                       };                              
+               } else {
+                       prefix[ search ] = prop;
                };
-               return ret;
-       })();
+       };
        
        testStyle.cssText = 'background:rgba(0,0,0,0.5)';
        
@@ -1250,7 +1248,7 @@ X.Dom.listenOnce( X.Dom.Event.DOM_PRE_INIT, function(){
                        clipLeft            : testStyle.clipTop === undefined && testStyle[ 'clip-top' ] === undefined ? 5 : 0,
                        clipRight           : testStyle.clipTop === undefined && testStyle[ 'clip-top' ] === undefined ? 6 : 0
                };
-} );
+} )();
 
 X.Dom.listenOnce( X.Dom.Event.DOM_INIT, function(){
        var xnode  = Node._systemNode,