1// From jQuery: http://dev.jquery.com/browser/trunk/jquery/src/dimensions.js 2function getWindowDimensions() { 3 var elem = window; 4 if (!elem) return null; 5 6 var dim = new Object(); 7 var width, height; 8 9 // does it walk and quack like a window? 10 if ("scrollTo" in elem && elem.document) { 11 // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode 12 if (elem.document.compatMode === "CSS1Compat") { 13 width = elem.document.documentElement["clientWidth"]; 14 height = elem.document.documentElement["clientHeight"]; 15 } 16 else { 17 width = elem.document.body["clientWidth"]; 18 height = elem.document.body["clientHeight"]; 19 } 20 } 21 // is it a document? 22 else if (elem.nodeType === 9) { 23 // Either scroll[Width/Height] or offset[Width/Height], whichever is greater 24 width = Math.max( 25 elem.documentElement["clientWidth"], 26 elem.body["scrollWidth"], elem.documentElement["scrollWidth"], 27 elem.body["offsetWidth"], elem.documentElement["offsetWidth"] 28 ); 29 height = Math.max( 30 elem.documentElement["clientHeight"], 31 elem.body["scrollHeight"], elem.documentElement["scrollHeight"], 32 elem.body["offsetHeight"], elem.documentElement["offsetHeight"] 33 ); 34 } 35 36 dim["width"] = width; 37 dim["height"] = height; 38 return dim; 39}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.