8 boxSizingEnabled : false
11 X.Dom.listenOnce( X.Dom.Event.DOM_INIT, function(){
13 var elm = Node._systemNode._rawNode || Node._systemNode._ie4getRawNode();
14 elm.style.cssText = 'width:10px;padding:1px;border:2px solid #0;margin:4px;';
16 X.Dom.BoxModel.defaultBoxModel = elm.offsetWidth === 10 ?
17 X.Dom.BoxModel.BORDER_BOX :
18 X.Dom.BoxModel.CONTENT_BOX;
20 if( X.Dom.BoxModel.defaultBoxModel === X.Dom.BoxModel.CONTENT_BOX ){
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;';
23 X.Dom.BoxModel.boxSizingEnabled = elm.offsetWidth === 10;
35 /* --------------------------------------
37 * overflow:hidden かつ width か height が設定されていたら、再描画しないでその値を返す
39 Node.prototype.width = function(){
41 console.log( 'xnode.width() : no parent' );
44 Node.root._updateTimerID && Node.root._startUpdate();
45 if( document.getElementById ){
46 // this.css( X.Dom.Style.Unit.px, 'width' );
47 return this._rawNode.offsetWidth;
50 return ( this._rawNode || this._ie4getRawNode() ).offsetWidth;
56 Node.prototype.height = function(){
58 console.log( 'xnode.height() : no parent' );
61 Node.root._updateTimerID && Node.root._startUpdate();
62 if( document.getElementById ){
63 // this.css( X.Dom.Style.Unit.px, 'height' );
64 return this._rawNode.offsetHeight;
67 return ( this._rawNode || this._ie4getRawNode() ).offsetHeight;
73 /* --------------------------------------
75 * position:absolute かつ x か y が設定されていたら、再描画しないで css オブジェクトから計算した値を返す。 float は?
76 * position:absolute の指定で自動で top,left を補う必要あり? -> X.Dom.Style
77 * 親要素 border 外側からの値。 IE, Firefox, Safari, Chrome の offsetLeft/Topでは、border 内側なので補正する。
78 * transformX, Y は加える? アニメーション中は?
80 // X.Dom.Style.transform,
81 Node.prototype.x = function(){
83 console.log( 'xnode.x() : no parent' );
86 Node.root._updateTimerID && Node.root._startUpdate();
87 if( document.getElementById ){
88 // this.css( X.Dom.Style.Unit.px, 'left' );
89 // this.css( X.Dom.Style.Unit.px, 'translateX' );
90 return this._rawNode.offsetLeft;
93 return ( this._rawNode || this._ie4getRawNode() ).offsetLeft;
99 Node.prototype.y = function(){
101 console.log( 'xnode.y() : no parent' );
104 Node.root._updateTimerID && Node.root._startUpdate();
105 if( document.getElementById ){
106 // this.css( X.Dom.Style.Unit.px, 'top' );
107 // this.css( X.Dom.Style.Unit.px, 'transisitonY' );
108 return this._rawNode.offsetTop;
111 return ( this._rawNode || this._ie4getRawNode() ).offsetTop;