[Pkg-javascript-commits] [dojo] 06/17: Fix scrollIntoView() regressions on IE8 in quirks/RTL mode.

David Prévot taffit at moszumanska.debian.org
Thu Mar 24 04:28:31 UTC 2016


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

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

commit 15e3d45ed3f66c8e06dd43649628b09ed6e9e40a
Author: Bill Keese <bill at dojotoolkit.org>
Date:   Mon Oct 5 17:51:14 2015 +0900

    Fix scrollIntoView() regressions on IE8 in quirks/RTL mode.
    
    Fixes #18726 on 1.7 branch.  Refs #18124.
    
    (cherry picked from commit 6ddef724689b5b81af979b96632fed6029324709)
---
 tests/window/test_scroll.html |  9 +++++----
 window.js                     | 10 ++++++----
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/tests/window/test_scroll.html b/tests/window/test_scroll.html
index f059add..4c4f55d 100644
--- a/tests/window/test_scroll.html
+++ b/tests/window/test_scroll.html
@@ -253,10 +253,11 @@
 					'tooBig',
 					'htmlPadding' ],
 				function(test){
-					// 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"] :
+					// IE9+ doesn'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, skip those tests.
+					// Also disabling quirks and loose tests on Edge, since it doesn't support document modes at all,
+					// and those tests get failures.
+					var modes = (has("trident") >= 5 || has("edge")) ? ["_strict"] :
 							["_strict", "_quirks", "_loose_rtl", "_quirks_rtl" ];
 					array.forEach(modes,
 						function(mode){
diff --git a/window.js b/window.js
index e3828e6..a76f9ec 100644
--- a/window.js
+++ b/window.js
@@ -171,9 +171,11 @@ window.scrollIntoView = function(/*DomNode*/ node, /*Object?*/ pos){
 
 			if(el == scrollRoot){
 				elPos.w = rootWidth; elPos.h = rootHeight;
-				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; }
+				if(scrollRoot == html && (isIE || has("trident")) && rtl) {
+					elPos.x += scrollRoot.offsetWidth - elPos.w; // IE workaround where scrollbar causes negative x
+				}
+				elPos.x = 0;
+				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 +216,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 || has("trident"))){ s = -s; }
+				if(rtl && ((isIE == 8 && !backCompat) || has("trident") >= 5 || has("edge"))){ 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