[Pkg-javascript-commits] [dojo] 14/27: Fix IE11 test_scroll failures. Trident is more like IE9+ than we would have guessed.

David Prévot taffit at moszumanska.debian.org
Sun Sep 14 16:23:05 UTC 2014


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

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

commit 3321e7053c273bab3f11f2e020c0588b830966ec
Author: mahays0 <mahays0 at gmail.com>
Date:   Thu Jun 19 12:02:05 2014 -0400

    Fix IE11 test_scroll failures.
    Trident is more like IE9+ than we would have guessed.
    
    Also disabling quirks and loose tests for IE9+.
    On IE9+, an <iframe> will always run with the doctype of the main
    document, regardless of what URL is loaded into the iframe.
    
    Fixes #18124, refs #17311.
    
    (cherry picked from commit a832214a342b6e03ad4a9b1669fae71c7938c44b)
    
    Conflicts:
    	window.js
---
 tests/window/test_scroll.html | 9 +++++++--
 window.js                     | 8 ++++----
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/tests/window/test_scroll.html b/tests/window/test_scroll.html
index 97447be..f059add 100644
--- a/tests/window/test_scroll.html
+++ b/tests/window/test_scroll.html
@@ -239,7 +239,7 @@
 					doh.f(domAttr.has(body,'_parent'));
 				}
 			]);
-                        array.forEach([	'8249',
+			array.forEach([	'8249',
 					'8284',
 					'absContent',
 					'fixedNode',
@@ -253,7 +253,12 @@
 					'tooBig',
 					'htmlPadding' ],
 				function(test){
-                        		array.forEach([	"_strict", "_quirks", "_loose_rtl", "_quirks_rtl" ],
+					// IE9+ don't support quirks (or loose?) mode <iframe>'s inside a strict document (or vice-versa).
+					// The <iframe> loads but it's actually running in strict mode.
+					// Therefore, it's pointless to run those tests
+					var modes = (has("ie") >= 9 || has("trident")) ? ["_strict"] :
+							["_strict", "_quirks", "_loose_rtl", "_quirks_rtl" ];
+					array.forEach(modes,
 						function(mode){
 							var	id = test+mode,
 								n, maxWidth, maxHeight, nodeWidth, nodeHeight, rAfterScroll, vAfterScroll, rBeforeScroll, vBeforeScroll;
diff --git a/window.js b/window.js
index 4bafc0b..a406c1e 100644
--- a/window.js
+++ b/window.js
@@ -171,9 +171,9 @@ window.scrollIntoView = function(/*DomNode*/ node, /*Object?*/ pos){
 
 			if(el == scrollRoot){
 				elPos.w = rootWidth; elPos.h = rootHeight;
-				if(scrollRoot == html && isIE && rtl){ elPos.x += scrollRoot.offsetWidth-elPos.w; } // IE workaround where scrollbar causes negative x
-				if(elPos.x < 0 || !isIE || isIE >= 9){ elPos.x = 0; } // older IE can have values > 0
-				if(elPos.y < 0 || !isIE || isIE >= 9){ elPos.y = 0; }
+				if(scrollRoot == html && (isIE || has("trident")) && rtl){ elPos.x += scrollRoot.offsetWidth-elPos.w; } // IE workaround where scrollbar causes negative x
+				if(elPos.x < 0 || !isIE || isIE >= 9 || has("trident")){ elPos.x = 0; } // older IE can have values > 0
+				if(elPos.y < 0 || !isIE || isIE >= 9 || has("trident")){ elPos.y = 0; }
 			}else{
 				var pb = geom.getPadBorderExtents(el);
 				elPos.w -= pb.w; elPos.h -= pb.h; elPos.x += pb.l; elPos.y += pb.t;
@@ -214,7 +214,7 @@ window.scrollIntoView = function(/*DomNode*/ node, /*Object?*/ pos){
 			var s, old;
 			if(r * l > 0 && (!!el.scrollLeft || el == scrollRoot || el.scrollWidth > el.offsetHeight)){
 				s = Math[l < 0? "max" : "min"](l, r);
-				if(rtl && ((isIE == 8 && !backCompat) || isIE >= 9)){ s = -s; }
+				if(rtl && ((isIE == 8 && !backCompat) || isIE >= 9 || has("trident"))){ s = -s; }
 				old = el.scrollLeft;
 				scrollElementBy(el, s, 0);
 				s = el.scrollLeft - old;

-- 
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