X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=0.6.x%2Fjs%2Fdom%2F13_XDomBoxModel.js;h=7219b085da43a4d4db2d3dbe1baf3afafa53c362;hb=7392bd7eff3b3f4877467fc0fcfe480206945fba;hp=172365a850877a8d2c29b3a42196f35385639597;hpb=409ecf89ecca32471732f2b1653e4b5233bd49f7;p=pettanr%2FclientJs.git diff --git a/0.6.x/js/dom/13_XDomBoxModel.js b/0.6.x/js/dom/13_XDomBoxModel.js index 172365a..7219b08 100644 --- a/0.6.x/js/dom/13_XDomBoxModel.js +++ b/0.6.x/js/dom/13_XDomBoxModel.js @@ -37,32 +37,34 @@ X.Dom.listenOnce( X.Dom.Event.DOM_INIT, function(){ * overflow:hidden かつ width か height が設定されていたら、再描画しないでその値を返す */ Node.prototype.width = function(){ - var elm; - if( !this.parent ) return 0; + if( !this.parent ){ + console.log( 'xnode.width() : no parent' ); + return 0; + }; + Node.root._updateTimerID && Node.root._startUpdate(); if( document.getElementById ){ // this.css( X.Dom.Style.Unit.px, 'width' ); - return ( elm = this._rawNode ) ? elm.offsetWidth : 0; + return this._rawNode.offsetWidth; } else if( document.all ){ - if( !( elm = this._ie4getRawNode() ) ) return 0; - Node.root._updateReserved === true && Node.root._startUpdate(); - return elm.offsetWidth; + return ( this._rawNode || this._ie4getRawNode() ).offsetWidth; } else { }; }; Node.prototype.height = function(){ - var elm; - if( !this.parent ) return 0; + if( !this.parent ){ + console.log( 'xnode.height() : no parent' ); + return 0; + }; + Node.root._updateTimerID && Node.root._startUpdate(); if( document.getElementById ){ // this.css( X.Dom.Style.Unit.px, 'height' ); - return ( elm = this._rawNode ) ? elm.offsetHeight : 0; + return this._rawNode.offsetHeight; } else if( document.all ){ - if( !( elm = this._ie4getRawNode() ) ) return 0; - Node.root._updateReserved === true && Node.root._startUpdate(); - return elm.offsetHeight; + return ( this._rawNode || this._ie4getRawNode() ).offsetHeight; } else { }; @@ -77,35 +79,38 @@ Node.prototype.height = function(){ */ // X.Dom.Style.transform, Node.prototype.x = function(){ - var elm; - if( !this.parent ) return 0; + if( !this.parent ){ + console.log( 'xnode.x() : no parent' ); + return 0; + }; + Node.root._updateTimerID && Node.root._startUpdate(); if( document.getElementById ){ // this.css( X.Dom.Style.Unit.px, 'left' ); // this.css( X.Dom.Style.Unit.px, 'translateX' ); - return ( elm = this._rawNode ) ? elm.offsetLeft : 0; + return this._rawNode.offsetLeft; } else if( document.all ){ - if( !( elm = this._ie4getRawNode() ) ) return 0; - Node.root._updateReserved === true && Node.root._startUpdate(); - return elm.offsetLeft; + return ( this._rawNode || this._ie4getRawNode() ).offsetLeft; } else { }; }; Node.prototype.y = function(){ - var elm; - if( !this.parent ) return 0; + if( !this.parent ){ + console.log( 'xnode.y() : no parent' ); + return 0; + }; + Node.root._updateTimerID && Node.root._startUpdate(); if( document.getElementById ){ // this.css( X.Dom.Style.Unit.px, 'top' ); // this.css( X.Dom.Style.Unit.px, 'transisitonY' ); - return ( elm = this._rawNode ) ? elm.offsetTop : 0; + return this._rawNode.offsetTop; } else if( document.all ){ - if( !( elm = this._ie4getRawNode() ) ) return 0; - Node.root._updateReserved === true && Node.root._startUpdate(); - return elm.offsetTop; + return ( this._rawNode || this._ie4getRawNode() ).offsetTop; } else { }; -}; \ No newline at end of file +}; +