- </code></pre>\r
- * @return {Object} An object containing the viewport's size {width: (viewport width), height: (viewport height)}\r
- */\r
- getViewSize : function(){\r
- var doc = document,\r
- d = this.dom,\r
- extdom = Ext.lib.Dom,\r
- isDoc = (d == doc || d == doc.body);\r
- return { width : (isDoc ? extdom.getViewWidth() : d.clientWidth),\r
- height : (isDoc ? extdom.getViewHeight() : d.clientHeight) };\r
- },\r
+ * </code></pre>\r
+ *\r
+ * getViewSize utilizes clientHeight/clientWidth which excludes sizing of scrollbars.\r
+ * To obtain the size including scrollbars, use getStyleSize\r
+ *\r
+ * Sizing of the document body is handled at the adapter level which handles special cases for IE and strict modes, etc.\r
+ */\r
+\r
+ getViewSize : function(){\r
+ var doc = document,\r
+ d = this.dom,\r
+ isDoc = (d == doc || d == doc.body);\r
+\r
+ // If the body, use Ext.lib.Dom\r
+ if (isDoc) {\r
+ var extdom = Ext.lib.Dom;\r
+ return {\r
+ width : extdom.getViewWidth(),\r
+ height : extdom.getViewHeight()\r
+ }\r
+\r
+ // Else use clientHeight/clientWidth\r
+ } else {\r
+ return {\r
+ width : d.clientWidth,\r
+ height : d.clientHeight\r
+ }\r
+ }\r
+ },\r
+\r
+ <div id="method-Ext.Element-getStyleSize"></div>/**\r
+ * <p>Returns the dimensions of the element available to lay content out in.<p>\r
+ *\r
+ * getStyleSize utilizes prefers style sizing if present, otherwise it chooses the larger of offsetHeight/clientHeight and offsetWidth/clientWidth.\r
+ * To obtain the size excluding scrollbars, use getViewSize\r
+ *\r
+ * Sizing of the document body is handled at the adapter level which handles special cases for IE and strict modes, etc.\r
+ */\r
+\r
+ getStyleSize : function(){\r
+ var me = this,\r
+ w, h,\r
+ doc = document,\r
+ d = this.dom,\r
+ isDoc = (d == doc || d == doc.body),\r
+ s = d.style;\r
+\r
+ // If the body, use Ext.lib.Dom\r
+ if (isDoc) {\r
+ var extdom = Ext.lib.Dom;\r
+ return {\r
+ width : extdom.getViewWidth(),\r
+ height : extdom.getViewHeight()\r
+ }\r
+ }\r
+ // Use Styles if they are set\r
+ if(s.width && s.width != 'auto'){\r
+ w = parseFloat(s.width);\r
+ if(me.isBorderBox()){\r
+ w -= me.getFrameWidth('lr');\r
+ }\r
+ }\r
+ // Use Styles if they are set\r
+ if(s.height && s.height != 'auto'){\r
+ h = parseFloat(s.height);\r
+ if(me.isBorderBox()){\r
+ h -= me.getFrameWidth('tb');\r
+ }\r
+ }\r
+ // Use getWidth/getHeight if style not set.\r
+ return {width: w || me.getWidth(true), height: h || me.getHeight(true)};\r
+ },\r