[Pkg-javascript-commits] [dojo] 24/41: Minimal fix for alleged error where getIeDocumentElementOffset() is called but not defined. Fixes #18717.

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


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

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

commit 0aa20f7df1048587eae5b316d8861a33900f637b
Author: Bill Keese <bill at dojotoolkit.org>
Date:   Thu Oct 8 09:09:30 2015 +0900

    Minimal fix for alleged error where getIeDocumentElementOffset() is called but not defined.
    Fixes #18717.
    
    (cherry picked from commit a7a5646855dfe5b25f6b0c1e1c447a9b7342c110)
---
 dom-geometry.js | 84 ++++++++++++++++++++++++++++-----------------------------
 1 file changed, 41 insertions(+), 43 deletions(-)

diff --git a/dom-geometry.js b/dom-geometry.js
index 3016c4e..39f4ac7 100644
--- a/dom-geometry.js
+++ b/dom-geometry.js
@@ -431,50 +431,48 @@ define(["./sniff", "./_base/window","./dom", "./dom-style"],
 				{x: geom.fixIeBiDiScrollLeft(node.scrollLeft || 0, doc), y: node.scrollTop || 0 };
 	};
 
-	if(has("ie")){
-		geom.getIeDocumentElementOffset = function getIeDocumentElementOffset(/*Document?*/ doc){
-			// summary:
-			//		returns the offset in x and y from the document body to the
-			//		visual edge of the page for IE
-			// doc: Document?
-			//		Optional document to query.   If unspecified, use win.doc.
-			// description:
-			//		The following values in IE contain an offset:
-			//	|		event.clientX
-			//	|		event.clientY
-			//	|		node.getBoundingClientRect().left
-			//	|		node.getBoundingClientRect().top
-			//		But other position related values do not contain this offset,
-			//		such as node.offsetLeft, node.offsetTop, node.style.left and
-			//		node.style.top. The offset is always (2, 2) in LTR direction.
-			//		When the body is in RTL direction, the offset counts the width
-			//		of left scroll bar's width.  This function computes the actual
-			//		offset.
-
-			//NOTE: assumes we're being called in an IE browser
-
-			doc = doc || win.doc;
-			var de = doc.documentElement; // only deal with HTML element here, position() handles body/quirks
-
-			if(has("ie") < 8){
-				var r = de.getBoundingClientRect(), // works well for IE6+
-					l = r.left, t = r.top;
-				if(has("ie") < 7){
-					l += de.clientLeft;	// scrollbar size in strict/RTL, or,
-					t += de.clientTop;	// HTML border size in strict
-				}
-				return {
-					x: l < 0 ? 0 : l, // FRAME element border size can lead to inaccurate negative values
-					y: t < 0 ? 0 : t
-				};
-			}else{
-				return {
-					x: 0,
-					y: 0
-				};
+	geom.getIeDocumentElementOffset = function getIeDocumentElementOffset(/*Document?*/ doc){
+		// summary:
+		//		returns the offset in x and y from the document body to the
+		//		visual edge of the page for IE
+		// doc: Document?
+		//		Optional document to query.   If unspecified, use win.doc.
+		// description:
+		//		The following values in IE contain an offset:
+		//	|		event.clientX
+		//	|		event.clientY
+		//	|		node.getBoundingClientRect().left
+		//	|		node.getBoundingClientRect().top
+		//		But other position related values do not contain this offset,
+		//		such as node.offsetLeft, node.offsetTop, node.style.left and
+		//		node.style.top. The offset is always (2, 2) in LTR direction.
+		//		When the body is in RTL direction, the offset counts the width
+		//		of left scroll bar's width.  This function computes the actual
+		//		offset.
+
+		//NOTE: assumes we're being called in an IE browser
+
+		doc = doc || win.doc;
+		var de = doc.documentElement; // only deal with HTML element here, position() handles body/quirks
+
+		if(has("ie") < 8){
+			var r = de.getBoundingClientRect(), // works well for IE6+
+				l = r.left, t = r.top;
+			if(has("ie") < 7){
+				l += de.clientLeft;	// scrollbar size in strict/RTL, or,
+				t += de.clientTop;	// HTML border size in strict
 			}
-		};
-	}
+			return {
+				x: l < 0 ? 0 : l, // FRAME element border size can lead to inaccurate negative values
+				y: t < 0 ? 0 : t
+			};
+		}else{
+			return {
+				x: 0,
+				y: 0
+			};
+		}
+	};
 
 	geom.fixIeBiDiScrollLeft = function fixIeBiDiScrollLeft(/*Integer*/ scrollLeft, /*Document?*/ doc){
 		// summary:

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