git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed a missing semicolon. Fixes jQuery bug #3927.
[jquery.git]
/
src
/
selector.js
diff --git
a/src/selector.js
b/src/selector.js
index
682a92e
..
6b68cb2
100644
(file)
--- a/
src/selector.js
+++ b/
src/selector.js
@@
-6,7
+6,7
@@
*/
(function(){
*/
(function(){
-var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|[^[\]]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]+['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,
done = 0,
toString = Object.prototype.toString;
done = 0,
toString = Object.prototype.toString;
@@
-332,11
+332,12
@@
var Expr = Sizzle.selectors = {
CLASS: function(match, curLoop, inplace, result, not){
match = " " + match[1].replace(/\\/g, "") + " ";
CLASS: function(match, curLoop, inplace, result, not){
match = " " + match[1].replace(/\\/g, "") + " ";
- for ( var i = 0; curLoop[i] != null; i++ ) {
- if ( curLoop[i] ) {
- if ( not ^ (" " + curLoop[i].className + " ").indexOf(match) >= 0 ) {
+ var elem;
+ for ( var i = 0; (elem = curLoop[i]) != null; i++ ) {
+ if ( elem ) {
+ if ( not ^ (" " + elem.className + " ").indexOf(match) >= 0 ) {
if ( !inplace )
if ( !inplace )
- result.push( curLoop[i] );
+ result.push( elem );
} else if ( inplace ) {
curLoop[i] = false;
}
} else if ( inplace ) {
curLoop[i] = false;
}
@@
-700,7
+701,7
@@
try {
// Check to see if an attribute returns normalized href attributes
div.innerHTML = "<a href='#'></a>";
// Check to see if an attribute returns normalized href attributes
div.innerHTML = "<a href='#'></a>";
- if ( div.firstChild.getAttribute("href") !== "#" ) {
+ if ( div.firstChild && div.firstChild.getAttribute("href") !== "#" ) {
Expr.attrHandle.href = function(elem){
return elem.getAttribute("href", 2);
};
Expr.attrHandle.href = function(elem){
return elem.getAttribute("href", 2);
};
@@
-809,8
+810,8
@@
var contains = document.compareDocumentPosition ? function(a, b){
};
var isXML = function(elem){
};
var isXML = function(elem){
- return elem.documentElement && !elem.body ||
- elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;
+ return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
+ !!elem.ownerDocument && isXML( elem.ownerDocument );
};
var posProcess = function(selector, context){
};
var posProcess = function(selector, context){
@@
-831,7
+832,7
@@
var posProcess = function(selector, context){
}
return Sizzle.filter( later, tmpSet );
}
return Sizzle.filter( later, tmpSet );
-}
+};
// EXPOSE
jQuery.find = Sizzle;
// EXPOSE
jQuery.find = Sizzle;