Added a fix for empty attribute selection values. Fixes jQuery bug #3990.
This commit is contained in:
parent
31597b7b3c
commit
f38648c7cd
2 changed files with 5 additions and 2 deletions
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
(function(){
|
(function(){
|
||||||
|
|
||||||
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]+['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,
|
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,
|
||||||
done = 0,
|
done = 0,
|
||||||
toString = Object.prototype.toString;
|
toString = Object.prototype.toString;
|
||||||
|
|
||||||
|
|
|
@ -215,7 +215,7 @@ test("child and adjacent", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("attributes", function() {
|
test("attributes", function() {
|
||||||
expect(35);
|
expect(37);
|
||||||
t( "Attribute Exists", "a[title]", ["google"] );
|
t( "Attribute Exists", "a[title]", ["google"] );
|
||||||
t( "Attribute Exists", "*[title]", ["google"] );
|
t( "Attribute Exists", "*[title]", ["google"] );
|
||||||
t( "Attribute Exists", "[title]", ["google"] );
|
t( "Attribute Exists", "[title]", ["google"] );
|
||||||
|
@ -253,6 +253,9 @@ test("attributes", function() {
|
||||||
t( "Attribute Contains", "a[href *= 'google']", ["google","groups"] );
|
t( "Attribute Contains", "a[href *= 'google']", ["google","groups"] );
|
||||||
t( "Attribute Is Not Equal", "#ap a[hreflang!='en']", ["google","groups","anchor1"] );
|
t( "Attribute Is Not Equal", "#ap a[hreflang!='en']", ["google","groups","anchor1"] );
|
||||||
|
|
||||||
|
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", "#select1 option:selected", ["option1a"] );
|
||||||
t("Select options via :selected", "#select2 option:selected", ["option2d"] );
|
t("Select options via :selected", "#select2 option:selected", ["option2d"] );
|
||||||
t("Select options via :selected", "#select3 option:selected", ["option3b", "option3c"] );
|
t("Select options via :selected", "#select3 option:selected", ["option3b", "option3c"] );
|
||||||
|
|
Loading…
Reference in a new issue