Skip to content
Permalink
Browse files

Refactored jQuery.find() such that jQuery.nodeName() is used to test …

…the node names like .filter() and other functions do. This puts in place possible fixes for tickets like #1991 where XML and HTML differ in case-sensitivity.
  • Loading branch information
davids549 committed Dec 5, 2007
1 parent 1be5582 commit 2da897db844ddb4adfb73c4306976f1ac6525f9e
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/selector.js
@@ -122,12 +122,12 @@ jQuery.extend({
var m = re.exec(t);

if ( m ) {
var nodeName = m[1].toUpperCase();
var nodeName = m[1];

// Perform our own iteration and filter
for ( var i = 0; ret[i]; i++ )
for ( var c = ret[i].firstChild; c; c = c.nextSibling )
if ( c.nodeType == 1 && (nodeName == "*" || c.nodeName.toUpperCase() == nodeName.toUpperCase()) )
if ( c.nodeType == 1 && (nodeName == "*" || jQuery.nodeName(c, nodeName)) )
r.push( c );

ret = r;
@@ -151,7 +151,7 @@ jQuery.extend({

if ( m == "~" && merge[id] ) break;

if (!nodeName || n.nodeName.toUpperCase() == nodeName.toUpperCase() ) {
if (!nodeName || jQuery.nodeName(n, nodeName)) {
if ( m == "~" ) merge[id] = true;
r.push( n );
}

0 comments on commit 2da897d

Please sign in to comment.
You can’t perform that action at this time.