Skip to content
Browse files

Manage bower dependencies with grunt-bowercopy

Tracked bower dependencies are located at "src/sizzle" and "test/libs".
The source-destination mapping is in the Gruntfile.

When updating a bower dependency, update the version in bower.json, run
`grunt bower`, and then commit the result. When adding a dependency,
update the bowercopy task accordingly.

Fixes #14615.
Closes gh-1452.
  • Loading branch information...
1 parent ed20e7c commit f9ad13c9ec8967916427642db2883a1bf3bccd86 @timmywil timmywil committed
View
7 .gitignore
@@ -1,4 +1,4 @@
-dist
+/dist
.project
.settings
*~
@@ -6,9 +6,8 @@ dist
*.patch
/*.html
.DS_Store
+.bower.json
+.sizecache.json
dist/.destination.json
-dist/.sizecache.json
-build/.sizecache.json
bower_components
-bower_modules
node_modules
View
2 .jscs.json
@@ -19,5 +19,5 @@
"disallowKeywordsOnNewLine": [ "else" ],
"requireLineFeedAtFileEnd": true,
- "excludeFiles": [ "src/intro.js", "src/outro.js" ]
+ "excludeFiles": [ "src/intro.js", "src/outro.js", "src/sizzle/**/*" ]
}
View
3 .jshintignore
@@ -1,7 +1,8 @@
src/intro.js
src/outro.js
+src/sizzle/**/*
+test/libs/**/*
test/data/jquery-1.9.1.js
-bower_modules
test/data/badcall.js
test/data/badjson.js
test/data/json_obj.js
View
27 Gruntfile.js
@@ -10,7 +10,6 @@ module.exports = function( grunt ) {
}
var gzip = require( "gzip-js" ),
- path = require( "path" ),
srcHintOptions = readOptionalJSON( "src/.jshintrc" );
// The concatenated file won't pass onevar
@@ -47,14 +46,23 @@ module.exports = function( grunt ) {
}
}
},
- bower: {
- install: {
+ bowercopy: {
+ options: {
+ clean: true
+ },
+ src: {
+ files: {
+ "src/sizzle": "sizzle"
+ }
+ },
+ tests: {
options: {
- targetDir: "bower_modules",
- cleanup: true,
- layout: function( type ) {
- return path.join( type );
- }
+ destPrefix: "test/libs"
+ },
+ files: {
+ "qunit": "qunit/qunit",
+ "require.js": "requirejs/require.js",
+ "sinon/fake_timers.js": "sinon/lib/sinon/util/fake_timers.js"
}
}
},
@@ -139,6 +147,9 @@ module.exports = function( grunt ) {
// Integrate jQuery specific tasks
grunt.loadTasks( "build/tasks" );
+ // Alias bower to bowercopy
+ grunt.registerTask( "bower", "bowercopy" );
+
// Short list as a high frequency watch task
grunt.registerTask( "dev", [ "build:*:*", "jshint", "jscs" ] );
View
15 bower.json
@@ -20,21 +20,6 @@
"qunit": "~1.12.0",
"sinon": "~1.7.3"
},
- "exportsOverride": {
- "sizzle": {
- "sizzle": "."
- },
-
- "requirejs": {
- "requirejs": "require.js"
- },
- "qunit": {
- "qunit": "qunit"
- },
- "sinon": {
- "sinon": "**/*.js"
- }
- },
"keywords": [
"jquery",
"javascript",
View
17 build/release.js
@@ -18,8 +18,6 @@ var releaseVersion,
pkg,
branch,
- sizzleLoc = "bower_modules/sizzle",
-
scpURL = "jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/",
cdnURL = "http://code.origin.jquery.com/",
repoURL = "git@github.com:jquery/jquery.git",
@@ -103,9 +101,6 @@ function initialize( next ) {
if ( !exists( "package.json" ) ) {
die( "No package.json in this directory" );
}
- if ( !exists( sizzleLoc ) ) {
- die( "Sizzle expected to exist at " + sizzleLoc );
- }
pkg = readJSON( "package.json" );
console.log( "Current version is " + pkg.version + "; generating release " + releaseVersion );
@@ -309,15 +304,9 @@ function commitDistFiles( next ) {
// Add files to be committed
git( [ "add", "package.json" ], function() {
git( [ "commit", "-m", "Remove scripts property from package.json" ], function() {
- // Add sizzle in a separate commit to avoid a big diff
- // Use force to add normally ignored files
- git( [ "add", "-f", sizzleLoc ], function() {
- git( [ "commit", "-m", "Add sizzle" ], function() {
- // Add jquery files for distribution in a final commit
- git( [ "add", "-f", devFile, minFile, mapFile ], function() {
- git( [ "commit", "-m", releaseVersion ], next, debug );
- }, debug );
- }, debug );
+ // Add jquery files for distribution in a final commit
+ git( [ "add", "-f", devFile, minFile, mapFile ], function() {
+ git( [ "commit", "-m", releaseVersion ], next, debug );
}, debug );
}, debug );
}, debug );
View
2 build/tasks/build.js
@@ -26,7 +26,7 @@ module.exports = function( grunt ) {
endFile: "src/outro.js"
},
paths: {
- sizzle: "../bower_modules/sizzle/dist/sizzle"
+ sizzle: "sizzle/dist/sizzle"
},
rawText: {},
onBuildWrite: convert
View
5 package.json
@@ -31,7 +31,7 @@
"devDependencies": {
"archiver": "~0.4.10",
"grunt": "~0.4.1",
- "grunt-bower-task": "~0.3.2",
+ "grunt-bowercopy": "~0.4.1",
"grunt-cli": "~0.1.11",
"grunt-compare-size": "~0.4.0",
"grunt-contrib-jshint": "~0.7.0",
@@ -48,9 +48,6 @@
},
"scripts": {
"build": "npm install && grunt",
-
- "install": "grunt bower",
-
"start": "grunt watch",
"test": "grunt"
}
View
2,013 src/sizzle/dist/sizzle.js
2,013 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
3 src/sizzle/dist/sizzle.min.js
@@ -0,0 +1,3 @@
+/*! Sizzle v1.10.14 | (c) 2013 jQuery Foundation, Inc. | jquery.org/license */
+!function(a){function b(a,b,c,d){var e,f,g,h,i,j,l,o,p,q;if((b?b.ownerDocument||b:P)!==H&&G(b),b=b||H,c=c||[],!a||"string"!=typeof a)return c;if(1!==(h=b.nodeType)&&9!==h)return[];if(J&&!d){if(e=tb.exec(a))if(g=e[1]){if(9===h){if(f=b.getElementById(g),!f||!f.parentNode)return c;if(f.id===g)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(g))&&N(b,f)&&f.id===g)return c.push(f),c}else{if(e[2])return ab.apply(c,b.getElementsByTagName(a)),c;if((g=e[3])&&x.getElementsByClassName&&b.getElementsByClassName)return ab.apply(c,b.getElementsByClassName(g)),c}if(x.qsa&&(!K||!K.test(a))){if(o=l=O,p=b,q=9===h&&a,1===h&&"object"!==b.nodeName.toLowerCase()){for(j=m(a),(l=b.getAttribute("id"))?o=l.replace(vb,"\\$&"):b.setAttribute("id",o),o="[id='"+o+"'] ",i=j.length;i--;)j[i]=o+n(j[i]);p=ub.test(a)&&k(b.parentNode)||b,q=j.join(",")}if(q)try{return ab.apply(c,p.querySelectorAll(q)),c}catch(r){}finally{l||b.removeAttribute("id")}}}return v(a.replace(jb,"$1"),b,c,d)}function c(){function a(c,d){return b.push(c+" ")>z.cacheLength&&delete a[b.shift()],a[c+" "]=d}var b=[];return a}function d(a){return a[O]=!0,a}function e(a){var b=H.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function f(a,b){for(var c=a.split("|"),d=a.length;d--;)z.attrHandle[c[d]]=b}function g(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||X)-(~a.sourceIndex||X);if(d)return d;if(c)for(;c=c.nextSibling;)if(c===b)return-1;return a?1:-1}function h(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function i(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function j(a){return d(function(b){return b=+b,d(function(c,d){for(var e,f=a([],c.length,b),g=f.length;g--;)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function k(a){return a&&typeof a.getElementsByTagName!==W&&a}function l(){}function m(a,c){var d,e,f,g,h,i,j,k=T[a+" "];if(k)return c?0:k.slice(0);for(h=a,i=[],j=z.preFilter;h;){(!d||(e=kb.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),d=!1,(e=lb.exec(h))&&(d=e.shift(),f.push({value:d,type:e[0].replace(jb," ")}),h=h.slice(d.length));for(g in z.filter)!(e=pb[g].exec(h))||j[g]&&!(e=j[g](e))||(d=e.shift(),f.push({value:d,type:g,matches:e}),h=h.slice(d.length));if(!d)break}return c?h.length:h?b.error(a):T(a,i).slice(0)}function n(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function o(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=R++;return b.first?function(b,c,f){for(;b=b[d];)if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=Q+" "+f;if(g){for(;b=b[d];)if((1===b.nodeType||e)&&a(b,c,g))return!0}else for(;b=b[d];)if(1===b.nodeType||e)if(j=b[O]||(b[O]={}),(i=j[d])&&i[0]===k){if((h=i[1])===!0||h===y)return h===!0}else if(i=j[d]=[k],i[1]=a(b,c,g)||y,i[1]===!0)return!0}}function p(a){return a.length>1?function(b,c,d){for(var e=a.length;e--;)if(!a[e](b,c,d))return!1;return!0}:a[0]}function q(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function r(a,b,c,e,f,g){return e&&!e[O]&&(e=r(e)),f&&!f[O]&&(f=r(f,g)),d(function(d,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=d||u(b||"*",h.nodeType?[h]:h,[]),r=!a||!d&&b?p:q(p,m,a,h,i),s=c?f||(d?a:o||e)?[]:g:r;if(c&&c(r,s,h,i),e)for(j=q(s,n),e(j,[],h,i),k=j.length;k--;)(l=j[k])&&(s[n[k]]=!(r[n[k]]=l));if(d){if(f||a){if(f){for(j=[],k=s.length;k--;)(l=s[k])&&j.push(r[k]=l);f(null,s=[],j,i)}for(k=s.length;k--;)(l=s[k])&&(j=f?cb.call(d,l):m[k])>-1&&(d[j]=!(g[j]=l))}}else s=q(s===g?s.splice(o,s.length):s),f?f(null,g,s,i):ab.apply(g,s)})}function s(a){for(var b,c,d,e=a.length,f=z.relative[a[0].type],g=f||z.relative[" "],h=f?1:0,i=o(function(a){return a===b},g,!0),j=o(function(a){return cb.call(b,a)>-1},g,!0),k=[function(a,c,d){return!f&&(d||c!==D)||((b=c).nodeType?i(a,c,d):j(a,c,d))}];e>h;h++)if(c=z.relative[a[h].type])k=[o(p(k),c)];else{if(c=z.filter[a[h].type].apply(null,a[h].matches),c[O]){for(d=++h;e>d&&!z.relative[a[d].type];d++);return r(h>1&&p(k),h>1&&n(a.slice(0,h-1).concat({value:" "===a[h-2].type?"*":""})).replace(jb,"$1"),c,d>h&&s(a.slice(h,d)),e>d&&s(a=a.slice(d)),e>d&&n(a))}k.push(c)}return p(k)}function t(a,c){var e=0,f=c.length>0,g=a.length>0,h=function(d,h,i,j,k){var l,m,n,o=0,p="0",r=d&&[],s=[],t=D,u=d||g&&z.find.TAG("*",k),v=Q+=null==t?1:Math.random()||.1,w=u.length;for(k&&(D=h!==H&&h,y=e);p!==w&&null!=(l=u[p]);p++){if(g&&l){for(m=0;n=a[m++];)if(n(l,h,i)){j.push(l);break}k&&(Q=v,y=++e)}f&&((l=!n&&l)&&o--,d&&r.push(l))}if(o+=p,f&&p!==o){for(m=0;n=c[m++];)n(r,s,h,i);if(d){if(o>0)for(;p--;)r[p]||s[p]||(s[p]=$.call(j));s=q(s)}ab.apply(j,s),k&&!d&&s.length>0&&o+c.length>1&&b.uniqueSort(j)}return k&&(Q=v,D=t),r};return f?d(h):h}function u(a,c,d){for(var e=0,f=c.length;f>e;e++)b(a,c[e],d);return d}function v(a,b,c,d){var e,f,g,h,i,j=m(a);if(!d&&1===j.length){if(f=j[0]=j[0].slice(0),f.length>2&&"ID"===(g=f[0]).type&&x.getById&&9===b.nodeType&&J&&z.relative[f[1].type]){if(b=(z.find.ID(g.matches[0].replace(wb,xb),b)||[])[0],!b)return c;a=a.slice(f.shift().value.length)}for(e=pb.needsContext.test(a)?0:f.length;e--&&(g=f[e],!z.relative[h=g.type]);)if((i=z.find[h])&&(d=i(g.matches[0].replace(wb,xb),ub.test(f[0].type)&&k(b.parentNode)||b))){if(f.splice(e,1),a=d.length&&n(f),!a)return ab.apply(c,d),c;break}}return C(a,j)(d,b,!J,c,ub.test(a)&&k(b.parentNode)||b),c}var w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O="sizzle"+-new Date,P=a.document,Q=0,R=0,S=c(),T=c(),U=c(),V=function(a,b){return a===b&&(F=!0),0},W=typeof void 0,X=1<<31,Y={}.hasOwnProperty,Z=[],$=Z.pop,_=Z.push,ab=Z.push,bb=Z.slice,cb=Z.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},db="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",eb="[\\x20\\t\\r\\n\\f]",fb="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",gb=fb.replace("w","w#"),hb="\\["+eb+"*("+fb+")"+eb+"*(?:([*^$|!~]?=)"+eb+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+gb+")|)|)"+eb+"*\\]",ib=":("+fb+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+hb.replace(3,8)+")*)|.*)\\)|)",jb=new RegExp("^"+eb+"+|((?:^|[^\\\\])(?:\\\\.)*)"+eb+"+$","g"),kb=new RegExp("^"+eb+"*,"+eb+"*"),lb=new RegExp("^"+eb+"*([>+~]|"+eb+")"+eb+"*"),mb=new RegExp("="+eb+"*([^\\]'\"]*?)"+eb+"*\\]","g"),nb=new RegExp(ib),ob=new RegExp("^"+gb+"$"),pb={ID:new RegExp("^#("+fb+")"),CLASS:new RegExp("^\\.("+fb+")"),TAG:new RegExp("^("+fb.replace("w","w*")+")"),ATTR:new RegExp("^"+hb),PSEUDO:new RegExp("^"+ib),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+eb+"*(even|odd|(([+-]|)(\\d*)n|)"+eb+"*(?:([+-]|)"+eb+"*(\\d+)|))"+eb+"*\\)|)","i"),bool:new RegExp("^(?:"+db+")$","i"),needsContext:new RegExp("^"+eb+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+eb+"*((?:-\\d)?\\d*)"+eb+"*\\)|)(?=[^-]|$)","i")},qb=/^(?:input|select|textarea|button)$/i,rb=/^h\d$/i,sb=/^[^{]+\{\s*\[native \w/,tb=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ub=/[+~]/,vb=/'|\\/g,wb=new RegExp("\\\\([\\da-f]{1,6}"+eb+"?|("+eb+")|.)","ig"),xb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{ab.apply(Z=bb.call(P.childNodes),P.childNodes),Z[P.childNodes.length].nodeType}catch(yb){ab={apply:Z.length?function(a,b){_.apply(a,bb.call(b))}:function(a,b){for(var c=a.length,d=0;a[c++]=b[d++];);a.length=c-1}}}x=b.support={},B=b.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},G=b.setDocument=function(a){var b,c=a?a.ownerDocument||a:P,d=c.defaultView;return c!==H&&9===c.nodeType&&c.documentElement?(H=c,I=c.documentElement,J=!B(c),d&&d!==d.top&&(d.addEventListener?d.addEventListener("unload",function(){G()},!1):d.attachEvent&&d.attachEvent("onunload",function(){G()})),x.attributes=e(function(a){return a.className="i",!a.getAttribute("className")}),x.getElementsByTagName=e(function(a){return a.appendChild(c.createComment("")),!a.getElementsByTagName("*").length}),x.getElementsByClassName=sb.test(c.getElementsByClassName)&&e(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),x.getById=e(function(a){return I.appendChild(a).id=O,!c.getElementsByName||!c.getElementsByName(O).length}),x.getById?(z.find.ID=function(a,b){if(typeof b.getElementById!==W&&J){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},z.filter.ID=function(a){var b=a.replace(wb,xb);return function(a){return a.getAttribute("id")===b}}):(delete z.find.ID,z.filter.ID=function(a){var b=a.replace(wb,xb);return function(a){var c=typeof a.getAttributeNode!==W&&a.getAttributeNode("id");return c&&c.value===b}}),z.find.TAG=x.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==W?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){for(;c=f[e++];)1===c.nodeType&&d.push(c);return d}return f},z.find.CLASS=x.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==W&&J?b.getElementsByClassName(a):void 0},L=[],K=[],(x.qsa=sb.test(c.querySelectorAll))&&(e(function(a){a.innerHTML="<select><option selected=''></option></select>",a.querySelectorAll("[selected]").length||K.push("\\["+eb+"*(?:value|"+db+")"),a.querySelectorAll(":checked").length||K.push(":checked")}),e(function(a){var b=c.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("t",""),a.querySelectorAll("[t^='']").length&&K.push("[*^$]="+eb+"*(?:''|\"\")"),a.querySelectorAll(":enabled").length||K.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),K.push(",.*:")})),(x.matchesSelector=sb.test(M=I.webkitMatchesSelector||I.mozMatchesSelector||I.oMatchesSelector||I.msMatchesSelector))&&e(function(a){x.disconnectedMatch=M.call(a,"div"),M.call(a,"[s!='']:x"),L.push("!=",ib)}),K=K.length&&new RegExp(K.join("|")),L=L.length&&new RegExp(L.join("|")),b=sb.test(I.compareDocumentPosition),N=b||sb.test(I.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1},V=b?function(a,b){if(a===b)return F=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!x.sortDetached&&b.compareDocumentPosition(a)===d?a===c||a.ownerDocument===P&&N(P,a)?-1:b===c||b.ownerDocument===P&&N(P,b)?1:E?cb.call(E,a)-cb.call(E,b):0:4&d?-1:1)}:function(a,b){if(a===b)return F=!0,0;var d,e=0,f=a.parentNode,h=b.parentNode,i=[a],j=[b];if(!f||!h)return a===c?-1:b===c?1:f?-1:h?1:E?cb.call(E,a)-cb.call(E,b):0;if(f===h)return g(a,b);for(d=a;d=d.parentNode;)i.unshift(d);for(d=b;d=d.parentNode;)j.unshift(d);for(;i[e]===j[e];)e++;return e?g(i[e],j[e]):i[e]===P?-1:j[e]===P?1:0},c):H},b.matches=function(a,c){return b(a,null,null,c)},b.matchesSelector=function(a,c){if((a.ownerDocument||a)!==H&&G(a),c=c.replace(mb,"='$1']"),!(!x.matchesSelector||!J||L&&L.test(c)||K&&K.test(c)))try{var d=M.call(a,c);if(d||x.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return b(c,H,null,[a]).length>0},b.contains=function(a,b){return(a.ownerDocument||a)!==H&&G(a),N(a,b)},b.attr=function(a,b){(a.ownerDocument||a)!==H&&G(a);var c=z.attrHandle[b.toLowerCase()],d=c&&Y.call(z.attrHandle,b.toLowerCase())?c(a,b,!J):void 0;return void 0!==d?d:x.attributes||!J?a.getAttribute(b):(d=a.getAttributeNode(b))&&d.specified?d.value:null},b.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},b.uniqueSort=function(a){var b,c=[],d=0,e=0;if(F=!x.detectDuplicates,E=!x.sortStable&&a.slice(0),a.sort(V),F){for(;b=a[e++];)b===a[e]&&(d=c.push(e));for(;d--;)a.splice(c[d],1)}return E=null,a},A=b.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(1===e||9===e||11===e){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=A(a)}else if(3===e||4===e)return a.nodeValue}else for(;b=a[d++];)c+=A(b);return c},z=b.selectors={cacheLength:50,createPseudo:d,match:pb,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(wb,xb),a[3]=(a[4]||a[5]||"").replace(wb,xb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||b.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&b.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return pb.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&nb.test(c)&&(b=m(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(wb,xb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=S[a+" "];return b||(b=new RegExp("(^|"+eb+")"+a+"("+eb+"|$)"))&&S(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==W&&a.getAttribute("class")||"")})},ATTR:function(a,c,d){return function(e){var f=b.attr(e,a);return null==f?"!="===c:c?(f+="","="===c?f===d:"!="===c?f!==d:"^="===c?d&&0===f.indexOf(d):"*="===c?d&&f.indexOf(d)>-1:"$="===c?d&&f.slice(-d.length)===d:"~="===c?(" "+f+" ").indexOf(d)>-1:"|="===c?f===d||f.slice(0,d.length+1)===d+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){for(;p;){for(l=b;l=l[p];)if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){for(k=q[O]||(q[O]={}),j=k[a]||[],n=j[0]===Q&&j[1],m=j[0]===Q&&j[2],l=n&&q.childNodes[n];l=++n&&l&&l[p]||(m=n=0)||o.pop();)if(1===l.nodeType&&++m&&l===b){k[a]=[Q,n,m];break}}else if(s&&(j=(b[O]||(b[O]={}))[a])&&j[0]===Q)m=j[1];else for(;(l=++n&&l&&l[p]||(m=n=0)||o.pop())&&((h?l.nodeName.toLowerCase()!==r:1!==l.nodeType)||!++m||(s&&((l[O]||(l[O]={}))[a]=[Q,m]),l!==b)););return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,c){var e,f=z.pseudos[a]||z.setFilters[a.toLowerCase()]||b.error("unsupported pseudo: "+a);return f[O]?f(c):f.length>1?(e=[a,a,"",c],z.setFilters.hasOwnProperty(a.toLowerCase())?d(function(a,b){for(var d,e=f(a,c),g=e.length;g--;)d=cb.call(a,e[g]),a[d]=!(b[d]=e[g])}):function(a){return f(a,0,e)}):f}},pseudos:{not:d(function(a){var b=[],c=[],e=C(a.replace(jb,"$1"));return e[O]?d(function(a,b,c,d){for(var f,g=e(a,null,d,[]),h=a.length;h--;)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,d,f){return b[0]=a,e(b,null,f,c),!c.pop()}}),has:d(function(a){return function(c){return b(a,c).length>0}}),contains:d(function(a){return function(b){return(b.textContent||b.innerText||A(b)).indexOf(a)>-1}}),lang:d(function(a){return ob.test(a||"")||b.error("unsupported lang: "+a),a=a.replace(wb,xb).toLowerCase(),function(b){var c;do if(c=J?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===I},focus:function(a){return a===H.activeElement&&(!H.hasFocus||H.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!z.pseudos.empty(a)},header:function(a){return rb.test(a.nodeName)},input:function(a){return qb.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:j(function(){return[0]}),last:j(function(a,b){return[b-1]}),eq:j(function(a,b,c){return[0>c?c+b:c]}),even:j(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:j(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:j(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:j(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},z.pseudos.nth=z.pseudos.eq;for(w in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})z.pseudos[w]=h(w);for(w in{submit:!0,reset:!0})z.pseudos[w]=i(w);l.prototype=z.filters=z.pseudos,z.setFilters=new l,C=b.compile=function(a,b){var c,d=[],e=[],f=U[a+" "];if(!f){for(b||(b=m(a)),c=b.length;c--;)f=s(b[c]),f[O]?d.push(f):e.push(f);f=U(a,t(e,d))}return f},x.sortStable=O.split("").sort(V).join("")===O,x.detectDuplicates=!!F,G(),x.sortDetached=e(function(a){return 1&a.compareDocumentPosition(H.createElement("div"))}),e(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||f("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),x.attributes&&e(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||f("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),e(function(a){return null==a.getAttribute("disabled")})||f(db,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),"function"==typeof define&&define.amd?define(function(){return b}):"undefined"!=typeof module&&module.exports?module.exports=b:a.Sizzle=b}(window);
+//# sourceMappingURL=dist/sizzle.min.map
View
1 src/sizzle/dist/sizzle.min.map
@@ -0,0 +1 @@
+{"version":3,"file":"sizzle.min.js","sources":["sizzle.js"],"names":["window","Sizzle","selector","context","results","seed","match","elem","m","nodeType","i","groups","old","nid","newContext","newSelector","ownerDocument","preferredDoc","document","setDocument","documentIsHTML","rquickExpr","exec","getElementById","parentNode","id","push","contains","apply","getElementsByTagName","support","getElementsByClassName","qsa","rbuggyQSA","test","expando","nodeName","toLowerCase","tokenize","getAttribute","replace","rescape","setAttribute","length","toSelector","rsibling","testContext","join","querySelectorAll","qsaError","removeAttribute","select","rtrim","createCache","cache","key","value","keys","Expr","cacheLength","shift","markFunction","fn","assert","div","createElement","e","removeChild","addHandle","attrs","handler","arr","split","attrHandle","siblingCheck","a","b","cur","diff","sourceIndex","MAX_NEGATIVE","nextSibling","createInputPseudo","type","name","createButtonPseudo","createPositionalPseudo","argument","matches","j","matchIndexes","strundefined","setFilters","parseOnly","matched","tokens","soFar","preFilters","cached","tokenCache","slice","preFilter","rcomma","rcombinators","filter","matchExpr","error","len","addCombinator","matcher","combinator","base","dir","checkNonElements","doneName","done","first","xml","data","outerCache","dirkey","dirruns","cachedruns","elementMatcher","matchers","condense","unmatched","map","newUnmatched","mapped","setMatcher","postFilter","postFinder","postSelector","temp","preMap","postMap","preexisting","elems","multipleContexts","matcherIn","matcherOut","indexOf","call","splice","matcherFromTokens","checkContext","leadingRelative","relative","implicitRelative","matchContext","matchAnyContext","outermostContext","concat","matcherFromGroupMatchers","elementMatchers","setMatchers","matcherCachedRuns","bySet","byElement","superMatcher","outermost","matchedCount","setMatched","contextBackup","find","dirrunsUnique","Math","random","pop","uniqueSort","contexts","token","getById","runescape","funescape","compile","getText","isXML","sortInput","hasDuplicate","docElem","rbuggyMatches","Date","classCache","compilerCache","sortOrder","undefined","hasOwn","hasOwnProperty","push_native","this","booleans","whitespace","characterEncoding","identifier","attributes","pseudos","RegExp","rattributeQuotes","rpseudo","ridentifier","ID","CLASS","TAG","ATTR","PSEUDO","CHILD","bool","needsContext","rinputs","rheader","rnative","_","escaped","escapedWhitespace","high","String","fromCharCode","childNodes","target","els","documentElement","node","hasCompare","doc","parent","defaultView","top","addEventListener","attachEvent","className","appendChild","createComment","innerHTML","firstChild","getElementsByName","attrId","getAttributeNode","tag","tmp","input","matchesSelector","webkitMatchesSelector","mozMatchesSelector","oMatchesSelector","msMatchesSelector","disconnectedMatch","compareDocumentPosition","adown","bup","compare","sortDetached","aup","ap","bp","unshift","expr","elements","ret","attr","val","specified","msg","Error","duplicates","detectDuplicates","sortStable","sort","textContent","nodeValue","selectors","createPseudo",">"," ","+","~","excess","unquoted","nodeNameSelector","pattern","operator","check","result","what","last","simple","forward","ofType","nodeIndex","start","useCache","lastChild","pseudo","args","idx","not","has","text","innerText","lang","elemLang","hash","location","root","focus","activeElement","hasFocus","href","tabIndex","enabled","disabled","checked","selected","selectedIndex","empty","header","button","eq","even","odd","lt","gt","radio","checkbox","file","password","image","submit","reset","prototype","filters","group","div1","defaultValue","define","amd","module","exports"],"mappings":";CAUA,SAAWA,GA0KX,QAASC,GAAQC,EAAUC,EAASC,EAASC,GAC5C,GAAIC,GAAOC,EAAMC,EAAGC,EAEnBC,EAAGC,EAAQC,EAAKC,EAAKC,EAAYC,CASlC,KAPOZ,EAAUA,EAAQa,eAAiBb,EAAUc,KAAmBC,GACtEC,EAAahB,GAGdA,EAAUA,GAAWe,EACrBd,EAAUA,OAEJF,GAAgC,gBAAbA,GACxB,MAAOE,EAGR,IAAuC,KAAjCK,EAAWN,EAAQM,WAAgC,IAAbA,EAC3C,QAGD,IAAKW,IAAmBf,EAAO,CAG9B,GAAMC,EAAQe,GAAWC,KAAMpB,GAE9B,GAAMM,EAAIF,EAAM,I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A,GAAI0K,UAAY,WAChB1K,EAAI2K,WAAWjM,aAAc,QAAS,IACY,KAA3CsB,EAAI2K,WAAWpM,aAAc,YAEpC6B,EAAW,QAAS,SAAU7D,EAAM6E,EAAM8F,GACzC,MAAMA,IAAyC,UAAhC3K,EAAK6B,SAASC,cAA7B,OACQ9B,EAAKuU,eAOT/Q,EAAO,SAAUC,GACtB,MAAuC,OAAhCA,EAAIzB,aAAa,eAExB6B,EAAW4H,GAAU,SAAUzL,EAAM6E,EAAM8F,GAC1C,GAAImF,EACJ,OAAMnF,GAAN,OACQ3K,EAAM6E,MAAW,EAAOA,EAAK/C,eACjCgO,EAAM9P,EAAKuO,iBAAkB1J,KAAWiL,EAAIC,UAC7CD,EAAI7M,MACL,OAMmB,kBAAXuR,SAAyBA,OAAOC,IAC3CD,OAAO,WAAa,MAAO9U,KAEE,mBAAXgV,SAA0BA,OAAOC,QACnDD,OAAOC,QAAUjV,EAEjBD,EAAOC,OAASA,GAIbD"}
View
0 src/sizzle/test/data/empty.js
No changes.
View
22 src/sizzle/test/data/mixed_sort.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <script>var QUnit = parent.QUnit</script>
+ <script src="testinit.js"></script>
+ <script src="../../dist/sizzle.js"></script>
+</head>
+<body>
+ <script>
+ var doc = parent.document,
+ unframed = [ doc.getElementById( "qunit-fixture" ), doc.body, doc.documentElement ],
+ framed = Sizzle( "*" );
+
+ window.parent.iframeCallback(
+ Sizzle.uniqueSort( unframed.concat( framed ) ),
+ framed.concat( unframed.reverse() ),
+ "Mixed array was sorted correctly"
+ );
+ </script>
+</body>
+</html>
View
136 src/sizzle/test/data/testinit.js
@@ -0,0 +1,136 @@
+var fireNative,
+ jQuery = this.jQuery || "jQuery", // For testing .noConflict()
+ $ = this.$ || "$",
+ originaljQuery = jQuery,
+ original$ = $;
+
+(function() {
+ // Config parameter to force basic code paths
+ QUnit.config.urlConfig.push({
+ id: "basic",
+ label: "Bypass optimizations",
+ tooltip: "Force use of the most basic code by disabling native querySelectorAll; contains; compareDocumentPosition"
+ });
+ if ( QUnit.urlParams.basic ) {
+ document.querySelectorAll = null;
+ document.documentElement.contains = null;
+ document.documentElement.compareDocumentPosition = null;
+ // Return array of length two to pass assertion
+ // But support should be false as its not native
+ document.getElementsByClassName = function() { return [ 0, 1 ]; };
+ }
+})();
+
+/**
+ * Returns an array of elements with the given IDs
+ * @example q("main", "foo", "bar")
+ * @result [<div id="main">, <span id="foo">, <input id="bar">]
+ */
+function q() {
+ var r = [],
+ i = 0;
+
+ for ( ; i < arguments.length; i++ ) {
+ r.push( document.getElementById( arguments[i] ) );
+ }
+ return r;
+}
+
+/**
+ * Asserts that a select matches the given IDs
+ * @param {String} a - Assertion name
+ * @param {String} b - Sizzle selector
+ * @param {String} c - Array of ids to construct what is expected
+ * @example t("Check for something", "//[a]", ["foo", "baar"]);
+ * @result returns true if "//[a]" return two elements with the IDs 'foo' and 'baar'
+ */
+function t( a, b, c ) {
+ var f = Sizzle(b),
+ s = "",
+ i = 0;
+
+ for ( ; i < f.length; i++ ) {
+ s += ( s && "," ) + '"' + f[ i ].id + '"';
+ }
+
+ deepEqual(f, q.apply( q, c ), a + " (" + b + ")");
+}
+
+/**
+ * Add random number to url to stop caching
+ *
+ * @example url("data/test.html")
+ * @result "data/test.html?10538358428943"
+ *
+ * @example url("data/test.php?foo=bar")
+ * @result "data/test.php?foo=bar&10538358345554"
+ */
+function url( value ) {
+ return value + (/\?/.test(value) ? "&" : "?") + new Date().getTime() + "" + parseInt(Math.random()*100000);
+}
+
+var createWithFriesXML = function() {
+ var string = '<?xml version="1.0" encoding="UTF-8"?> \
+ <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" \
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" \
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> \
+ <soap:Body> \
+ <jsconf xmlns="http://www.example.com/ns1"> \
+ <response xmlns:ab="http://www.example.com/ns2"> \
+ <meta> \
+ <component id="seite1" class="component"> \
+ <properties xmlns:cd="http://www.example.com/ns3"> \
+ <property name="prop1"> \
+ <thing /> \
+ <value>1</value> \
+ </property> \
+ <property name="prop2"> \
+ <thing att="something" /> \
+ </property> \
+ <foo_bar>foo</foo_bar> \
+ </properties> \
+ </component> \
+ </meta> \
+ </response> \
+ </jsconf> \
+ </soap:Body> \
+ </soap:Envelope>';
+
+ return jQuery.parseXML( string );
+};
+
+fireNative = document.createEvent ?
+ function( node, type ) {
+ var event = document.createEvent("HTMLEvents");
+ event.initEvent( type, true, true );
+ node.dispatchEvent( event );
+ } :
+ function( node, type ) {
+ var event = document.createEventObject();
+ node.fireEvent( "on" + type, event );
+ };
+
+function testIframeWithCallback( title, fileName, func ) {
+ test( title, function() {
+ var iframe;
+
+ stop();
+ window.iframeCallback = function() {
+ var self = this,
+ args = arguments;
+ setTimeout(function() {
+ window.iframeCallback = undefined;
+ iframe.remove();
+ func.apply( self, args );
+ func = function() {};
+ start();
+ }, 0 );
+ };
+ iframe = jQuery( "<div/>" ).css({ position: "absolute", width: "500px", left: "-600px" })
+ .append( jQuery( "<iframe/>" ).attr( "src", url( "./data/" + fileName ) ) )
+ .appendTo( "#qunit-fixture" );
+ });
+};
+window.iframeCallback = undefined;
+
+function moduleTeardown() {}
View
242 src/sizzle/test/index.html
@@ -0,0 +1,242 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr" id="html">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Sizzle Test Suite</title>
+ <link rel="Stylesheet" media="screen" href="../bower_components/qunit/qunit/qunit.css" />
+ <script type="text/javascript" src="../bower_components/qunit/qunit/qunit.js"></script>
+ <script type="text/javascript" src="data/testinit.js"></script>
+ <script type="text/javascript" src="jquery.js"></script>
+ <script type="text/javascript" src="../dist/sizzle.js"></script>
+ <script type="text/javascript" src="unit/selector.js"></script>
+ <script type="text/javascript" src="unit/utilities.js"></script>
+ <script type="text/javascript" src="unit/extending.js"></script>
+</head>
+
+<body id="body">
+ <div id="qunit"></div>
+
+ <!-- Test HTML -->
+ <dl id="dl" style="position:absolute;top:-32767px;left:-32767px;width:1px">
+ <div id="qunit-fixture">
+ <p id="firstp">See <a id="simon1" href="http://simon.incutio.com/archive/2003/03/25/#getElementsBySelector" rel="bookmark">this blog entry</a> for more information.</p>
+ <p id="ap">
+ Here are some [links] in a normal paragraph: <a id="google" href="http://www.google.com/" title="Google!">Google</a>,
+ <a id="groups" href="http://groups.google.com/" class="GROUPS">Google Groups (Link)</a>.
+ This link has <code id="code1"><a href="http://smin" id="anchor1">class="blog"</a></code>:
+ <a href="http://diveintomark.org/" class="blog" hreflang="en" id="mark">diveintomark</a>
+
+ </p>
+ <div id="foo">
+ <p id="sndp">Everything inside the red border is inside a div with <code>id="foo"</code>.</p>
+ <p lang="en" id="en">This is a normal link: <a id="yahoo" href="http://www.yahoo.com/" class="blogTest">Yahoo</a></p>
+ <p id="sap">This link has <code><a href="#2" id="anchor2">class="blog"</a></code>: <a href="http://simon.incutio.com/" class="blog link" id="simon">Simon Willison's Weblog</a></p>
+
+ </div>
+ <div id="nothiddendiv" style="height:1px;background:white;" class="nothiddendiv">
+ <div id="nothiddendivchild"></div>
+ </div>
+ <span id="name+value"></span>
+ <p id="first">Try them out:</p>
+ <ul id="firstUL"></ul>
+ <ol id="empty"><!-- comment --></ol>
+ <form id="form" action="formaction">
+ <label for="action" id="label-for">Action:</label>
+ <input type="text" name="action" value="Test" id="text1" maxlength="30"/>
+ <input type="text" name="text2" value="Test" id="text2" disabled="disabled"/>
+ <input type="radio" name="radio1" id="radio1" value="on"/>
+
+ <input type="radio" name="radio2" id="radio2" checked="checked"/>
+ <input type="checkbox" name="check" id="check1" checked="checked"/>
+ <input type="checkbox" id="check2" value="on"/>
+
+ <input type="hidden" name="hidden" id="hidden1"/>
+ <input type="text" style="display:none;" name="foo[bar]" id="hidden2"/>
+
+ <input type="text" id="name" name="name" value="name" />
+ <input type="search" id="search" name="search" value="search" />
+
+ <button id="button" name="button" type="button">Button</button>
+
+ <textarea id="area1" maxlength="30">foobar</textarea>
+
+ <select name="select1" id="select1">
+ <option id="option1a" class="emptyopt" value="">Nothing</option>
+ <option id="option1b" value="1">1</option>
+ <option id="option1c" value="2">2</option>
+ <option id="option1d" value="3">3</option>
+ </select>
+ <select name="select2" id="select2">
+ <option id="option2a" class="emptyopt" value="">Nothing</option>
+ <option id="option2b" value="1">1</option>
+ <option id="option2c" value="2">2</option>
+ <option id="option2d" selected="selected" value="3">3</option>
+ </select>
+ <select name="select3" id="select3" multiple="multiple">
+ <option id="option3a" class="emptyopt" value="">Nothing</option>
+ <option id="option3b" selected="selected" value="1">1</option>
+ <option id="option3c" selected="selected" value="2">2</option>
+ <option id="option3d" value="3">3</option>
+ <option id="option3e">no value</option>
+ </select>
+ <select name="select4" id="select4" multiple="multiple">
+ <optgroup disabled="disabled">
+ <option id="option4a" class="emptyopt" value="">Nothing</option>
+ <option id="option4b" disabled="disabled" selected="selected" value="1">1</option>
+ <option id="option4c" selected="selected" value="2">2</option>
+ </optgroup>
+ <option selected="selected" disabled="disabled" id="option4d" value="3">3</option>
+ <option id="option4e">no value</option>
+ </select>
+ <select name="select5" id="select5">
+ <option id="option5a" value="3">1</option>
+ <option id="option5b" value="2">2</option>
+ <option id="option5c" value="1">3</option>
+ </select>
+
+ <object id="object1" codebase="stupid">
+ <param name="p1" value="x1" />
+ <param name="p2" value="x2" />
+ </object>
+
+ <span id="台北Táiběi"></span>
+ <span id="台北" lang="中文"></span>
+ <span id="utf8class1" class="台北Táiběi 台北"></span>
+ <span id="utf8class2" class="台北"></span>
+ <span id="foo:bar" class="foo:bar"><span id="foo_descendent"></span></span>
+ <span id="test.foo[5]bar" class="test.foo[5]bar"></span>
+
+ <foo_bar id="foobar">test element</foo_bar>
+ </form>
+ <b id="floatTest">Float test.</b>
+ <iframe id="iframe" name="iframe"></iframe>
+ <form id="lengthtest">
+ <input type="text" id="length" name="test"/>
+ <input type="text" id="idTest" name="id"/>
+ </form>
+ <table id="table"></table>
+
+ <form id="name-tests">
+ <!-- Inputs with a grouped name attribute. -->
+ <input name="types[]" id="types_all" type="checkbox" value="all" />
+ <input name="types[]" id="types_anime" type="checkbox" value="anime" />
+ <input name="types[]" id="types_movie" type="checkbox" value="movie" />
+ </form>
+
+ <form id="testForm" action="#" method="get">
+ <textarea name="T3" rows="2" cols="15">?
+Z</textarea>
+ <input type="hidden" name="H1" value="x" />
+ <input type="hidden" name="H2" />
+ <input name="PWD" type="password" value="" />
+ <input name="T1" type="text" />
+ <input name="T2" type="text" value="YES" readonly="readonly" />
+ <input type="checkbox" name="C1" value="1" />
+ <input type="checkbox" name="C2" />
+ <input type="radio" name="R1" value="1" />
+ <input type="radio" name="R1" value="2" />
+ <input type="text" name="My Name" value="me" />
+ <input type="reset" name="reset" value="NO" />
+ <select name="S1">
+ <option value="abc">ABC</option>
+ <option value="abc">ABC</option>
+ <option value="abc">ABC</option>
+ </select>
+ <select name="S2" multiple="multiple" size="3">
+ <option value="abc">ABC</option>
+ <option value="abc">ABC</option>
+ <option value="abc">ABC</option>
+ </select>
+ <select name="S3">
+ <option selected="selected">YES</option>
+ </select>
+ <select name="S4">
+ <option value="" selected="selected">NO</option>
+ </select>
+ <input type="submit" name="sub1" value="NO" />
+ <input type="submit" name="sub2" value="NO" />
+ <input type="image" name="sub3" value="NO" />
+ <button name="sub4" type="submit" value="NO">NO</button>
+ <input name="D1" type="text" value="NO" disabled="disabled" />
+ <input type="checkbox" checked="checked" disabled="disabled" name="D2" value="NO" />
+ <input type="radio" name="D3" value="NO" checked="checked" disabled="disabled" />
+ <select name="D4" disabled="disabled">
+ <option selected="selected" value="NO">NO</option>
+ </select>
+ <input id="list-test" type="text" />
+ <datalist id="datalist">
+ <option value="option"></option>
+ </datalist>
+ </form>
+ <div id="moretests">
+ <form>
+ <div id="checkedtest" style="display:none;">
+ <input type="radio" name="checkedtestradios" checked="checked"/>
+ <input type="radio" name="checkedtestradios" value="on"/>
+ <input type="checkbox" name="checkedtestcheckboxes" checked="checked"/>
+ <input type="checkbox" name="checkedtestcheckboxes" />
+ </div>
+ </form>
+ <div id="nonnodes"><span>hi</span> there <!-- mon ami --></div>
+ <div id="t2037">
+ <div><div class="hidden">hidden</div></div>
+ </div>
+ <div id="t6652">
+ <div></div>
+ </div>
+ <div id="t12087">
+ <input type="hidden" id="el12087" data-comma="0,1"/>
+ </div>
+ <div id="no-clone-exception"><object><embed></embed></object></div>
+ <div id="names-group">
+ <span id="name-is-example" name="example"></span>
+ <span id="name-is-div" name="div"></span>
+ </div>
+ <script id="script-no-src"></script>
+ <script id="script-src" src="data/empty.js"></script>
+ <div id="id-name-tests">
+ <a id="tName1ID" name="tName1"><span></span></a>
+ <a id="tName2ID" name="tName2"><span></span></a>
+ <div id="tName1"><span id="tName1-span">C</span></div>
+ </div>
+ </div>
+
+ <div id="tabindex-tests">
+ <ol id="listWithTabIndex" tabindex="5">
+ <li id="foodWithNegativeTabIndex" tabindex="-1">Rice</li>
+ <li id="foodNoTabIndex">Beans</li>
+ <li>Blinis</li>
+ <li>Tofu</li>
+ </ol>
+
+ <div id="divWithNoTabIndex">I'm hungry. I should...</div>
+ <span>...</span><a href="#" id="linkWithNoTabIndex">Eat lots of food</a><span>...</span> |
+ <span>...</span><a href="#" id="linkWithTabIndex" tabindex="2">Eat a little food</a><span>...</span> |
+ <span>...</span><a href="#" id="linkWithNegativeTabIndex" tabindex="-1">Eat no food</a><span>...</span>
+ <span>...</span><a id="linkWithNoHrefWithNoTabIndex">Eat a burger</a><span>...</span>
+ <span>...</span><a id="linkWithNoHrefWithTabIndex" tabindex="1">Eat some funyuns</a><span>...</span>
+ <span>...</span><a id="linkWithNoHrefWithNegativeTabIndex" tabindex="-1">Eat some funyuns</a><span>...</span>
+ </div>
+
+ <div id="liveHandlerOrder">
+ <span id="liveSpan1"><a href="#" id="liveLink1"></a></span>
+ <span id="liveSpan2"><a href="#" id="liveLink2"></a></span>
+ </div>
+
+ <div id="siblingTest">
+ <em id="siblingfirst">1</em>
+ <em id="siblingnext">2</em>
+ <em id="siblingthird">
+ <em id="siblingchild">
+ <em id="siblinggrandchild">
+ <em id="siblinggreatgrandchild"></em>
+ </em>
+ </em>
+ </em>
+ <span id="siblingspan"></span>
+ </div>​
+ </div>
+ </dl>
+ <br id="last"/>
+</body>
+</html>
View
9,597 src/sizzle/test/jquery.js
9,597 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
95 src/sizzle/test/unit/extending.js
@@ -0,0 +1,95 @@
+module("extending", { teardown: moduleTeardown });
+
+test("custom pseudos", function() {
+ expect( 6 );
+
+ Sizzle.selectors.filters.foundation = Sizzle.selectors.filters.root;
+ deepEqual( Sizzle(":foundation"), [ document.documentElement ], "Copy element filter with new name" );
+ delete Sizzle.selectors.filters.foundation;
+
+ Sizzle.selectors.setFilters.primary = Sizzle.selectors.setFilters.first;
+ t( "Copy set filter with new name", "div:primary", ["qunit"] );
+ delete Sizzle.selectors.setFilters.primary;
+
+ Sizzle.selectors.filters.aristotlean = Sizzle.selectors.createPseudo(function() {
+ return function( elem ) {
+ return !!elem.id;
+ };
+ });
+ t( "Custom element filter", "#foo :aristotlean", [ "sndp", "en", "yahoo", "sap", "anchor2", "simon" ] );
+ delete Sizzle.selectors.filters.aristotlean;
+
+ Sizzle.selectors.filters.endswith = Sizzle.selectors.createPseudo(function( text ) {
+ return function( elem ) {
+ return Sizzle.getText( elem ).slice( -text.length ) === text;
+ };
+ });
+ t( "Custom element filter with argument", "a:endswith(ogle)", ["google"] );
+ delete Sizzle.selectors.filters.endswith;
+
+ Sizzle.selectors.setFilters.second = Sizzle.selectors.createPseudo(function() {
+ return Sizzle.selectors.createPseudo(function( seed, matches ) {
+ if ( seed[1] ) {
+ matches[1] = seed[1];
+ seed[1] = false;
+ }
+ });
+ });
+ t( "Custom set filter", "#qunit-fixture p:second", ["ap"] );
+ delete Sizzle.selectors.filters.second;
+
+ Sizzle.selectors.setFilters.slice = Sizzle.selectors.createPseudo(function( argument ) {
+ var bounds = argument.split(":");
+ return Sizzle.selectors.createPseudo(function( seed, matches ) {
+ var i = bounds[1];
+
+ // Match elements found at the specified indexes
+ while ( --i >= bounds[0] ) {
+ if ( seed[i] ) {
+ matches[i] = seed[i];
+ seed[i] = false;
+ }
+ }
+ });
+ });
+ t( "Custom set filter with argument", "#qunit-fixture p:slice(1:3)", [ "ap", "sndp" ] );
+ delete Sizzle.selectors.filters.slice;
+});
+
+test("backwards-compatible custom pseudos", function() {
+ expect( 3 );
+
+ Sizzle.selectors.filters.icontains = function( elem, i, match ) {
+ return Sizzle.getText( elem ).toLowerCase().indexOf( (match[3] || "").toLowerCase() ) > -1;
+ };
+ t( "Custom element filter with argument", "a:icontains(THIS BLOG ENTRY)", ["simon1"] );
+ delete Sizzle.selectors.filters.icontains;
+
+ Sizzle.selectors.setFilters.podium = function( elements, argument ) {
+ var count = argument == null || argument === "" ? 3 : +argument;
+ return elements.slice( 0, count );
+ };
+ // Using TAG as the first token here forces this setMatcher into a fail state
+ // Where the descendent combinator was lost
+ t( "Custom setFilter", "form#form :PODIUM", ["label-for", "text1", "text2"] );
+ t( "Custom setFilter with argument", "#form input:Podium(1)", ["text1"] );
+ delete Sizzle.selectors.setFilters.podium;
+});
+
+test("custom attribute getters", function() {
+ expect( 2 );
+
+ var original = Sizzle.selectors.attrHandle.hreflang,
+ selector = "a:contains('mark')[hreflang='http://diveintomark.org/en']";
+
+ Sizzle.selectors.attrHandle.hreflang = function( elem, name ) {
+ var href = elem.getAttribute("href"),
+ lang = elem.getAttribute( name );
+ return lang && ( href + lang );
+ };
+
+ deepEqual( Sizzle(selector, createWithFriesXML()), [], "Custom attrHandle (preferred document)" );
+ t( "Custom attrHandle (preferred document)", selector, ["mark"] );
+
+ Sizzle.selectors.attrHandle.hreflang = original;
+});
View
1,132 src/sizzle/test/unit/selector.js
@@ -0,0 +1,1132 @@
+module("selector", { teardown: moduleTeardown });
+
+// #### NOTE: ####
+// jQuery should not be used in this module
+// except for DOM manipulation
+// If jQuery is mandatory for the selection, move the test to jquery/test/unit/selector.js
+// Use t() or Sizzle()
+// ###############
+
+/*
+ ======== QUnit Reference ========
+ http://docs.jquery.com/QUnit
+
+ Test methods:
+ expect(numAssertions)
+ stop()
+ start()
+ note: QUnit's eventual addition of an argument to stop/start is ignored in this test suite
+ so that start and stop can be passed as callbacks without worrying about
+ their parameters
+ Test assertions:
+ ok(value, [message])
+ equal(actual, expected, [message])
+ notEqual(actual, expected, [message])
+ deepEqual(actual, expected, [message])
+ notDeepEqual(actual, expected, [message])
+ strictEqual(actual, expected, [message])
+ notStrictEqual(actual, expected, [message])
+ raises(block, [expected], [message])
+
+ ======== testinit.js reference ========
+ See data/testinit.js
+
+ q(...);
+ Returns an array of elements with the given IDs
+ @example q("main", "foo", "bar") => [<div id="main">, <span id="foo">, <input id="bar">]
+
+ t( testName, selector, [ "array", "of", "ids" ] );
+ Asserts that a select matches the given IDs
+ @example t("Check for something", "//[a]", ["foo", "baar"]);
+
+ url( "some/url.php" );
+ Add random number to url to stop caching
+ @example url("data/test.html") => "data/test.html?10538358428943"
+ @example url("data/test.php?foo=bar") => "data/test.php?foo=bar&10538358345554"
+*/
+
+test("element", function() {
+ expect( 39 );
+
+ var form, all, good, i, obj1, lengthtest,
+ siblingTest, siblingNext, iframe, iframeDoc, html;
+
+ equal( Sizzle("").length, 0, "Empty selector returns an empty array" );
+ deepEqual( Sizzle("div", document.createTextNode("")), [], "Text element as context fails silently" );
+ form = document.getElementById("form");
+ ok( !Sizzle.matchesSelector( form, "" ), "Empty string passed to matchesSelector does not match" );
+ equal( Sizzle(" ").length, 0, "Empty selector returns an empty array" );
+ equal( Sizzle("\t").length, 0, "Empty selector returns an empty array" );
+
+ ok( Sizzle("*").length >= 30, "Select all" );
+ all = Sizzle("*");
+ good = true;
+ for ( i = 0; i < all.length; i++ ) {
+ if ( all[i].nodeType === 8 ) {
+ good = false;
+ }
+ }
+ ok( good, "Select all elements, no comment nodes" );
+ t( "Element Selector", "html", ["html"] );
+ t( "Element Selector", "body", ["body"] );
+ t( "Element Selector", "#qunit-fixture p", ["firstp","ap","sndp","en","sap","first"] );
+
+ t( "Leading space", " #qunit-fixture p", ["firstp","ap","sndp","en","sap","first"] );
+ t( "Leading tab", "\t#qunit-fixture p", ["firstp","ap","sndp","en","sap","first"] );
+ t( "Leading carriage return", "\r#qunit-fixture p", ["firstp","ap","sndp","en","sap","first"] );
+ t( "Leading line feed", "\n#qunit-fixture p", ["firstp","ap","sndp","en","sap","first"] );
+ t( "Leading form feed", "\f#qunit-fixture p", ["firstp","ap","sndp","en","sap","first"] );
+ t( "Trailing space", "#qunit-fixture p ", ["firstp","ap","sndp","en","sap","first"] );
+ t( "Trailing tab", "#qunit-fixture p\t", ["firstp","ap","sndp","en","sap","first"] );
+ t( "Trailing carriage return", "#qunit-fixture p\r", ["firstp","ap","sndp","en","sap","first"] );
+ t( "Trailing line feed", "#qunit-fixture p\n", ["firstp","ap","sndp","en","sap","first"] );
+ t( "Trailing form feed", "#qunit-fixture p\f", ["firstp","ap","sndp","en","sap","first"] );
+
+ t( "Parent Element", "dl ol", ["empty", "listWithTabIndex"] );
+ t( "Parent Element (non-space descendant combinator)", "dl\tol", ["empty", "listWithTabIndex"] );
+ obj1 = document.getElementById("object1");
+ equal( Sizzle("param", obj1).length, 2, "Object/param as context" );
+
+ deepEqual( Sizzle("select", form), q("select1","select2","select3","select4","select5"), "Finding selects with a context." );
+
+ // Check for unique-ness and sort order
+ deepEqual( Sizzle("p, div p"), Sizzle("p"), "Check for duplicates: p, div p" );
+
+ t( "Checking sort order", "h2, h1", ["qunit-header", "qunit-banner", "qunit-userAgent"] );
+ t( "Checking sort order", "h2:first, h1:first", ["qunit-header", "qunit-banner"] );
+ t( "Checking sort order", "#qunit-fixture p, #qunit-fixture p a", ["firstp", "simon1", "ap", "google", "groups", "anchor1", "mark", "sndp", "en", "yahoo", "sap", "anchor2", "simon", "first"] );
+
+ // Test Conflict ID
+ lengthtest = document.getElementById("lengthtest");
+ deepEqual( Sizzle("#idTest", lengthtest), q("idTest"), "Finding element with id of ID." );
+ deepEqual( Sizzle("[name='id']", lengthtest), q("idTest"), "Finding element with id of ID." );
+ deepEqual( Sizzle("input[id='idTest']", lengthtest), q("idTest"), "Finding elements with id of ID." );
+
+ siblingTest = document.getElementById("siblingTest");
+ deepEqual( Sizzle("div em", siblingTest), [], "Element-rooted QSA does not select based on document context" );
+ deepEqual( Sizzle("div em, div em, div em:not(div em)", siblingTest), [], "Element-rooted QSA does not select based on document context" );
+ deepEqual( Sizzle("div em, em\\,", siblingTest), [], "Escaped commas do not get treated with an id in element-rooted QSA" );
+
+ siblingNext = document.getElementById("siblingnext");
+ document.createDocumentFragment().appendChild( siblingTest );
+ deepEqual( Sizzle( "em + :not(:has(*)):not(:empty), foo", siblingTest ), [ siblingNext ],
+ "Non-qSA path correctly sets detached context for sibling selectors (jQuery #14351)" );
+
+ iframe = document.getElementById("iframe"),
+ iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
+ iframeDoc.open();
+ iframeDoc.write("<body><p id='foo'>bar</p></body>");
+ iframeDoc.close();
+ deepEqual(
+ Sizzle( "p:contains(bar)", iframeDoc ),
+ [ iframeDoc.getElementById("foo") ],
+ "Other document as context"
+ );
+
+ html = "";
+ for ( i = 0; i < 100; i++ ) {
+ html = "<div>" + html + "</div>";
+ }
+ html = jQuery( html ).appendTo( document.body );
+ ok( !!Sizzle("body div div div").length, "No stack or performance problems with large amounts of descendents" );
+ ok( !!Sizzle("body>div div div").length, "No stack or performance problems with large amounts of descendents" );
+ html.remove();
+
+ // Real use case would be using .watch in browsers with window.watch (see Issue #157)
+ q("qunit-fixture")[0].appendChild( document.createElement("toString") ).id = "toString";
+ t( "Element name matches Object.prototype property", "toString#toString", ["toString"] );
+});
+
+test("XML Document Selectors", function() {
+ var xml = createWithFriesXML();
+ expect( 11 );
+
+ equal( Sizzle("foo_bar", xml).length, 1, "Element Selector with underscore" );
+ equal( Sizzle(".component", xml).length, 1, "Class selector" );
+ equal( Sizzle("[class*=component]", xml).length, 1, "Attribute selector for class" );
+ equal( Sizzle("property[name=prop2]", xml).length, 1, "Attribute selector with name" );
+ equal( Sizzle("[name=prop2]", xml).length, 1, "Attribute selector with name" );
+ equal( Sizzle("#seite1", xml).length, 1, "Attribute selector with ID" );
+ equal( Sizzle("component#seite1", xml).length, 1, "Attribute selector with ID" );
+ equal( Sizzle.matches( "#seite1", Sizzle("component", xml) ).length, 1, "Attribute selector filter with ID" );
+ equal( Sizzle("meta property thing", xml).length, 2, "Descendent selector and dir caching" );
+ ok( Sizzle.matchesSelector( xml.lastChild, "soap\\:Envelope" ), "Check for namespaced element" );
+
+ xml = jQuery.parseXML("<?xml version='1.0' encoding='UTF-8'?><root><elem id='1'/></root>");
+ equal( Sizzle( "elem:not(:has(*))", xml ).length, 1,
+ "Non-qSA path correctly handles numeric ids (jQuery #14142)" );
+});
+
+test("broken", function() {
+ expect( 26 );
+
+ var attrbad,
+ broken = function( name, selector ) {
+ raises(function() {
+ // Setting context to null here somehow avoids QUnit's window.error handling
+ // making the e & e.message correct
+ // For whatever reason, without this,
+ // Sizzle.error will be called but no error will be seen in oldIE
+ Sizzle.call( null, selector );
+ }, function( e ) {
+ return e.message.indexOf("Syntax error") >= 0;
+ }, name + ": " + selector );
+ };
+
+ broken( "Broken Selector", "[" );
+ broken( "Broken Selector", "(" );
+ broken( "Broken Selector", "{" );
+ broken( "Broken Selector", "<" );
+ broken( "Broken Selector", "()" );
+ broken( "Broken Selector", "<>" );
+ broken( "Broken Selector", "{}" );
+ broken( "Broken Selector", "," );
+ broken( "Broken Selector", ",a" );
+ broken( "Broken Selector", "a," );
+ // Hangs on IE 9 if regular expression is inefficient
+ broken( "Broken Selector", "[id=012345678901234567890123456789");
+ broken( "Doesn't exist", ":visble" );
+ broken( "Nth-child", ":nth-child" );
+ // Sigh again. IE 9 thinks this is also a real selector
+ // not super critical that we fix this case
+ //broken( "Nth-child", ":nth-child(-)" );
+ // Sigh. WebKit thinks this is a real selector in qSA
+ // They've already fixed this and it'll be coming into
+ // current browsers soon. Currently, Safari 5.0 still has this problem
+ // broken( "Nth-child", ":nth-child(asdf)", [] );
+ broken( "Nth-child", ":nth-child(2n+-0)" );
+ broken( "Nth-child", ":nth-child(2+0)" );
+ broken( "Nth-child", ":nth-child(- 1n)" );
+ broken( "Nth-child", ":nth-child(-1 n)" );
+ broken( "First-child", ":first-child(n)" );
+ broken( "Last-child", ":last-child(n)" );
+ broken( "Only-child", ":only-child(n)" );
+ broken( "Nth-last-last-child", ":nth-last-last-child(1)" );
+ broken( "First-last-child", ":first-last-child" );
+ broken( "Last-last-child", ":last-last-child" );
+ broken( "Only-last-child", ":only-last-child" );
+
+ // Make sure attribute value quoting works correctly. See: #6093
+ attrbad = jQuery("<input type='hidden' value='2' name='foo.baz' id='attrbad1'/><input type='hidden' value='2' name='foo[baz]' id='attrbad2'/>").appendTo("#qunit-fixture");
+
+ broken( "Attribute not escaped", "input[name=foo.baz]", [] );
+ // Shouldn't be matching those inner brackets
+ broken( "Attribute not escaped", "input[name=foo[baz]]", [] );
+});
+
+test("id", function() {
+ expect( 34 );
+
+ var fiddle, a;
+
+ t( "ID Selector", "#body", ["body"] );
+ t( "ID Selector w/ Element", "body#body", ["body"] );
+ t( "ID Selector w/ Element", "ul#first", [] );
+ t( "ID selector with existing ID descendant", "#firstp #simon1", ["simon1"] );
+ t( "ID selector with non-existant descendant", "#firstp #foobar", [] );
+ t( "ID selector using UTF8", "#台北Táiběi", ["台北Táiběi"] );
+ t( "Multiple ID selectors using UTF8", "#台北Táiběi, #台北", ["台北Táiběi","台北"] );
+ t( "Descendant ID selector using UTF8", "div #台北", ["台北"] );
+ t( "Child ID selector using UTF8", "form > #台北", ["台北"] );
+
+ t( "Escaped ID", "#foo\\:bar", ["foo:bar"] );
+ t( "Escaped ID with descendent", "#foo\\:bar span:not(:input)", ["foo_descendent"] );
+ t( "Escaped ID", "#test\\.foo\\[5\\]bar", ["test.foo[5]bar"] );
+ t( "Descendant escaped ID", "div #foo\\:bar", ["foo:bar"] );
+ t( "Descendant escaped ID", "div #test\\.foo\\[5\\]bar", ["test.foo[5]bar"] );
+ t( "Child escaped ID", "form > #foo\\:bar", ["foo:bar"] );
+ t( "Child escaped ID", "form > #test\\.foo\\[5\\]bar", ["test.foo[5]bar"] );
+
+ fiddle = jQuery("<div id='fiddle\\Foo'><span id='fiddleSpan'></span></div>").appendTo("#qunit-fixture");
+ deepEqual( Sizzle( "> span", Sizzle("#fiddle\\\\Foo")[0] ), q([ "fiddleSpan" ]), "Escaped ID as context" );
+ fiddle.remove();
+
+ t( "ID Selector, child ID present", "#form > #radio1", ["radio1"] ); // bug #267
+ t( "ID Selector, not an ancestor ID", "#form #first", [] );
+ t( "ID Selector, not a child ID", "#form > #option1a", [] );
+
+ t( "All Children of ID", "#foo > *", ["sndp", "en", "sap"] );
+ t( "All Children of ID with no children", "#firstUL > *", [] );
+
+ equal( Sizzle("#tName1")[0].id, "tName1", "ID selector with same value for a name attribute" );
+ t( "ID selector non-existing but name attribute on an A tag", "#tName2", [] );
+ t( "Leading ID selector non-existing but name attribute on an A tag", "#tName2 span", [] );
+ t( "Leading ID selector existing, retrieving the child", "#tName1 span", ["tName1-span"] );
+ equal( Sizzle("div > div #tName1")[0].id, Sizzle("#tName1-span")[0].parentNode.id, "Ending with ID" );
+
+ a = jQuery("<a id='backslash\\foo'></a>").appendTo("#qunit-fixture");
+ t( "ID Selector contains backslash", "#backslash\\\\foo", ["backslash\\foo"] );
+
+ t( "ID Selector on Form with an input that has a name of 'id'", "#lengthtest", ["lengthtest"] );
+
+ t( "ID selector with non-existant ancestor", "#asdfasdf #foobar", [] ); // bug #986
+
+ deepEqual( Sizzle("div#form", document.body), [], "ID selector within the context of another element" );
+
+ t( "Underscore ID", "#types_all", ["types_all"] );
+ t( "Dash ID", "#qunit-fixture", ["qunit-fixture"] );
+
+ t( "ID with weird characters in it", "#name\\+value", ["name+value"] );
+});
+
+test("class", function() {
+ expect( 26 );
+
+ t( "Class Selector", ".blog", ["mark","simon"] );
+ t( "Class Selector", ".GROUPS", ["groups"] );
+ t( "Class Selector", ".blog.link", ["simon"] );
+ t( "Class Selector w/ Element", "a.blog", ["mark","simon"] );
+ t( "Parent Class Selector", "p .blog", ["mark","simon"] );
+
+ t( "Class selector using UTF8", ".台北Táiběi", ["utf8class1"] );
+ //t( "Class selector using UTF8", ".台北", ["utf8class1","utf8class2"] );
+ t( "Class selector using UTF8", ".台北Táiběi.台北", ["utf8class1"] );
+ t( "Class selector using UTF8", ".台北Táiběi, .台北", ["utf8class1","utf8class2"] );
+ t( "Descendant class selector using UTF8", "div .台北Táiběi", ["utf8class1"] );
+ t( "Child class selector using UTF8", "form > .台北Táiběi", ["utf8class1"] );
+
+ t( "Escaped Class", ".foo\\:bar", ["foo:bar"] );
+ t( "Escaped Class", ".test\\.foo\\[5\\]bar", ["test.foo[5]bar"] );
+ t( "Descendant escaped Class", "div .foo\\:bar", ["foo:bar"] );
+ t( "Descendant escaped Class", "div .test\\.foo\\[5\\]bar", ["test.foo[5]bar"] );
+ t( "Child escaped Class", "form > .foo\\:bar", ["foo:bar"] );
+ t( "Child escaped Class", "form > .test\\.foo\\[5\\]bar", ["test.foo[5]bar"] );
+
+ var div = document.createElement("div");
+ div.innerHTML = "<div class='test e'></div><div class='test'></div>";
+ deepEqual( Sizzle(".e", div), [ div.firstChild ], "Finding a second class." );
+
+ div.lastChild.className = "e";
+
+ deepEqual( Sizzle(".e", div), [ div.firstChild, div.lastChild ], "Finding a modified class." );
+
+ ok( !Sizzle.matchesSelector( div, ".null"), ".null does not match an element with no class" );
+ ok( !Sizzle.matchesSelector( div.firstChild, ".null div"), ".null does not match an element with no class" );
+ div.className = "null";
+ ok( Sizzle.matchesSelector( div, ".null"), ".null matches element with class 'null'" );
+ ok( Sizzle.matchesSelector( div.firstChild, ".null div"), "caching system respects DOM changes" );
+ ok( !Sizzle.matchesSelector( document, ".foo" ), "testing class on document doesn't error" );
+ ok( !Sizzle.matchesSelector( window, ".foo" ), "testing class on window doesn't error" );
+
+ div.lastChild.className += " hasOwnProperty toString";
+ deepEqual( Sizzle(".e.hasOwnProperty.toString", div), [ div.lastChild ], "Classes match Object.prototype properties" );
+
+ div = jQuery("<div><svg width='200' height='250' version='1.1' xmlns='http://www.w3.org/2000/svg'><rect x='10' y='10' width='30' height='30' class='foo'></rect></svg></div>")[0];
+ equal( Sizzle(".foo", div).length, 1, "Class selector against SVG" );
+});
+
+test("name", function() {
+ expect( 13 );
+
+ var form;
+
+ t( "Name selector", "input[name=action]", ["text1"] );
+ t( "Name selector with single quotes", "input[name='action']", ["text1"] );
+ t( "Name selector with double quotes", "input[name=\"action\"]", ["text1"] );
+
+ t( "Name selector non-input", "[name=example]", ["name-is-example"] );
+ t( "Name selector non-input", "[name=div]", ["name-is-div"] );
+ t( "Name selector non-input", "*[name=iframe]", ["iframe"] );
+
+ t( "Name selector for grouped input", "input[name='types[]']", ["types_all", "types_anime", "types_movie"] );
+
+ form = document.getElementById("form");
+ deepEqual( Sizzle("input[name=action]", form), q("text1"), "Name selector within the context of another element" );
+ deepEqual( Sizzle("input[name='foo[bar]']", form), q("hidden2"), "Name selector for grouped form element within the context of another element" );
+
+ form = jQuery("<form><input name='id'/></form>").appendTo("body");
+ equal( Sizzle("input", form[0]).length, 1, "Make sure that rooted queries on forms (with possible expandos) work." );
+
+ form.remove();
+
+ t( "Find elements that have similar IDs", "[name=tName1]", ["tName1ID"] );
+ t( "Find elements that have similar IDs", "[name=tName2]", ["tName2ID"] );
+ t( "Find elements that have similar IDs", "#tName2ID", ["tName2ID"] );
+});
+
+test("multiple", function() {
+ expect(6);
+
+ t( "Comma Support", "h2, #qunit-fixture p", ["qunit-banner","qunit-userAgent","firstp","ap","sndp","en","sap","first"] );
+ t( "Comma Support", "h2 , #qunit-fixture p", ["qunit-banner","qunit-userAgent","firstp","ap","sndp","en","sap","first"] );
+ t( "Comma Support", "h2 , #qunit-fixture p", ["qunit-banner","qunit-userAgent","firstp","ap","sndp","en","sap","first"] );
+ t( "Comma Support", "h2,#qunit-fixture p", ["qunit-banner","qunit-userAgent","firstp","ap","sndp","en","sap","first"] );
+ t( "Comma Support", "h2,#qunit-fixture p ", ["qunit-banner","qunit-userAgent","firstp","ap","sndp","en","sap","first"] );
+ t( "Comma Support", "h2\t,\r#qunit-fixture p\n", ["qunit-banner","qunit-userAgent","firstp","ap","sndp","en","sap","first"] );
+});
+
+test("child and adjacent", function() {
+ expect( 42 );
+
+ var siblingFirst, en, nothiddendiv;
+
+ t( "Child", "p > a", ["simon1","google","groups","mark","yahoo","simon"] );
+ t( "Child", "p> a", ["simon1","google","groups","mark","yahoo","simon"] );
+ t( "Child", "p >a", ["simon1","google","groups","mark","yahoo","simon"] );
+ t( "Child", "p>a", ["simon1","google","groups","mark","yahoo","simon"] );
+ t( "Child w/ Class", "p > a.blog", ["mark","simon"] );
+ t( "All Children", "code > *", ["anchor1","anchor2"] );
+ t( "All Grandchildren", "p > * > *", ["anchor1","anchor2"] );
+ t( "Adjacent", "#qunit-fixture a + a", ["groups", "tName2ID"] );
+ t( "Adjacent", "#qunit-fixture a +a", ["groups", "tName2ID"] );
+ t( "Adjacent", "#qunit-fixture a+ a", ["groups", "tName2ID"] );
+ t( "Adjacent", "#qunit-fixture a+a", ["groups", "tName2ID"] );
+ t( "Adjacent", "p + p", ["ap","en","sap"] );
+ t( "Adjacent", "p#firstp + p", ["ap"] );
+ t( "Adjacent", "p[lang=en] + p", ["sap"] );
+ t( "Adjacent", "a.GROUPS + code + a", ["mark"] );
+ t( "Comma, Child, and Adjacent", "#qunit-fixture a + a, code > a", ["groups","anchor1","anchor2","tName2ID"] );
+ t( "Element Preceded By", "#qunit-fixture p ~ div", ["foo", "nothiddendiv", "moretests","tabindex-tests", "liveHandlerOrder", "siblingTest"] );
+ t( "Element Preceded By", "#first ~ div", ["moretests","tabindex-tests", "liveHandlerOrder", "siblingTest"] );
+ t( "Element Preceded By", "#groups ~ a", ["mark"] );
+ t( "Element Preceded By", "#length ~ input", ["idTest"] );
+ t( "Element Preceded By", "#siblingfirst ~ em", ["siblingnext", "siblingthird"] );
+ t( "Element Preceded By (multiple)", "#siblingTest em ~ em ~ em ~ span", ["siblingspan"] );
+ t( "Element Preceded By, Containing", "#liveHandlerOrder ~ div em:contains('1')", ["siblingfirst"] );
+
+ siblingFirst = document.getElementById("siblingfirst");
+
+ deepEqual( Sizzle("~ em", siblingFirst), q("siblingnext", "siblingthird"), "Element Preceded By with a context." );
+ deepEqual( Sizzle("+ em", siblingFirst), q("siblingnext"), "Element Directly Preceded By with a context." );
+ deepEqual( Sizzle("~ em:first", siblingFirst), q("siblingnext"), "Element Preceded By positional with a context." );
+
+ en = document.getElementById("en");
+ deepEqual( Sizzle("+ p, a", en), q("yahoo", "sap"), "Compound selector with context, beginning with sibling test." );
+ deepEqual( Sizzle("a, + p", en), q("yahoo", "sap"), "Compound selector with context, containing sibling test." );
+
+ t( "Multiple combinators selects all levels", "#siblingTest em *", ["siblingchild", "siblinggrandchild", "siblinggreatgrandchild"] );
+ t( "Multiple combinators selects all levels", "#siblingTest > em *", ["siblingchild", "siblinggrandchild", "siblinggreatgrandchild"] );
+ t( "Multiple sibling combinators doesn't miss general siblings", "#siblingTest > em:first-child + em ~ span", ["siblingspan"] );
+ t( "Combinators are not skipped when mixing general and specific", "#siblingTest > em:contains('x') + em ~ span", [] );
+
+ equal( Sizzle("#listWithTabIndex").length, 1, "Parent div for next test is found via ID (#8310)" );
+ equal( Sizzle("#listWithTabIndex li:eq(2) ~ li").length, 1, "Find by general sibling combinator (#8310)" );
+ equal( Sizzle("#__sizzle__").length, 0, "Make sure the temporary id assigned by sizzle is cleared out (#8310)" );
+ equal( Sizzle("#listWithTabIndex").length, 1, "Parent div for previous test is still found via ID (#8310)" );
+
+ t( "Verify deep class selector", "div.blah > p > a", [] );
+
+ t( "No element deep selector", "div.foo > span > a", [] );
+
+ nothiddendiv = document.getElementById("nothiddendiv");
+ deepEqual( Sizzle("> :first", nothiddendiv), q("nothiddendivchild"), "Verify child context positional selector" );
+ deepEqual( Sizzle("> :eq(0)", nothiddendiv), q("nothiddendivchild"), "Verify child context positional selector" );
+ deepEqual( Sizzle("> *:first", nothiddendiv), q("nothiddendivchild"), "Verify child context positional selector" );
+
+ t( "Non-existant ancestors", ".fototab > .thumbnails > a", [] );
+});
+
+test("attributes", function() {
+ expect( 76 );
+
+ var opt, input, attrbad, div;
+
+ t( "Attribute Exists", "#qunit-fixture a[title]", ["google"] );
+ t( "Attribute Exists (case-insensitive)", "#qunit-fixture a[TITLE]", ["google"] );
+ t( "Attribute Exists", "#qunit-fixture *[title]", ["google"] );
+ t( "Attribute Exists", "#qunit-fixture [title]", ["google"] );
+ t( "Attribute Exists", "#qunit-fixture a[ title ]", ["google"] );
+
+ t( "Boolean attribute exists", "#select2 option[selected]", ["option2d"]);
+ t( "Boolean attribute equals", "#select2 option[selected='selected']", ["option2d"]);
+
+ t( "Attribute Equals", "#qunit-fixture a[rel='bookmark']", ["simon1"] );
+ t( "Attribute Equals", "#qunit-fixture a[rel='bookmark']", ["simon1"] );
+ t( "Attribute Equals", "#qunit-fixture a[rel=bookmark]", ["simon1"] );
+ t( "Attribute Equals", "#qunit-fixture a[href='http://www.google.com/']", ["google"] );
+ t( "Attribute Equals", "#qunit-fixture a[ rel = 'bookmark' ]", ["simon1"] );
+ t( "Attribute Equals Number", "#qunit-fixture option[value=1]", ["option1b","option2b","option3b","option4b","option5c"] );
+ t( "Attribute Equals Number", "#qunit-fixture li[tabIndex=-1]", ["foodWithNegativeTabIndex"] );
+
+ document.getElementById("anchor2").href = "#2";
+ t( "href Attribute", "p a[href^=#]", ["anchor2"] );
+ t( "href Attribute", "p a[href*=#]", ["simon1", "anchor2"] );
+
+ t( "for Attribute", "form label[for]", ["label-for"] );
+ t( "for Attribute in form", "#form [for=action]", ["label-for"] );
+
+ t( "Attribute containing []", "input[name^='foo[']", ["hidden2"] );
+ t( "Attribute containing []", "input[name^='foo[bar]']", ["hidden2"] );
+ t( "Attribute containing []", "input[name*='[bar]']", ["hidden2"] );
+ t( "Attribute containing []", "input[name$='bar]']", ["hidden2"] );
+ t( "Attribute containing []", "input[name$='[bar]']", ["hidden2"] );
+ t( "Attribute containing []", "input[name$='foo[bar]']", ["hidden2"] );
+ t( "Attribute containing []", "input[name*='foo[bar]']", ["hidden2"] );
+
+ deepEqual( Sizzle( "input[data-comma='0,1']" ), [ document.getElementById("el12087") ], "Without context, single-quoted attribute containing ','" );
+ deepEqual( Sizzle( "input[data-comma=\"0,1\"]" ), [ document.getElementById("el12087") ], "Without context, double-quoted attribute containing ','" );
+ deepEqual( Sizzle( "input[data-comma='0,1']", document.getElementById("t12087") ), [ document.getElementById("el12087") ], "With context, single-quoted attribute containing ','" );
+ deepEqual( Sizzle( "input[data-comma=\"0,1\"]", document.getElementById("t12087") ), [ document.getElementById("el12087") ], "With context, double-quoted attribute containing ','" );
+
+ t( "Multiple Attribute Equals", "#form input[type='radio'], #form input[type='hidden']", ["radio1", "radio2", "hidden1"] );
+ t( "Multiple Attribute Equals", "#form input[type='radio'], #form input[type=\"hidden\"]", ["radio1", "radio2", "hidden1"] );
+ t( "Multiple Attribute Equals", "#form input[type='radio'], #form input[type=hidden]", ["radio1", "radio2", "hidden1"] );
+
+ t( "Attribute selector using UTF8", "span[lang=中文]", ["台北"] );
+
+ t( "Attribute Begins With", "a[href ^= 'http://www']", ["google","yahoo"] );
+ t( "Attribute Ends With", "a[href $= 'org/']", ["mark"] );
+ t( "Attribute Contains", "a[href *= 'google']", ["google","groups"] );
+ t( "Attribute Is Not Equal", "#ap a[hreflang!='en']", ["google","groups","anchor1"] );
+
+ opt = document.getElementById("option1a");
+ opt.setAttribute( "test", "" );
+
+ ok( Sizzle.matchesSelector( opt, "[id*=option1][type!=checkbox]" ), "Attribute Is Not Equal Matches" );
+ ok( Sizzle.matchesSelector( opt, "[id*=option1]" ), "Attribute With No Quotes Contains Matches" );
+ ok( Sizzle.matchesSelector( opt, "[test=]" ), "Attribute With No Quotes No Content Matches" );
+ ok( !Sizzle.matchesSelector( opt, "[test^='']" ), "Attribute with empty string value does not match startsWith selector (^=)" );
+ ok( Sizzle.matchesSelector( opt, "[id=option1a]" ), "Attribute With No Quotes Equals Matches" );
+ ok( Sizzle.matchesSelector( document.getElementById("simon1"), "a[href*=#]" ), "Attribute With No Quotes Href Contains Matches" );
+
+ t( "Empty values", "#select1 option[value='']", ["option1a"] );
+ t( "Empty values", "#select1 option[value!='']", ["option1b","option1c","option1d"] );
+
+ t( "Select options via :selected", "#select1 option:selected", ["option1a"] );
+ t( "Select options via :selected", "#select2 option:selected", ["option2d"] );
+ t( "Select options via :selected", "#select3 option:selected", ["option3b", "option3c"] );
+ t( "Select options via :selected", "select[name='select2'] option:selected", ["option2d"] );
+
+ t( "Grouped Form Elements", "input[name='foo[bar]']", ["hidden2"] );
+
+ input = document.getElementById("text1");
+ input.title = "Don't click me";
+
+ ok( Sizzle.matchesSelector( input, "input[title=\"Don't click me\"]" ), "Quote within attribute value does not mess up tokenizer" );
+
+ // Uncomment if the boolHook is removed
+ // var check2 = document.getElementById("check2");
+ // check2.checked = true;
+ // ok( !Sizzle.matches("[checked]", [ check2 ] ), "Dynamic boolean attributes match when they should with Sizzle.matches (#11115)" );
+
+ // jQuery #12303
+ input.setAttribute( "data-pos", ":first" );
+ ok( Sizzle.matchesSelector( input, "input[data-pos=\\:first]"), "POS within attribute value is treated as an attribute value" );
+ ok( Sizzle.matchesSelector( input, "input[data-pos=':first']"), "POS within attribute value is treated as an attribute value" );
+ ok( Sizzle.matchesSelector( input, ":input[data-pos=':first']"), "POS within attribute value after pseudo is treated as an attribute value" );
+ input.removeAttribute("data-pos");
+
+ // Make sure attribute value quoting works correctly. See jQuery #6093; #6428; #13894
+ // Use seeded results to bypass querySelectorAll optimizations
+ attrbad = jQuery(
+ "<input type='hidden' id='attrbad_space' name='foo bar'/>" +
+ "<input type='hidden' id='attrbad_dot' value='2' name='foo.baz'/>" +
+ "<input type='hidden' id='attrbad_brackets' value='2' name='foo[baz]'/>" +
+ "<input type='hidden' id='attrbad_injection' data-attr='foo_baz&#39;]'/>" +
+ "<input type='hidden' id='attrbad_quote' data-attr='&#39;'/>" +
+ "<input type='hidden' id='attrbad_backslash' data-attr='&#92;'/>" +
+ "<input type='hidden' id='attrbad_backslash_quote' data-attr='&#92;&#39;'/>" +
+ "<input type='hidden' id='attrbad_backslash_backslash' data-attr='&#92;&#92;'/>" +
+ "<input type='hidden' id='attrbad_unicode' data-attr='&#x4e00;'/>"
+ ).appendTo("#qunit-fixture").get();
+
+ t( "Underscores don't need escaping", "input[id=types_all]", ["types_all"] );
+
+ deepEqual( Sizzle( "input[name=foo\\ bar]", null, null, attrbad ), q("attrbad_space"),
+ "Escaped space" );
+ deepEqual( Sizzle( "input[name=foo\\.baz]", null, null, attrbad ), q("attrbad_dot"),
+ "Escaped dot" );
+ deepEqual( Sizzle( "input[name=foo\\[baz\\]]", null, null, attrbad ), q("attrbad_brackets"),
+ "Escaped brackets" );
+ deepEqual( Sizzle( "input[data-attr='foo_baz\\']']", null, null, attrbad ), q("attrbad_injection"),
+ "Escaped quote + right bracket" );
+
+ deepEqual( Sizzle( "input[data-attr='\\'']", null, null, attrbad ), q("attrbad_quote"),
+ "Quoted quote" );
+ deepEqual( Sizzle( "input[data-attr='\\\\']", null, null, attrbad ), q("attrbad_backslash"),
+ "Quoted backslash" );
+ deepEqual( Sizzle( "input[data-attr='\\\\\\'']", null, null, attrbad ), q("attrbad_backslash_quote"),
+ "Quoted backslash quote" );
+ deepEqual( Sizzle( "input[data-attr='\\\\\\\\']", null, null, attrbad ), q("attrbad_backslash_backslash"),
+ "Quoted backslash backslash" );
+
+ deepEqual( Sizzle( "input[data-attr='\\5C\\\\']", null, null, attrbad ), q("attrbad_backslash_backslash"),
+ "Quoted backslash backslash (numeric escape)" );
+ deepEqual( Sizzle( "input[data-attr='\\5C \\\\']", null, null, attrbad ), q("attrbad_backslash_backslash"),
+ "Quoted backslash backslash (numeric escape with trailing space)" );
+ deepEqual( Sizzle( "input[data-attr='\\5C\t\\\\']", null, null, attrbad ), q("attrbad_backslash_backslash"),
+ "Quoted backslash backslash (numeric escape with trailing tab)" );
+ deepEqual( Sizzle( "input[data-attr='\\04e00']", null, null, attrbad ), q("attrbad_unicode"),
+ "Long numeric escape (BMP)" );
+ document.getElementById("attrbad_unicode").setAttribute( "data-attr", "\uD834\uDF06A" );
+ // It was too much code to fix Safari 5.x Supplemental Plane crashes (see ba5f09fa404379a87370ec905ffa47f8ac40aaa3)
+ // deepEqual( Sizzle( "input[data-attr='\\01D306A']", null, null, attrbad ), q("attrbad_unicode"),
+ // "Long numeric escape (non-BMP)" );
+
+ t( "input[type=text]", "#form input[type=text]", ["text1", "text2", "hidden2", "name"] );
+ t( "input[type=search]", "#form input[type=search]", ["search"] );
+ t( "script[src] (jQuery #13777)", "#moretests script[src]", ["script-src"] );
+
+ // #3279
+ div = document.createElement("div");
+ div.innerHTML = "<div id='foo' xml:test='something'></div>";
+
+ deepEqual( Sizzle( "[xml\\:test]", div ), [ div.firstChild ], "Finding by attribute with escaped characters." );
+
+ div = document.getElementById("foo");
+ t( "Object.prototype property \"constructor\" (negative)", "[constructor]", [] );
+ t( "Gecko Object.prototype property \"watch\" (negative)", "[watch]", [] );
+ div.setAttribute( "constructor", "foo" );
+ div.setAttribute( "watch", "bar" );
+ t( "Object.prototype property \"constructor\"", "[constructor='foo']", ["foo"] );
+ t( "Gecko Object.prototype property \"watch\"", "[watch='bar']", ["foo"] );
+
+ t( "Value attribute is retrieved correctly", "input[value=Test]", ["text1", "text2"] );
+});
+
+test("pseudo - (parent|empty)", function() {
+ expect( 3 );
+ t( "Empty", "ul:empty", ["firstUL"] );
+ t( "Empty with comment node", "ol:empty", ["empty"] );
+ t( "Is A Parent", "#qunit-fixture p:parent", ["firstp","ap","sndp","en","sap","first"] );
+});
+
+test("pseudo - (first|last|only)-(child|of-type)", function() {
+ expect( 12 );
+
+ t( "First Child", "p:first-child", ["firstp","sndp"] );
+ t( "First Child (leading id)", "#qunit-fixture p:first-child", ["firstp","sndp"] );
+ t( "First Child (leading class)", ".nothiddendiv div:first-child", ["nothiddendivchild"] );
+ t( "First Child (case-insensitive)", "#qunit-fixture p:FIRST-CHILD", ["firstp","sndp"] );
+
+ t( "Last Child", "p:last-child", ["sap"] );
+ t( "Last Child (leading id)", "#qunit-fixture a:last-child", ["simon1","anchor1","mark","yahoo","anchor2","simon","liveLink1","liveLink2"] );
+
+ t( "Only Child", "#qunit-fixture a:only-child", ["simon1","anchor1","yahoo","anchor2","liveLink1","liveLink2"] );
+
+ t( "First-of-type", "#qunit-fixture > p:first-of-type", ["firstp"] );
+ t( "Last-of-type", "#qunit-fixture > p:last-of-type", ["first"] );
+ t( "Only-of-type", "#qunit-fixture > :only-of-type", ["name+value", "firstUL", "empty", "floatTest", "iframe", "table"] );
+
+ // Verify that the child position isn't being cached improperly
+ var secondChildren = jQuery("p:nth-child(2)").before("<div></div>");
+
+ t( "No longer second child", "p:nth-child(2)", [] );
+ secondChildren.prev().remove();
+ t( "Restored second child", "p:nth-child(2)", ["ap","en"] );
+});
+
+test("pseudo - nth-child", function() {
+ expect( 30 );
+
+ t( "Nth-child", "p:nth-child(1)", ["firstp","sndp"] );
+ t( "Nth-child (with whitespace)", "p:nth-child( 1 )", ["firstp","sndp"] );
+ t( "Nth-child (case-insensitive)", "#form select:first option:NTH-child(3)", ["option1c"] );
+ t( "Not nth-child", "#qunit-fixture p:not(:nth-child(1))", ["ap","en","sap","first"] );
+
+ t( "Nth-child(2)", "#qunit-fixture form#form > *:nth-child(2)", ["text1"] );
+ t( "Nth-child(2)", "#qunit-fixture form#form > :nth-child(2)", ["text1"] );
+
+ t( "Nth-child(-1)", "#form select:first option:nth-child(-1)", [] );
+ t( "Nth-child(3)", "#form select:first option:nth-child(3)", ["option1c"] );
+ t( "Nth-child(0n+3)", "#form select:first option:nth-child(0n+3)", ["option1c"] );
+ t( "Nth-child(1n+0)", "#form select:first option:nth-child(1n+0)", ["option1a", "option1b", "option1c", "option1d"] );
+ t( "Nth-child(1n)", "#form select:first option:nth-child(1n)", ["option1a", "option1b", "option1c", "option1d"] );
+ t( "Nth-child(n)", "#form select:first option:nth-child(n)", ["option1a", "option1b", "option1c", "option1d"] );
+ t( "Nth-child(even)", "#form select:first option:nth-child(even)", ["option1b", "option1d"] );
+ t( "Nth-child(odd)", "#form select:first option:nth-child(odd)", ["option1a", "option1c"] );
+ t( "Nth-child(2n)", "#form select:first option:nth-child(2n)", ["option1b", "option1d"] );
+ t( "Nth-child(2n+1)", "#form select:first option:nth-child(2n+1)", ["option1a", "option1c"] );
+ t( "Nth-child(2n + 1)", "#form select:first option:nth-child(2n + 1)", ["option1a", "option1c"] );
+ t( "Nth-child(+2n + 1)", "#form select:first option:nth-child(+2n + 1)", ["option1a", "option1c"] );
+ t( "Nth-child(3n)", "#form select:first option:nth-child(3n)", ["option1c"] );
+ t( "Nth-child(3n+1)", "#form select:first option:nth-child(3n+1)", ["option1a", "option1d"] );
+ t( "Nth-child(3n+2)", "#form select:first option:nth-child(3n+2)", ["option1b"] );
+ t( "Nth-child(3n+3)", "#form select:first option:nth-child(3n+3)", ["option1c"] );
+ t( "Nth-child(3n-1)", "#form select:first option:nth-child(3n-1)", ["option1b"] );
+ t( "Nth-child(3n-2)", "#form select:first option:nth-child(3n-2)", ["option1a", "option1d"] );
+ t( "Nth-child(3n-3)", "#form select:first option:nth-child(3n-3)", ["option1c"] );
+ t( "Nth-child(3n+0)", "#form select:first option:nth-child(3n+0)", ["option1c"] );
+ t( "Nth-child(-1n+3)", "#form select:first option:nth-child(-1n+3)", ["option1a", "option1b", "option1c"] );
+ t( "Nth-child(-n+3)", "#form select:first option:nth-child(-n+3)", ["option1a", "option1b", "option1c"] );
+ t( "Nth-child(-1n + 3)", "#form select:first option:nth-child(-1n + 3)", ["option1a", "option1b", "option1c"] );
+
+ deepEqual( Sizzle( ":nth-child(n)", null, null, [ document.createElement("a") ].concat( q("ap") ) ), q("ap"), "Seeded nth-child" );
+});
+
+test("pseudo - nth-last-child", function() {
+ expect( 30 );
+
+ t( "Nth-last-child", "form:nth-last-child(5)", ["testForm"] );
+ t( "Nth-last-child (with whitespace)", "form:nth-last-child( 5 )", ["testForm"] );
+ t( "Nth-last-child (case-insensitive)", "#form select:first option:NTH-last-child(3)", ["option1b"] );
+ t( "Not nth-last-child", "#qunit-fixture p:not(:nth-last-child(1))", ["firstp", "ap", "sndp", "en", "first"] );
+
+ t( "Nth-last-child(-1)", "#form select:first option:nth-last-child(-1)", [] );
+ t( "Nth-last-child(3)", "#form select:first :nth-last-child(3)", ["option1b"] );
+ t( "Nth-last-child(3)", "#form select:first *:nth-last-child(3)", ["option1b"] );
+ t( "Nth-last-child(3)", "#form select:first option:nth-last-child(3)", ["option1b"] );
+ t( "Nth-last-child(0n+3)", "#form select:first option:nth-last-child(0n+3)", ["option1b"] );
+ t( "Nth-last-child(1n+0)", "#form select:first option:nth-last-child(1n+0)", ["option1a", "option1b", "option1c", "option1d"] );
+ t( "Nth-last-child(1n)", "#form select:first option:nth-last-child(1n)", ["option1a", "option1b", "option1c", "option1d"] );
+ t( "Nth-last-child(n)", "#form select:first option:nth-last-child(n)", ["option1a", "option1b", "option1c", "option1d"] );
+ t( "Nth-last-child(even)", "#form select:first option:nth-last-child(even)", ["option1a", "option1c"] );
+ t( "Nth-last-child(odd)", "#form select:first option:nth-last-child(odd)", ["option1b", "option1d"] );
+ t( "Nth-last-child(2n)", "#form select:first option:nth-last-child(2n)", ["option1a", "option1c"] );
+ t( "Nth-last-child(2n+1)", "#form select:first option:nth-last-child(2n+1)", ["option1b", "option1d"] );
+ t( "Nth-last-child(2n + 1)", "#form select:first option:nth-last-child(2n + 1)", ["option1b", "option1d"] );
+ t( "Nth-last-child(+2n + 1)", "#form select:first option:nth-last-child(+2n + 1)", ["option1b", "option1d"] );
+ t( "Nth-last-child(3n)", "#form select:first option:nth-last-child(3n)", ["option1b"] );
+ t( "Nth-last-child(3n+1)", "#form select:first option:nth-last-child(3n+1)", ["option1a", "option1d"] );
+ t( "Nth-last-child(3n+2)", "#form select:first option:nth-last-child(3n+2)", ["option1c"] );
+ t( "Nth-last-child(3n+3)", "#form select:first option:nth-last-child(3n+3)", ["option1b"] );
+ t( "Nth-last-child(3n-1)", "#form select:first option:nth-last-child(3n-1)", ["option1c"] );
+ t( "Nth-last-child(3n-2)", "#form select:first option:nth-last-child(3n-2)", ["option1a", "option1d"] );
+ t( "Nth-last-child(3n-3)", "#form select:first option:nth-last-child(3n-3)", ["option1b"] );
+ t( "Nth-last-child(3n+0)", "#form select:first option:nth-last-child(3n+0)", ["option1b"] );
+ t( "Nth-last-child(-1n+3)", "#form select:first option:nth-last-child(-1n+3)", ["option1b", "option1c", "option1d"] );
+ t( "Nth-last-child(-n+3)", "#form select:first option:nth-last-child(-n+3)", ["option1b", "option1c", "option1d"] );
+ t( "Nth-last-child(-1n + 3)", "#form select:first option:nth-last-child(-1n + 3)", ["option1b", "option1c", "option1d"] );
+
+ deepEqual( Sizzle( ":nth-last-child(n)", null, null, [ document.createElement("a") ].concat( q("ap") ) ), q("ap"), "Seeded nth-last-child" );
+});
+
+test("pseudo - nth-of-type", function() {
+ expect( 9 );
+ t( "Nth-of-type(-1)", ":nth-of-type(-1)", [] );
+ t( "Nth-of-type(3)", "#ap :nth-of-type(3)", ["mark"] );
+ t( "Nth-of-type(n)", "#ap :nth-of-type(n)", ["google", "groups", "code1", "anchor1", "mark"] );
+ t( "Nth-of-type(0n+3)", "#ap :nth-of-type(0n+3)", ["mark"] );
+ t( "Nth-of-type(2n)", "#ap :nth-of-type(2n)", ["groups"] );
+ t( "Nth-of-type(even)", "#ap :nth-of-type(even)", ["groups"] );
+ t( "Nth-of-type(2n+1)", "#ap :nth-of-type(2n+1)", ["google", "code1", "anchor1", "mark"] );
+ t( "Nth-of-type(odd)", "#ap :nth-of-type(odd)", ["google", "code1", "anchor1", "mark"] );
+ t( "Nth-of-type(-n+2)", "#qunit-fixture > :nth-of-type(-n+2)", ["firstp", "ap", "foo", "nothiddendiv", "name+value", "firstUL", "empty", "form", "floatTest", "iframe", "lengthtest", "table"] );
+});
+
+test("pseudo - nth-last-of-type", function() {
+ expect( 9 );
+ t( "Nth-last-of-type(-1)", ":nth-last-of-type(-1)", [] );
+ t( "Nth-last-of-type(3)", "#ap :nth-last-of-type(3)", ["google"] );
+ t( "Nth-last-of-type(n)", "#ap :nth-last-of-type(n)", ["google", "groups", "code1", "anchor1", "mark"] );
+ t( "Nth-last-of-type(0n+3)", "#ap :nth-last-of-type(0n+3)", ["google"] );
+ t( "Nth-last-of-type(2n)", "#ap :nth-last-of-type(2n)", ["groups"] );
+ t( "Nth-last-of-type(even)", "#ap :nth-last-of-type(even)", ["groups"] );
+ t( "Nth-last-of-type(2n+1)", "#ap :nth-last-of-type(2n+1)", ["google", "code1", "anchor1", "mark"] );
+ t( "Nth-last-of-type(odd)", "#ap :nth-last-of-type(odd)", ["google", "code1", "anchor1", "mark"] );
+ t( "Nth-last-of-type(-n+2)", "#qunit-fixture > :nth-last-of-type(-n+2)", ["ap", "name+value", "first", "firstUL", "empty", "floatTest", "iframe", "table", "name-tests", "testForm", "liveHandlerOrder", "siblingTest"] );
+});
+
+test("pseudo - has", function() {
+ expect( 3 );
+
+ t( "Basic test", "p:has(a)", ["firstp","ap","en","sap"] );
+ t( "Basic test (irrelevant whitespace)", "p:has( a )", ["firstp","ap","en","sap"] );
+ t( "Nested with overlapping candidates", "#qunit-fixture div:has(div:has(div:not([id])))", [ "moretests", "t2037" ] );
+});
+
+test("pseudo - misc", function() {
+ expect( 39 );
+
+ var select, tmp, input;
+
+ t( "Headers", ":header", ["qunit-header", "qunit-banner", "qunit-userAgent"] );
+ t( "Headers(case-insensitive)", ":Header", ["qunit-header", "qunit-banner", "qunit-userAgent"] );
+ t( "Multiple matches with the same context (cache check)", "#form select:has(option:first-child:contains('o'))", ["select1", "select2", "select3", "select4"] );
+
+ ok( Sizzle("#qunit-fixture :not(:has(:has(*)))").length, "All not grandparents" );
+
+ select = document.getElementById("select1");
+ ok( Sizzle.matchesSelector( select, ":has(option)" ), "Has Option Matches" );
+
+ ok( Sizzle("a:contains('')").length, "Empty string contains" );
+ t( "Text Contains", "a:contains(Google)", ["google","groups"] );
+ t( "Text Contains", "a:contains(Google Groups)", ["groups"] );
+
+ t( "Text Contains", "a:contains('Google Groups (Link)')", ["groups"] );
+ t( "Text Contains", "a:contains(\"(Link)\")", ["groups"] );
+ t( "Text Contains", "a:contains(Google Groups (Link))", ["groups"] );
+ t( "Text Contains", "a:contains((Link))", ["groups"] );
+
+
+ tmp = document.createElement("div");
+ tmp.id = "tmp_input";
+ document.body.appendChild( tmp );
+
+ jQuery.each( [ "button", "submit", "reset" ], function( i, type ) {
+ var els = jQuery(
+ "<input id='input_%' type='%'/><button id='button_%' type='%'>test</button>"
+ .replace( /%/g, type )
+ ).appendTo( tmp );
+
+ t( "Input Buttons :" + type, "#tmp_input :" + type, [ "input_" + type, "button_" + type ] );
+
+ ok( Sizzle.matchesSelector( els[0], ":" + type ), "Input Matches :" + type );
+ ok( Sizzle.matchesSelector( els[1], ":" + type ), "Button Matches :" + type );
+ });
+
+ document.body.removeChild( tmp );
+
+ // Recreate tmp
+ tmp = document.createElement("div");
+ tmp.id = "tmp_input";
+ tmp.innerHTML = "<span>Hello I am focusable.</span>";
+ // Setting tabIndex should make the element focusable
+ // http://dev.w3.org/html5/spec/single-page.html#focus-management
+ document.body.appendChild( tmp );
+ tmp.tabIndex = 0;
+ tmp.focus();
+ if ( document.activeElement !== tmp || (document.hasFocus && !document.hasFocus()) ||
+ (document.querySelectorAll && !document.querySelectorAll("div:focus").length) ) {
+ ok( true, "The div was not focused. Skip checking the :focus match." );
+ ok( true, "The div was not focused. Skip checking the :focus match." );
+ } else {
+ t( "tabIndex element focused", ":focus", [ "tmp_input" ] );
+ ok( Sizzle.matchesSelector( tmp, ":focus" ), ":focus matches tabIndex div" );
+ }
+
+ // Blur tmp
+ tmp.blur();
+ document.body.focus();
+ ok( !Sizzle.matchesSelector( tmp, ":focus" ), ":focus doesn't match tabIndex div" );
+ document.body.removeChild( tmp );
+
+ // Input focus/active
+ input = document.createElement("input");
+ input.type = "text";
+ input.id = "focus-input";
+
+ document.body.appendChild( input );
+ input.focus();
+
+ // Inputs can't be focused unless the document has focus
+ if ( document.activeElement !== input || (document.hasFocus && !document.hasFocus()) ||
+ (document.querySelectorAll && !document.querySelectorAll("input:focus").length) ) {
+ ok( true, "The input was not focused. Skip checking the :focus match." );
+ ok( true, "The input was not focused. Skip checking the :focus match." );
+ } else {
+ t( "Element focused", "input:focus", [ "focus-input" ] );
+ ok( Sizzle.matchesSelector( input, ":focus" ), ":focus matches" );
+ }
+
+ input.blur();
+
+ // When IE is out of focus, blur does not work. Force it here.
+ if ( document.activeElement === input ) {
+ document.body.focus();
+ }
+
+ ok( !Sizzle.matchesSelector( input, ":focus" ), ":focus doesn't match" );
+ document.body.removeChild( input );
+
+
+
+ deepEqual(
+ Sizzle( "[id='select1'] *:not(:last-child), [id='select2'] *:not(:last-child)", q("qunit-fixture")[0] ),
+ q( "option1a", "option1b", "option1c", "option2a", "option2b", "option2c" ),
+ "caching system tolerates recursive selection"
+ );
+
+ // Tokenization edge cases
+ t( "Sequential pseudos", "#qunit-fixture p:has(:contains(mark)):has(code)", ["ap"] );
+ t( "Sequential pseudos", "#qunit-fixture p:has(:contains(mark)):has(code):contains(This link)", ["ap"] );
+
+ t( "Pseudo argument containing ')'", "p:has(>a.GROUPS[src!=')'])", ["ap"] );
+ t( "Pseudo argument containing ')'", "p:has(>a.GROUPS[src!=')'])", ["ap"] );
+ t( "Pseudo followed by token containing ')'", "p:contains(id=\"foo\")[id!=\\)]", ["sndp"] );
+ t( "Pseudo followed by token containing ')'", "p:contains(id=\"foo\")[id!=')']", ["sndp"] );
+
+ t( "Multi-pseudo", "#ap:has(*), #ap:has(*)", ["ap"] );
+ t( "Multi-positional", "#ap:gt(0), #ap:lt(1)", ["ap"] );
+ t( "Multi-pseudo with leading nonexistent id", "#nonexistent:has(*), #ap:has(*)", ["ap"] );
+ t( "Multi-positional with leading nonexistent id", "#nonexistent:gt(0), #ap:lt(1)", ["ap"] );
+
+ t( "Tokenization stressor", "a[class*=blog]:not(:has(*, :contains(!)), :contains(!)), br:contains(]), p:contains(]), :not(:empty):not(:parent)", ["ap", "mark","yahoo","simon"] );
+});
+
+
+test("pseudo - :not", function() {
+ expect( 43 );
+
+ t( "Not", "a.blog:not(.link)", ["mark"] );
+ t( ":not() with :first", "#foo p:not(:first) .link", ["simon"] );
+
+ t( "Not - multiple", "#form option:not(:contains(Nothing),#option1b,:selected)", ["option1c", "option1d", "option2b", "option2c", "option3d", "option3e", "option4e", "option5b", "option5c"] );
+ t( "Not - recursive", "#form option:not(:not(:selected))[id^='option3']", [ "option3b", "option3c"] );
+
+ t( ":not() failing interior", "#qunit-fixture p:not(.foo)", ["firstp","ap","sndp","en","sap","first"] );
+ t( ":not() failing interior", "#qunit-fixture p:not(div.foo)", ["firstp","ap","sndp","en","sap","first"] );
+ t( ":not() failing interior", "#qunit-fixture p:not(p.foo)", ["firstp","ap","sndp","en","sap","first"] );
+ t( ":not() failing interior", "#qunit-fixture p:not(#blargh)", ["firstp","ap","sndp","en","sap","first"] );
+ t( ":not() failing interior", "#qunit-fixture p:not(div#blargh)", ["firstp","ap","sndp","en","sap","first"] );
+ t( ":not() failing interior", "#qunit-fixture p:not(p#blargh)", ["firstp","ap","sndp","en","sap","first"] );
+
+ t( ":not Multiple", "#qunit-fixture p:not(a)", ["firstp","ap","sndp","en","sap","first"] );
+ t( ":not Multiple", "#qunit-fixture p:not( a )", ["firstp","ap","sndp","en","sap","first"] );
+ t( ":not Multiple", "#qunit-fixture p:not( p )", [] );
+ t( ":not Multiple", "#qunit-fixture p:not(a, b)", ["firstp","ap","sndp","en","sap","first"] );
+ t( ":not Multiple", "#qunit-fixture p:not(a, b, div)", ["firstp","ap","sndp","en","sap","first"] );
+ t( ":not Multiple", "p:not(p)", [] );
+ t( ":not Multiple", "p:not(a,p)", [] );
+ t( ":not Multiple", "p:not(p,a)", [] );
+ t( ":not Multiple", "p:not(a,p,b)", [] );
+ t( ":not Multiple", ":input:not(:image,:input,:submit)", [] );
+ t( ":not Multiple", "#qunit-fixture p:not(:has(a), :nth-child(1))", ["first"] );
+
+ t( "No element not selector", ".container div:not(.excluded) div", [] );
+
+ t( ":not() Existing attribute", "#form select:not([multiple])", ["select1", "select2", "select5"]);
+ t( ":not() Equals attribute", "#form select:not([name=select1])", ["select2", "select3", "select4","select5"]);
+ t( ":not() Equals quoted attribute", "#form select:not([name='select1'])", ["select2", "select3", "select4", "select5"]);
+
+ t( ":not() Multiple Class", "#foo a:not(.blog)", ["yahoo", "anchor2"] );
+ t( ":not() Multiple Class", "#foo a:not(.link)", ["yahoo", "anchor2"] );
+ t( ":not() Multiple Class", "#foo a:not(.blog.link)", ["yahoo", "anchor2"] );
+
+ t( ":not chaining (compound)", "#qunit-fixture div[id]:not(:has(div, span)):not(:has(*))", ["nothiddendivchild", "divWithNoTabIndex"] );
+ t( ":not chaining (with attribute)", "#qunit-fixture form[id]:not([action$='formaction']):not(:button)", ["lengthtest", "name-tests", "testForm"] );
+ t( ":not chaining (colon in attribute)", "#qunit-fixture form[id]:not([action='form:action']):not(:button)", ["form", "lengthtest", "name-tests", "testForm"] );
+ t( ":not chaining (colon in attribute and nested chaining)", "#qunit-fixture form[id]:not([action='form:action']:button):not(:input)", ["form", "lengthtest", "name-tests", "testForm"] );
+ t( ":not chaining", "#form select:not(.select1):contains(Nothing) > option:not(option)", [] );
+
+ t( "positional :not()", "#foo p:not(:last)", ["sndp", "en"] );
+ t( "positional :not() prefix", "#foo p:not(:last) a", ["yahoo"] );
+ t( "compound positional :not()", "#foo p:not(:first, :last)", ["en"] );
+ t( "compound positional :not()", "#foo p:not(:first, :even)", ["en"] );
+ t( "compound positional :not()", "#foo p:not(:first, :odd)", ["sap"] );
+ t( "reordered compound positional :not()", "#foo p:not(:odd, :first)", ["sap"] );
+
+ t( "positional :not() with pre-filter", "#foo p:not([id]:first)", ["en", "sap"] );
+ t( "positional :not() with post-filter", "#foo p:not(:first[id])", ["en", "sap"] );
+ t( "positional :not() with pre-filter", "#foo p:not([lang]:first)", ["sndp", "sap"] );
+ t( "positional :not() with post-filter", "#foo p:not(:first[lang])", ["sndp", "en", "sap"] );
+});
+
+test("pseudo - position", function() {
+ expect( 33 );
+
+ t( "First element", "div:first", ["qunit"] );
+ t( "First element(case-insensitive)", "div:fiRst", ["qunit"] );
+ t( "nth Element", "#qunit-fixture p:nth(1)", ["ap"] );
+ t( "First Element", "#qunit-fixture p:first", ["firstp"] );
+ t( "Last Element", "p:last", ["first"] );
+ t( "Even Elements", "#qunit-fixture p:even", ["firstp","sndp","sap"] );
+ t( "Odd Elements", "#qunit-fixture p:odd", ["ap","en","first"] );
+ t( "Position Equals", "#qunit-fixture p:eq(1)", ["ap"] );
+ t( "Position Equals (negative)", "#qunit-fixture p:eq(-1)", ["first"] );
+ t( "Position Greater Than", "#qunit-fixture p:gt(0)", ["ap","sndp","en","sap","first"] );
+ t( "Position Less Than", "#qunit-fixture p:lt(3)", ["firstp","ap","sndp"] );
+
+ t( "Check position filtering", "div#nothiddendiv:eq(0)", ["nothiddendiv"] );
+ t( "Check position filtering", "div#nothiddendiv:last", ["nothiddendiv"] );
+ t( "Check position filtering", "div#nothiddendiv:not(:gt(0))", ["nothiddendiv"] );
+ t( "Check position filtering", "#foo > :not(:first)", ["en", "sap"] );
+ t( "Check position filtering", "#qunit-fixture select > :not(:gt(2))", ["option1a", "option1b", "option1c"] );
+ t( "Check position filtering", "#qunit-fixture select:lt(2) :not(:first)", ["option1b", "option1c", "option1d", "option2a", "option2b", "option2c", "option2d"] );