Fixed issue where Element#match failed on attribute selectors with single or double quotes. Closes #10067. [Cezary Okupski, Andrew Dupont]
This commit is contained in:
parent
a5fe12b9a1
commit
7942a9e5c9
@ -1,5 +1,7 @@
|
||||
*SVN*
|
||||
|
||||
* Fixed issue where Element#match failed on attribute selectors with single or double quotes. Closes #10067. [Cezary Okupski, Andrew Dupont]
|
||||
|
||||
* Add tests for Element#match. [Tobie Langel]
|
||||
|
||||
* Fix Element#writeAttribute to work with 'cellspacing' and 'cellpadding' attributes in IE. Closes #9983. [/dev/urandom, Tobie Langel]
|
||||
|
@ -297,7 +297,7 @@ Object.extend(Selector, {
|
||||
|
||||
attr: function(element, matches) {
|
||||
var nodeValue = Element.readAttribute(element, matches[1]);
|
||||
return nodeValue && Selector.operators[matches[2]](nodeValue, matches[3]);
|
||||
return nodeValue && Selector.operators[matches[2]](nodeValue, matches[5] || matches[6]);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -249,6 +249,8 @@
|
||||
|
||||
assert(!$('link_2').match('a[rel^=external]'));
|
||||
assert($('link_1').match('a[rel^=external]'));
|
||||
assert($('link_1').match('a[rel^="external"]'));
|
||||
assert($('link_1').match("a[rel^='external']"));
|
||||
|
||||
assert(span.match({ match: function(element) { return true }}), 'custom selector');
|
||||
assert(!span.match({ match: function(element) { return false }}), 'custom selector');
|
||||
|
Loading…
Reference in New Issue
Block a user