[Pkg-javascript-commits] [dojo] 57/87: Separate union combinators in rooted queries, fixes #15538 !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 f8d94e9d91bc1fa3fd12f6fc1bd5c39350f19937
Author: Colin Snover <github.com at zetafleet.com>
Date:   Fri Nov 23 22:10:24 2012 +0000

    Separate union combinators in rooted queries, fixes #15538 !strict Backport to 1.7.
    
    git-svn-id: http://svn.dojotoolkit.org/src/branches/1.7/dojo@30032 560b804f-0ae3-0310-86f3-f6aa0a117693
---
 selector/lite.js | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/selector/lite.js b/selector/lite.js
index 8228828..e9d1b5e 100644
--- a/selector/lite.js
+++ b/selector/lite.js
@@ -89,10 +89,10 @@ var liteEngine = function(selector, root){
 var useRoot = function(context, query, method){
 	// this function creates a temporary id so we can do rooted qSA queries, this is taken from sizzle
 	var oldContext = context,
-		old = context.getAttribute( "id" ),
+		old = context.getAttribute("id"),
 		nid = old || "__dojo__",
 		hasParent = context.parentNode,
-		relativeHierarchySelector = /^\s*[+~]/.test( query );
+		relativeHierarchySelector = /^\s*[+~]/.test(query);
 
 	if(relativeHierarchySelector && !hasParent){
 		return [];
@@ -106,11 +106,17 @@ var useRoot = function(context, query, method){
 		context = context.parentNode;
 	}
 
-	try {
-		return method.call(context, "[id='" + nid + "'] " + query );
-	} finally {
-		if ( !old ) {
-			oldContext.removeAttribute( "id" );
+	var selectors = query.split(/\s*,\s*/);
+	for(var i = 0; i < selectors.length; i++){
+		selectors[i] = "[id='" + nid + "'] " + selectors[i];
+	}
+	query = selectors.join(",");
+
+	try{
+		return method.call(context, query);
+	}finally{
+		if(!old){
+			oldContext.removeAttribute("id");
 		}
 	}
 };

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