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;
33 /* --------------------------------------
35 * display:blobk かつ overflow:hidden かつ size(px,em)が設定されていたら、再描画しないでその値を返す
38 Node.prototype.width = function(){
40 console.log( 'xnode.width() : no parent' );
43 Node.root._updateTimerID && Node.root._startUpdate();
44 if( document.getElementById ){
45 // this.css( X.Dom.Style.Unit.px, 'width' );
46 return this._rawNode.offsetWidth;
49 return ( this._rawNode || this._ie4getRawNode() ).offsetWidth;
55 Node.prototype.height = function(){
57 console.log( 'xnode.height() : no parent' );
60 Node.root._updateTimerID && Node.root._startUpdate();
61 if( document.getElementById ){
62 // this.css( X.Dom.Style.Unit.px, 'height' );
63 return this._rawNode.offsetHeight;
66 return ( this._rawNode || this._ie4getRawNode() ).offsetHeight;
72 /* --------------------------------------
74 * position:absolute かつ x か y が設定されていたら、再描画しないで css オブジェクトから計算した値を返す。 float は?
75 * position:absolute の指定で自動で top,left を補う必要あり? -> X.Dom.Style
76 * 親要素 border 外側からの値。 IE, Firefox, Safari, Chrome の offsetLeft/Topでは、border 内側なので補正する。
77 * transformX, Y は加える? アニメーション中は?
79 // X.Dom.Style.transform,
80 Node.prototype.x = function(){
82 console.log( 'xnode.x() : no parent' );
85 Node.root._updateTimerID && Node.root._startUpdate();
86 if( document.getElementById ){
87 // this.css( X.Dom.Style.Unit.px, 'left' );
88 // this.css( X.Dom.Style.Unit.px, 'translateX' );
89 return this._rawNode.offsetLeft;
92 return ( this._rawNode || this._ie4getRawNode() ).offsetLeft;
98 Node.prototype.y = function(){
100 console.log( 'xnode.y() : no parent' );
103 Node.root._updateTimerID && Node.root._startUpdate();
104 if( document.getElementById ){
105 // this.css( X.Dom.Style.Unit.px, 'top' );
106 // this.css( X.Dom.Style.Unit.px, 'transisitonY' );
107 return this._rawNode.offsetTop;
110 return ( this._rawNode || this._ie4getRawNode() ).offsetTop;