[Pkg-javascript-commits] [dojo] 127/149: fixes #18321, better test for nextElementSibling

David Prévot taffit at moszumanska.debian.org
Sat Feb 27 03:13:55 UTC 2016


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

taffit pushed a commit to branch master
in repository dojo.

commit 4d04e73d8fd09c363b16d805a16117a2d07e4d58
Author: Dylan Schiemann <dylan at dojotoolkit.org>
Date:   Tue Jan 5 04:28:36 2016 -0700

    fixes #18321, better test for nextElementSibling
---
 selector/acme.js | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/selector/acme.js b/selector/acme.js
index 43a3b7a..0a64bed 100644
--- a/selector/acme.js
+++ b/selector/acme.js
@@ -498,7 +498,11 @@ define([
 
 	// avoid testing for node type if we can. Defining this in the negative
 	// here to avoid negation in the fast path.
-	var _noNES = (typeof getDoc().firstChild.nextElementSibling == "undefined");
+	// NOTE: Firefox versions 25-27 implemented an incompatible change
+	// to the spec, https://bugzilla.mozilla.org/show_bug.cgi?id=932501
+	// and https://www.w3.org/Bugs/Public/show_bug.cgi?id=23691 ,
+	// where nextElementSibling was implemented on the DocumentType
+	var _noNES = "nextElementSibling" in getDoc().documentElement;
 	var _ns = !_noNES ? "nextElementSibling" : "nextSibling";
 	var _ps = !_noNES ? "previousElementSibling" : "previousSibling";
 	var _simpleNodeTest = (_noNES ? _isElement : yesman);
@@ -1163,7 +1167,7 @@ define([
 	var infixSpaceFunc = function(match, pre, ch, post){
 		return ch ? (pre ? pre + " " : "") + ch + (post ? " " + post : "") : /*n+3*/ match;
 	};
-	
+
 	//Don't apply the infixSpaceRe to attribute value selectors
 	var attRe = /([^[]*)([^\]]*])?/g;
 	var attFunc = function(match, nonAtt, att){
@@ -1459,7 +1463,7 @@ define([
 		//	|	require(["dojo/query"], function(query) {
 		//	|	    query(".foo.bar").forEach(function(q) { console.log(q); });
 		//	|	});
-		
+
 		//		these elements will match:
 		//	|	<span class="foo bar"></span>
 		//		while these will not:
@@ -1481,7 +1485,7 @@ define([
 		//		set an "odd" class on all odd table rows inside of the table
 		//		`#tabular_data`, using the `>` (direct child) selector to avoid
 		//		affecting any nested tables:
-		//	|	require(["dojo/query"], function(query) {    
+		//	|	require(["dojo/query"], function(query) {
 		//	|	    query("#tabular_data > tbody > tr:nth-child(odd)").addClass("odd");
 		//	|	);
 		// example:

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