[Pkg-javascript-commits] [dojo] 60/87: Redo logic for detecting if document is case sensitive a.k.a. an XML document, according to advice from gsnedders, thanks! Fixes #10320 !strict. Backport to 1.7

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


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

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

commit 113b0ea47449c1d1a9ce897acb27017783cc8be7
Author: Colin Snover <github.com at zetafleet.com>
Date:   Fri Nov 23 23:00:06 2012 +0000

    Redo logic for detecting if document is case sensitive a.k.a. an XML document, according to advice from gsnedders, thanks! Fixes #10320 !strict. Backport to 1.7
    
    git-svn-id: http://svn.dojotoolkit.org/src/branches/1.7/dojo@30035 560b804f-0ae3-0310-86f3-f6aa0a117693
---
 selector/acme.js | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/selector/acme.js b/selector/acme.js
index 9235166..80d1a4f 100644
--- a/selector/acme.js
+++ b/selector/acme.js
@@ -276,7 +276,7 @@ define(["../_base/kernel", "../has", "../dom", "../_base/sniff", "../_base/array
 					oper: null, // ...or operator per component. Note that these wind up being exclusive.
 					id: null,	// the id component of a rule
 					getTag: function(){
-						return (caseSensitive) ? this.otag : this.tag;
+						return caseSensitive ? this.otag : this.tag;
 					}
 				};
 
@@ -1454,18 +1454,12 @@ define(["../_base/kernel", "../has", "../dom", "../_base/sniff", "../_base/array
 		//	|		});
 		//	|	});
 
-		root = root||getDoc();
-		var od = root.ownerDocument||root.documentElement;
+		root = root || getDoc();
 
 		// throw the big case sensitivity switch
 
-		// NOTE:
-		//		Opera in XHTML mode doesn't detect case-sensitivity correctly
-		//		and it's not clear that there's any way to test for it
-		caseSensitive = (root.contentType && root.contentType=="application/xml") ||
-						(dojo.isOpera && (root.doctype || od.toString() == "[object XMLDocument]")) ||
-						(!!od) &&
-				(dojo.isIE ? od.xml : (root.xmlVersion || od.xmlVersion));
+		var od = root.ownerDocument || root;	// root is either Document or a node inside the document
+		caseSensitive = (od.createElement("div").tagName === "div");
 
 		// NOTE:
 		//		adding "true" as the 2nd argument to getQueryFunc is useful for

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