[Pkg-javascript-commits] [dojo] 22/32: Refs #12478. Backport [25689] to 1.6 to support IE 9/10.

David Prévot taffit at moszumanska.debian.org
Thu Aug 21 17:39:08 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag 1.6.2
in repository dojo.

commit 6df09c2a8a9530e5fa758190930eb0ba6cbdc9a1
Author: Douglas Hays <doughays at dojotoolkit.org>
Date:   Fri Jan 11 18:21:28 2013 +0000

    Refs #12478.  Backport [25689] to 1.6 to support IE 9/10.
    
    git-svn-id: http://svn.dojotoolkit.org/src/branches/1.6/dojo@30337 560b804f-0ae3-0310-86f3-f6aa0a117693
---
 tests/_base/html.html          |  2 +-
 tests/_base/html_rtl.html      | 27 ++++++++++++++++++++-------
 tests/_base/scrollingIframe.js | 11 +++++------
 3 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/tests/_base/html.html b/tests/_base/html.html
index 09ab901..7352947 100644
--- a/tests/_base/html.html
+++ b/tests/_base/html.html
@@ -602,7 +602,7 @@
 						var id = "scrolling" + doctype + "Iframe" + scroll;
 						doh.register(id, {
 							name: "test_" + id,
-							timeout: 3000,
+							timeout: 4000,
 							runTest: function(t){
 								var d = new doh.Deferred(),
 									s = document.createElement('SPAN');
diff --git a/tests/_base/html_rtl.html b/tests/_base/html_rtl.html
index e5d3214..79a2c6c 100644
--- a/tests/_base/html_rtl.html
+++ b/tests/_base/html_rtl.html
@@ -42,16 +42,16 @@
 								var
 								d = new doh.Deferred(),
 								rect = dojo.byId("rect100"),
-								handler = dojo.connect(dojo.body(), "onclick", null,
+								handler = dojo.connect(rect.offsetParent, "onclick", null,
 									function(e){
 										// move the rectangle to the mouse point
 										dojo.disconnect(handler);
 										rect.style.left = e.pageX + "px";
 										rect.style.top = e.pageY + "px";
 										handler = dojo.connect(rect, 'ondblclick', null,
-											function(){
-												var offsetX = event.offsetX,
-													offsetY = event.offsetY;
+											function(e){
+												var offsetX = (event||e).offsetX,
+													offsetY = (event||e).offsetY;
 												dojo.disconnect(handler);
 												d.getTestCallback(function(){
 													t.is(0, offsetX);
@@ -59,11 +59,24 @@
 												})();
 											});
 										setTimeout(function(){
-											rect.fireEvent('ondblclick');
+											if(!document.createEvent){
+												rect.fireEvent('ondblclick');
+											}else{
+												var clickEvent = document.createEvent("MouseEvent");
+												clickEvent.initMouseEvent("dblclick", true, true, window, 0,0,0,0,0,0,0,0,0,0,null);
+												rect.dispatchEvent(clickEvent);
+											}
 										}, 100); // time to move rect to cursor position
 									});
 								setTimeout(function(){
-									dojo.body().fireEvent('onclick');
+									if(!document.createEvent){
+										rect.offsetParent.fireEvent('onclick');
+									}else{
+										var clickEvent = document.createEvent("MouseEvent");
+										clickEvent.initMouseEvent("click", true, true, window, 0,0,0,0,0,0,0,0,0,0,null);
+										rect.offsetParent.dispatchEvent(clickEvent);
+									}
+
 								}, 100); // time to finish any pre-scrolling
 								return d;
 							}
@@ -92,7 +105,7 @@
 							var id = "scrolling" + doctype + "Iframe" + scroll + size;
 							doh.register(id, {
 								name: "test_" + id,
-								timeout: 3000,
+								timeout: 4000,
 								runTest: function(t){
 									var d = new doh.Deferred(),
 										s = document.createElement('SPAN');
diff --git a/tests/_base/scrollingIframe.js b/tests/_base/scrollingIframe.js
index 8a2cac8..7882e28 100644
--- a/tests/_base/scrollingIframe.js
+++ b/tests/_base/scrollingIframe.js
@@ -9,7 +9,6 @@ function runScrollingTest(resultNode){
 		dojo = win.dojo;
 	}
 	var isLtr = dojo.hitch(dojo, "withGlobal")(window, "_isBodyLtr", dojo, []);
-	document.getElementById("mode").innerHTML = (isQuirks ? "quirks " : "strict ") + (isLtr ? "ltr" : "rtl");
 	var root = isQuirks? document.body : document.documentElement;
 	var control = document.getElementById("control");
 	var clientWidth = document.getElementById("clientWidth");
@@ -25,7 +24,7 @@ function runScrollingTest(resultNode){
 		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 && root.clientWidth - cw.w == cw.x)){
+			if(cw.x >= 0 || (cw.x < 0 && root.clientWidth - cw.w == cw.x)){
 				if(abs1.offsetLeft == control.offsetLeft){
 					if(abs1.offsetTop == control.offsetTop){
 						resultNode.testResult = "EQUAL";
@@ -36,7 +35,7 @@ function runScrollingTest(resultNode){
 					resultNode.testResult = "abs1.offsetLeft="+abs1.offsetLeft + " control.offsetLeft="+control.offsetLeft;
 				}
 			}else{
-				resultNode.testResult = "100% width element start/size=" + cw.x+'/'+cw.w + " frame client width="+root.clientWidth;
+				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);
@@ -45,9 +44,7 @@ function runScrollingTest(resultNode){
 
 function genScrollingTestNodes(hScroll, vScroll, large){
 	document.write(
-		'<DIV id="clientWidth" style="background-color:black;"> </DIV>' +
 		'<DIV id="abs1" style="position:absolute;background-color:red;left:0;top:0;width:1em;font-family:monospace;font-size:16px;"> </DIV>' +
-		'<CENTER id="mode"></CENTER>' +
 		'<DIV id="control" style="width:2em;height:2em;font-family:monospace;font-size:16px;background-color:cyan;margin:0 1em;border:0;padding:0;">  </DIV>' +
 		( large
 			? (
@@ -91,7 +88,8 @@ function genScrollingTestBody(){
 	}else if(!isQuirks && !options.large){
 		html.style.overflowY = scroll;
 	}
-	document.write('<BODY style="position:relative;margin:0;padding:0;border:0;background-color:white;overflow-x:' + (options.horz ? (isQuirks ? scroll : '') : 'hidden') + ';overflow-y:' + (isQuirks ? (options.vert ? scroll : 'hidden') : '') + ';">');
+	document.write('<BODY style="height:100%;margin:0;padding:0;border:0;background-color:white;overflow-x:' + (options.horz ? (isQuirks ? scroll : '') : 'hidden') + ';overflow-y:' + (isQuirks ? (options.vert ? scroll : 'hidden') : '') + ';">');
+	document.write('<DIV id="clientWidth"><CENTER>'+(isQuirks?'quirks ':'strict ')+(options.horz?'horiz ':'')+(options.vert?'vert ':'')+(options.large?'scrolling ':'')+options.dir+'</CENTER></DIV>');
 	genScrollingTestNodes(options.horz, options.vert, options.large);
 	document.write('</BODY>');
 }
@@ -100,5 +98,6 @@ if(!document.body){
 	frameElement.runScrollingTest = runScrollingTest;
 	genScrollingTestBody();
 }else{
+	document.write('<DIV id="clientWidth" style="background-color:transparent;"> </DIV>');
 	genScrollingTestNodes();
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git



More information about the Pkg-javascript-commits mailing list