8 boxSizingEnabled : false
\r
11 X.Dom.listenOnce( X.Dom.Event.DOM_INIT, function(){
\r
13 var elm = Node._systemNode._rawNode || Node._systemNode._ie4getRawNode();
\r
14 elm.style.cssText = 'width:10px;padding:1px;border:2px solid #0;margin:4px;';
\r
16 X.Dom.BoxModel.defaultBoxModel = elm.offsetWidth === 10 ?
\r
17 X.Dom.BoxModel.BORDER_BOX :
\r
18 X.Dom.BoxModel.CONTENT_BOX;
\r
20 if( X.Dom.BoxModel.defaultBoxModel === X.Dom.BoxModel.CONTENT_BOX ){
\r
21 elm.style.cssText += 'box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing: border-box;-o-box-sizing:border-box;-ms-box-sizing:border-box;';
\r
23 X.Dom.BoxModel.boxSizingEnabled = elm.offsetWidth === 10;
\r
33 /* --------------------------------------
\r
35 * display:blobk かつ overflow:hidden かつ size(px,em)が設定されていたら、再描画しないでその値を返す
\r
38 Node.prototype.width = function(){
\r
39 if( !this.parent ){// todo : _state で tree に所属しているか?判定
\r
40 console.log( 'xnode.width() : no parent' );
\r
43 Node.root._updateTimerID && Node.root._startUpdate();
\r
45 console.log( 'xnode.width() : not belong tree.' );
\r
48 if( this._state & X.Dom.State.DISPLAY_NONE ) return 0;
\r
49 if( document.getElementById ){
\r
50 // this.css( X.Dom.Style.Unit.px, 'width' );
\r
51 return this._rawNode.offsetWidth;
\r
54 return ( this._rawNode || this._ie4getRawNode() ).offsetWidth;
\r
60 Node.prototype.height = function(){
\r
62 console.log( 'xnode.height() : no parent' );
\r
65 Node.root._updateTimerID && Node.root._startUpdate();
\r
67 console.log( 'xnode.height() : not belong tree.' );
\r
70 if( this._state & X.Dom.State.DISPLAY_NONE ) return 0;
\r
71 if( document.getElementById ){
\r
72 // this.css( X.Dom.Style.Unit.px, 'height' );
\r
73 return this._rawNode.offsetHeight;
\r
76 return ( this._rawNode || this._ie4getRawNode() ).offsetHeight;
\r
82 Node.prototype.scrollWidth = function(){
\r
83 if( !this.parent ){// todo : _state で tree に所属しているか?判定
\r
84 console.log( 'xnode.width() : no parent' );
\r
87 Node.root._updateTimerID && Node.root._startUpdate();
\r
89 console.log( 'xnode.width() : not belong tree.' );
\r
92 if( this._state & X.Dom.State.DISPLAY_NONE ) return 0;
\r
93 if( document.getElementById ){
\r
94 // this.css( X.Dom.Style.Unit.px, 'width' );
\r
95 return this._rawNode.scrollWidth;
\r
98 return ( this._rawNode || this._ie4getRawNode() ).scrollWidth;
\r
104 Node.prototype.scrollHeight = function(){
\r
105 if( !this.parent ){
\r
106 console.log( 'xnode.height() : no parent' );
\r
109 Node.root._updateTimerID && Node.root._startUpdate();
\r
111 console.log( 'xnode.height() : not belong tree.' );
\r
114 if( this._state & X.Dom.State.DISPLAY_NONE ) return 0;
\r
115 if( document.getElementById ){
\r
116 // this.css( X.Dom.Style.Unit.px, 'height' );
\r
117 return this._rawNode.scrollHeight;
\r
119 if( document.all ){
\r
120 return ( this._rawNode || this._ie4getRawNode() ).scollHeight;
\r
127 /* --------------------------------------
\r
129 * position:absolute かつ x か y が設定されていたら、再描画しないで css オブジェクトから計算した値を返す。 float は?
\r
130 * position:absolute の指定で自動で top,left を補う必要あり? -> X.Dom.Style
\r
131 * 親要素 border 外側からの値。 IE, Firefox, Safari, Chrome の offsetLeft/Topでは、border 内側なので補正する。
\r
132 * transformX, Y は加える? アニメーション中は?
\r
134 // X.Dom.Style.transform,
\r
135 Node.prototype.x = function(){
\r
136 if( !this.parent ){
\r
137 console.log( 'xnode.x() : no parent' );
\r
140 Node.root._updateTimerID && Node.root._startUpdate();
\r
142 console.log( 'xnode.x() : not belong tree.' );
\r
145 if( this._state & X.Dom.State.DISPLAY_NONE ) return 0;
\r
146 if( document.getElementById ){
\r
147 // this.css( X.Dom.Style.Unit.px, 'left' );
\r
148 // this.css( X.Dom.Style.Unit.px, 'translateX' );
\r
149 return this._rawNode.offsetLeft;
\r
151 if( document.all ){
\r
152 return ( this._rawNode || this._ie4getRawNode() ).offsetLeft;
\r
158 Node.prototype.y = function(){
\r
159 if( !this.parent ){
\r
160 console.log( 'xnode.y() : no parent' );
\r
163 Node.root._updateTimerID && Node.root._startUpdate();
\r
165 console.log( 'xnode.y() : not belong tree.' );
\r
168 if( this._state & X.Dom.State.DISPLAY_NONE ) return 0;
\r
169 if( document.getElementById ){
\r
170 // this.css( X.Dom.Style.Unit.px, 'top' );
\r
171 // this.css( X.Dom.Style.Unit.px, 'transisitonY' );
\r
172 return this._rawNode.offsetTop;
\r
174 if( document.all ){
\r
175 return ( this._rawNode || this._ie4getRawNode() ).offsetTop;
\r