OSDN Git Service

Version 0.6.76, changed _rawNode to _rawObject.
[pettanr/clientJs.git] / 0.6.x / js / 01_dom / 11_XDomNode.js
index 0834efd..8d8d309 100644 (file)
@@ -46,7 +46,7 @@ X.Dom.Node = X.EventDispatcher.inherits(
                \r
                _isNew     : false,\r
                \r
-               _rawNode   : null,\r
+               _rawObject   : null,\r
                _rect      : null, // \r
                \r
                _root      : null, // xnode が文書ツリーに属しているか?はこれを見る\r
@@ -79,7 +79,7 @@ X.Dom.Node = X.EventDispatcher.inherits(
                                this._xnodeType = 1;\r
                                this._state     = X.Dom.State.DISPLAY_INLINE; // todo\r
                                arguments[ 1 ] && this.attr( arguments[ 1 ] );\r
-                               css = arguments[ 2 ] || arguments[ 1 ];\r
+                               css = arguments[ 2 ];\r
                                css && this[ X.Type.isString( css ) ? 'cssText' : 'css' ]( css );\r
                        } else\r
                        if( Node._newByText ){\r
@@ -102,7 +102,7 @@ X.Dom.Node = X.EventDispatcher.inherits(
                                                // v.parentNode || v.parentElement : dom1 || dom0\r
                                                this.parent     = ( parent = v.parentNode || v.parentElement ) && parent.tagName /* ie7- */ && Node._getXNode( parent );\r
                                                this._root      = this.parent ? this.parent._root : null;\r
-                                               this._rawNode   = v;\r
+                                               this._rawObject   = v;\r
                                                this._xnodeType = 1;\r
                                                this._state     = X.Dom.State.DISPLAY_BLOCK; // todo\r
                                                this._tag       = v.tagName.toUpperCase();\r
@@ -123,7 +123,7 @@ X.Dom.Node = X.EventDispatcher.inherits(
                                                if( xnode = Node._getXNode( v ) ) return xnode;\r
                                                this.parent     = Node._getXNode( v.parentNode );\r
                                                this._root      = this.parent ? this.parent._root : null;\r
-                                               this._rawNode   = v;\r
+                                               this._rawObject   = v;\r
                                                this._xnodeType = 3;\r
                                                this._state     = X.Dom.State.DISPLAY_INLINE;\r
                                                this._text      = v.data;\r
@@ -136,7 +136,7 @@ X.Dom.Node = X.EventDispatcher.inherits(
                                                return Node.none;\r
                                        case Node.IS_IMAGE :\r
                                                if( xnode = Node._getXNode( v ) ) return xnode;\r
-                                               this._rawNode   = v;\r
+                                               this._rawObject   = v;\r
                                                this._xnodeType = 4;\r
                                                v.UID           = uid;\r
                                                this._state     = X.Dom.State.EXIST;\r
@@ -144,7 +144,7 @@ X.Dom.Node = X.EventDispatcher.inherits(
                                        case Node.IS_WINDOW :\r
                                        case Node.IS_DOCUMENT :\r
                                                if( xnode = Node._getXNode( v ) ) return xnode;\r
-                                               this._rawNode   = v;\r
+                                               this._rawObject   = v;\r
                                                this._xnodeType = 2;\r
                                                this._state     = X.Dom.State.DISPLAY_BLOCK;\r
                                                break;\r
@@ -214,7 +214,7 @@ Node._getXNode = function( v ){
                case Node.IS_RAW_TEXT :\r
                        if( v.UID ) return Node._chashe[ v.UID ];\r
                        for( chashe = Node._chashe, i = chashe.length; i; ){\r
-                               if( ( xnode = Node._chashe[ --i ] ) && ( xnode._rawNode === v ) ) return xnode;\r
+                               if( ( xnode = Node._chashe[ --i ] ) && ( xnode._rawObject === v ) ) return xnode;\r
                        };\r
        };\r
 };\r
@@ -242,7 +242,7 @@ Node.createText = function( text ){
 \r
 Node.getRoot = function( xnode ){\r
        return Node._document;\r
-       //return xNode._body._rawNode.documentElement ? node : node.ownerDocument || node.document;\r
+       //return xNode._body._rawObject.documentElement ? node : node.ownerDocument || node.document;\r
 };\r
        // XMLかどうかを判別する\r
 Node.isXmlDocument =\r
@@ -250,7 +250,7 @@ Node.isXmlDocument =
                X.emptyFunction :\r
                (function( root ){\r
                        if( X.Type.isBoolean( root.isXML ) ) return root.isXML;\r
-                       return root.isXML = root._rawNode.createElement( 'p' ).tagName !== root._rawNode.createElement( 'P' ).tagName;\r
+                       return root.isXML = root._rawObject.createElement( 'p' ).tagName !== root._rawObject.createElement( 'P' ).tagName;\r
                });\r
 \r
 Node._chashe     = [];\r
@@ -265,10 +265,10 @@ Node._reserveRemoval = [];
 \r
 if( X.Dom.DOM_IE4 ){\r
        Node.prototype._ie4getRawNode = function(){\r
-               var elm = this._rawNode;\r
+               var elm = this._rawObject;\r
                return elm ||\r
-                       ( ( elm = document.all[ 'ie4uid' + this._uid ] ) && ( this._rawNode = elm ) ) ||\r
-                       ( this._id && ( elm = document.all[ this._id ] ) ) && ( this._rawNode = elm );\r
+                       ( ( elm = document.all[ 'ie4uid' + this._uid ] ) && ( this._rawObject = elm ) ) ||\r
+                       ( this._id && ( elm = document.all[ this._id ] ) ) && ( this._rawObject = elm );\r
        };\r
 };\r
 \r
@@ -589,7 +589,7 @@ Node.prototype.destroy = function( isChild ){
        \r
        if( !this._state ) return;\r
        \r
-       elm = this._rawNode || this._ie4getRawNode && this._ie4getRawNode();\r
+       elm = this._rawObject || this._ie4getRawNode && this._ie4getRawNode();\r
        \r
        if( xnodes && ( i = xnodes.length ) ){\r
                //for( ; i; ){\r
@@ -619,7 +619,7 @@ Node.prototype.contains = function( v ){
        var elm, type, xnodes, i;\r
        if( !v || this._xnodeType !== 1 ) return false;\r
        // contains ie4+\r
-       if( ( elm = this._rawNode || this._ie4getRawNode && this._ie4getRawNode() ) && document.contains && ( type = Node._getType( v ) ) && ( type === Node.IS_RAW_HTML || type === Node.IS_RAW_TEXT ) ){\r
+       if( ( elm = this._rawObject || this._ie4getRawNode && this._ie4getRawNode() ) && document.contains && ( type = Node._getType( v ) ) && ( type === Node.IS_RAW_HTML || type === Node.IS_RAW_TEXT ) ){\r
                return elm.contains( v );       \r
        };\r
        //if( document.compareDocumentPosition ){\r
@@ -831,7 +831,7 @@ Node.prototype.text = function( text ){
  * HTML要素に対して name の関数を実行しその戻り値を返す。関数に渡す引数も任意に設定できる。\r
  */\r
 Node.prototype.call = function( name /*, opt_args... */ ){\r
-       var raw  = this._rawNode || this._ie4getRawNode && this._ie4getRawNode(),\r
+       var raw  = this._rawObject || this._ie4getRawNode && this._ie4getRawNode(),\r
                l    = arguments.length - 1,\r
                func, args, params, i;\r
        if( !raw ) return;\r
@@ -886,7 +886,7 @@ Node.prototype.each = function( func /*, opt_args */ ){
  *  Async commit update\r
  * \r
  * state:\r
- *  0 : no_rawnode\r
+ *  0 : no_rawObject\r
  *  1 : no_parent\r
  *  2 : no_root\r
  *  3 : dirty\r
@@ -919,8 +919,8 @@ Node.prototype._startUpdate = function(){
 \r
        removal = Node._reserveRemoval;\r
        \r
-       tmp = this._rawNode.style.visibility;\r
-       //this._rawNode.style.visibility = 'hidden';\r
+       tmp = this._rawObject.style.visibility;\r
+       //this._rawObject.style.visibility = 'hidden';\r
 \r
        //console.log( '_actualRemove().' );\r
 \r
@@ -940,13 +940,13 @@ Node.prototype._startUpdate = function(){
        //console.log( 'end of _startUpdate().' );\r
        \r
        X.Dom._listeners && X.Dom._listeners[ X.Dom.Event.AFTER_UPDATE ] && X.Dom.asyncDispatch( 0, { type : X.Dom.Event.AFTER_UPDATE } );\r
-       //this._rawNode.style.visibility = tmp;\r
+       //this._rawObject.style.visibility = tmp;\r
 };\r
 \r
 Node.prototype._commitUpdate =\r
        X.Dom.DOM_W3C ?\r
                ( function( parentElement, nextElement ){\r
-                       var elm = this._rawNode,\r
+                       var elm = this._rawObject,\r
                                xnodes, l, i, frg, next, k, v;\r
 \r
                        if( this._state & X.Dom.State.IE5_DISPLAY_NONE_FIX ){\r
@@ -961,7 +961,7 @@ Node.prototype._commitUpdate =
                                        parentElement.appendChild( this._actualCreate() );\r
                                this._afterActualCreate();\r
 \r
-                               return elm || this._rawNode;\r
+                               return elm || this._rawObject;\r
                        } else\r
                        if( ( xnodes = this._xnodes ) && ( l = xnodes.length ) ) {\r
                                \r
@@ -989,7 +989,7 @@ Node.prototype._commitUpdate =
                }) :\r
        X.Dom.DOM_IE4 ? \r
                ( function( parentElement, prevElement ){\r
-                       var elm    = this._rawNode || this._ie4getRawNode(),\r
+                       var elm    = this._rawObject || this._ie4getRawNode(),\r
                                xnodes, l, i, html, text, prev;\r
 \r
                        if( !elm ){\r
@@ -997,7 +997,7 @@ Node.prototype._commitUpdate =
                                        prevElement.insertAdjacentHTML( 'AfterEnd', this._actualCreate() ) :\r
                                        parentElement.insertAdjacentHTML( 'AfterBegin', this._actualCreate() );\r
                                this._afterActualCreate();\r
-                               return this._rawNode || this._ie4getRawNode();\r
+                               return this._rawObject || this._ie4getRawNode();\r
                        };\r
                        \r
                        xnodes = this._xnodes;\r
@@ -1089,9 +1089,11 @@ Node.prototype._updateRawNode =
                                                        continue;\r
                                                };\r
                                        };\r
-                                       k = \r
+\r
                                        ( v = attrs[ k ] ) === undefined ?\r
                                                elm.removeAttribute( rename[ k ] || k ) :\r
+                                       X.UA.IE === 8 ?\r
+                                               elm.setAttribute( rename[ k ] || k, X.Dom.Attr.noValue[ k ] ? k : v ) :\r
                                                ( elm[ rename[ k ] || k ] = X.Dom.Attr.noValue[ k ] ? k : v );                          \r
 \r
                                };\r
@@ -1134,7 +1136,7 @@ Node.prototype._updateRawNode =
                        };\r
                        \r
                        if( this._dirty & X.Dom.Dirty.IE_FILTER ){\r
-                               this._rawNode.style.filter = X.Dom.Style.SPECIAL_FIX( this._css );\r
+                               this._rawObject.style.filter = X.Dom.Style.SPECIAL_FIX( this._css );\r
                        };\r
                        \r
                        // attr\r
@@ -1171,13 +1173,13 @@ Node.prototype._updateRawNode =
  */\r
 Node.prototype._actualCreate =\r
        X.Dom.DOM_W3C ? (function( isChild ){\r
-               var elm = this._rawNode,\r
+               var elm = this._rawObject,\r
                        xnodes, frg, i, l;\r
                \r
                if( this._xnodeType === 3 ){\r
                        if( elm ) return elm;\r
                        delete this._dirty;\r
-                       return this._rawNode = document.createTextNode( X.Dom.chrReferanceTo( this._text ) );\r
+                       return this._rawObject = document.createTextNode( X.Dom.chrReferanceTo( this._text ) );\r
                };\r
                \r
                if( !elm ){\r
@@ -1185,7 +1187,7 @@ Node.prototype._actualCreate =
                                delete this._cssText;\r
                        };\r
                        this._isNew = true;\r
-                       this._rawNode = elm =\r
+                       this._rawObject = elm =\r
                                X.Dom._strictElmCreation ?\r
                                        document.createElement( [\r
                                                '<', this._tag,\r
@@ -1215,9 +1217,9 @@ Node.prototype._actualCreate =
                \r
                if( this._xnodeType === 3 ){\r
                        html = [ '<FONT id=ie4uid', uid, ' UID="', uid, '">', this._text, '</FONT>' ];// fake textNode\r
-                       delete this._rawNode;\r
+                       delete this._rawObject;\r
                } else {\r
-                       if( this._rawNode && !isChild ) this._actualRemove( true );\r
+                       if( this._rawObject && !isChild ) this._actualRemove( true );\r
                        \r
                        if( this._dirty & X.Dom.Dirty.CSS && !( this._cssText = X.Dom.Style.objToCssText( this._css ) ) ){\r
                                delete this._cssText;\r
@@ -1255,7 +1257,7 @@ Node.prototype._actualCreate =
 \r
 Node.prototype._afterActualCreate =\r
        X.Dom.DOM_W3C ? (function(){\r
-               var elm = this._rawNode, xnodes, l, attrs, k, i;\r
+               var elm = this._rawObject, xnodes, l, attrs, k, i;\r
 \r
                this._root  = this.parent._root;\r
                \r
@@ -1322,7 +1324,7 @@ Node.prototype._actualRemove =
        X.Dom.DOM_W3C ?\r
                ( function( isChild ){\r
                        var xnodes = this._xnodes,\r
-                               elm    = this._rawNode,\r
+                               elm    = this._rawObject,\r
                                child, i, l;\r
                        if( xnodes && ( l = xnodes.length ) ){\r
                                for( i = 0; i < l; ++i ){\r
@@ -1343,7 +1345,7 @@ Node.prototype._actualRemove =
        X.Dom.DOM_IE4 ?\r
                ( function( isChild ){\r
                        var xnodes = this._xnodes,\r
-                               elm    = this._rawNode || this._ie4getRawNode(),\r
+                               elm    = this._rawObject || this._ie4getRawNode(),\r
                                i, l, xnode;\r
                        if( xnodes && ( l = xnodes.length ) ){\r
                                for( i = 0; i < l; ++i ){\r
@@ -1360,7 +1362,7 @@ Node.prototype._actualRemove =
                        elm.removeAttribute( 'id' ); // ?\r
                        document.all[ this._id || ( 'ie4uid' + this._uid ) ] = null; // MacIE5 でエラー\r
                        if( !isChild ) elm.outerHTML = '';\r
-                       delete this._rawNode;\r
+                       delete this._rawObject;\r
                }) :\r
                (function(){});\r
 \r