var isQuirks = document.compatMode == "BackCompat"; function runScrollingTest(resultNode){ // reposition the absolute-positioned tag to the top/left of the static control // element and check to make sure each has the same offsetLeft/Top if(!("dojo" in window)){ var doc = frameElement.ownerDocument; var win = doc.parentWindow || doc.defaultView; dojo = win.dojo; } var isLtr = dojo.hitch(dojo, "withGlobal")(window, "_isBodyLtr", dojo, []); var root = isQuirks? document.body : document.documentElement; var control = document.getElementById("control"); var clientWidth = document.getElementById("clientWidth"); var abs1 = document.getElementById("abs1"); window.scrollTo(0, 0); // start with standarized placement setTimeout(function(){ var cw = dojo.hitch(dojo, "withGlobal")(window, "position", dojo, [clientWidth, false]); if(cw.x != 0){ scrollBy(cw.x, 0); // scroll width:100% control element fully into view } var p = dojo.hitch(dojo, "withGlobal")(window, "position", dojo, [control, true]); abs1.style.left = p.x + "px"; abs1.style.top = p.y + "px"; setTimeout(function(){ cw = dojo.hitch(dojo, "withGlobal")(window, "position", dojo, [clientWidth, false]); if(cw.x >= 0 || (cw.x < 0 && Math.round(root.clientWidth - cw.w - cw.x) == 0)){ if(abs1.offsetLeft == control.offsetLeft){ if(abs1.offsetTop == control.offsetTop){ resultNode.testResult = "EQUAL"; }else{ resultNode.testResult = "abs1.offsetTop="+abs1.offsetTop + " control.offsetTop="+control.offsetTop; } }else{ resultNode.testResult = "abs1.offsetLeft="+abs1.offsetLeft + " control.offsetLeft="+control.offsetLeft; } }else{ resultNode.testResult = "100% width element start/size=" + cw.x+'/'+cw.w + " frame client left/width="+root.clientLeft+'/'+root.clientWidth; } if(resultNode.resultReady){ resultNode.resultReady(); } }, 100); }, 100); } function genScrollingTestNodes(hScroll, vScroll, large){ document.write( '
 
' + '
  
' + ( large ? ( (hScroll ? '
 
' : '') + (hScroll ? '
 
' : '') + (vScroll ? '
 
' : '') ) : '' ) + ''); } function genScrollingTestBody(){ var options = window.location.search.substr(1).toLowerCase().split(/&/); options.dir = "ltr"; for(var i=0; i < options.length; i++){ var option = options[i]; switch(option){ case "ltr": case "rtl": options.dir = option; break; case"both": options.horz = 1; options.vert = 1; break; default: options[option] = 1; } } var html = document.getElementsByTagName("HTML")[0]; html.dir = options.dir; // the setTimeout in the onload allows the browser time to scroll the iframe to the previous position var scroll = options.large ? '' : 'scroll'; if(!options.horz){ html.style.overflowX = "hidden"; }else if(!isQuirks && !options.large){ html.style.overflowX = scroll; } if(!options.vert){ html.style.overflowY = "hidden"; }else if(!isQuirks && !options.large){ html.style.overflowY = scroll; } document.write(''); document.write('
'+(isQuirks?'quirks ':'strict ')+(options.horz?'horiz ':'')+(options.vert?'vert ':'')+(options.large?'scrolling ':'')+options.dir+'
'); genScrollingTestNodes(options.horz, options.vert, options.large); document.write(''); } if(!document.body){ frameElement.runScrollingTest = runScrollingTest; genScrollingTestBody(); }else{ document.write('
 
'); genScrollingTestNodes(); }