From 529203f6b576aa15201485dd8d704109aa543f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Zaefferer?= Date: Sat, 16 Sep 2006 14:57:15 +0000 Subject: [PATCH] Fixed bug #194, added regression tests --- build/test/index.html | 2 +- src/jquery/jquery.js | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/build/test/index.html b/build/test/index.html index 31bf43d32..9ee1d4e4e 100644 --- a/build/test/index.html +++ b/build/test/index.html @@ -39,7 +39,7 @@ - + diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 11cd56e6a..69628b37f 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -1522,9 +1522,9 @@ jQuery.extend({ "@": { "=": "z==m[4]", "!=": "z!=m[4]", - "^=": "!z.indexOf(m[4])", - "$=": "z.substr(z.length - m[4].length,m[4].length)==m[4]", - "*=": "z.indexOf(m[4])>=0", + "^=": "z && !z.indexOf(m[4])", + "$=": "z && z.substr(z.length - m[4].length,m[4].length)==m[4]", + "*=": "z && z.indexOf(m[4])>=0", "": "z" }, "[": "jQuery.find(m[2],a).length" @@ -1583,6 +1583,11 @@ jQuery.extend({ * @test t( "Attribute Exists", "a[@title]", ["google"] ); * @test t( "Attribute Exists", "*[@title]", ["google"] ); * @test t( "Attribute Exists", "[@title]", ["google"] ); + * + * @test t( "Non-existing part of attribute [@name*=bla]", "[@name*=bla]", [] ); + * @test t( "Non-existing start of attribute [@name^=bla]", "[@name^=bla]", [] ); + * @test t( "Non-existing end of attribute [@name$=bla]", "[@name$=bla]", [] ); + * * @test t( "Attribute Equals", "a[@rel='bookmark']", ["simon1"] ); * @test t( "Attribute Equals", 'a[@rel="bookmark"]', ["simon1"] ); * @test t( "Attribute Equals", "a[@rel=bookmark]", ["simon1"] );