X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=0.6.x%2Fjs%2Fdom%2F11_XDomNode.js;fp=0.6.x%2Fjs%2Fdom%2F11_XDomNode.js;h=2ad123d8aa525328a915a7b32ee8ac0c3643aec3;hb=bffc82eff613adae98740a7ab2e6c0e128e038ac;hp=1d8733bb51bd35bc070bacc8e53d28b9a6c5ed75;hpb=53149facb2f22305d34b9ac01803a6af433355d0;p=pettanr%2FclientJs.git diff --git a/0.6.x/js/dom/11_XDomNode.js b/0.6.x/js/dom/11_XDomNode.js index 1d8733b..2ad123d 100644 --- a/0.6.x/js/dom/11_XDomNode.js +++ b/0.6.x/js/dom/11_XDomNode.js @@ -76,7 +76,7 @@ X.Dom.Node = X.EventDispatcher.inherits( this._xnodeType = 1; this._state = X.Dom.State.DISPLAY_INLINE; // todo arguments[ 1 ] && this.attr( arguments[ 1 ] ); - css = arguments[ 2 ]; + css = arguments[ 2 ] || arguments[ 1 ]; css && this[ X.Type.isString( css ) ? 'cssText' : 'css' ]( css ); } else if( Node._newByText ){ @@ -131,8 +131,12 @@ X.Dom.Node = X.EventDispatcher.inherits( if( xnodes.length ) return xnodes[ 0 ]; return Node.none; case Node.IS_IMAGE : - v.UID = uid; - this._isImage = true; + if( xnode = Node._getXNode( v ) ) return xnode; + this._rawNode = v; + this._xnodeType = 4; + v.UID = uid; + this._state = X.Dom.State.EXIST; + break; case Node.IS_WINDOW : case Node.IS_DOCUMENT : if( xnode = Node._getXNode( v ) ) return xnode; @@ -206,6 +210,7 @@ Node._getXNode = function( v ){ case Node.IS_DOCUMENT : return Node._document; case Node.IS_RAW_TEXT : + if( v.UID ) return Node._chashe[ v.UID ]; for( chashe = Node._chashe, i = chashe.length; i; ){ if( ( xnode = Node._chashe[ --i ] ) && ( xnode._rawNode === v ) ) return xnode; }; @@ -242,7 +247,8 @@ Node.isXmlDocument = X.Dom.DOM_IE4 ? X.emptyFunction : (function( root ){ - return root._rawNode.createElement( 'p' ).tagName !== root._rawNode.createElement( 'P' ).tagName; + if( X.Type.isBoolean( root.isXML ) ) return root.isXML; + return root.isXML = root._rawNode.createElement( 'p' ).tagName !== root._rawNode.createElement( 'P' ).tagName; }); Node._chashe = []; @@ -761,7 +767,7 @@ Node.prototype.html = function( html ){ }; if( Node._outerFlag === this ) Node._outerFlag = null; }; - !Node._outerFlag || X.Dom.DTD.EMPTY[ this._tag.toLowerCase() ] || ( html[ n ] = '<\/' + this._tag + '>' ); + !Node._outerFlag || X.Dom.DTD.EMPTY[ this._tag ] || ( html[ n ] = '<\/' + this._tag + '>' ); return html.join( _ ); }; @@ -1009,7 +1015,8 @@ Node.prototype._updateRawNode = }; ( v = attrs[ k ] ) === undefined ? elm.removeAttribute( rename[ k ] || k ) : - ( elm[ rename[ k ] || k ] = v ); + ( elm[ rename[ k ] || k ] = v ); + }; delete this._newAttrs; }; @@ -1160,7 +1167,7 @@ Node.prototype._actualCreate = }; }; }; - X.Dom.DTD.EMPTY[ this._tag.toLowerCase() ] || ( html[ n ] = '<\/' + this._tag + '>' ); + X.Dom.DTD.EMPTY[ this._tag ] || ( html[ n ] = '<\/' + this._tag + '>' ); delete this._newAttrs; };