prototype: Test for attribute existence before applying more complex CSS3 selectors. Closes #10870.
This commit is contained in:
parent
c200c27f48
commit
dcada47c6d
|
@ -1,6 +1,8 @@
|
|||
*SVN*
|
||||
|
||||
* Fix "function $A" declaration inside of a conditional (confuses IE). Fixes #10882. [Jacco, Andrew Dupont]
|
||||
* Test for attribute existence before applying more complex CSS3 selectors. Closes #10870. [arty, Tobie Langel]
|
||||
|
||||
* Fix "function $A" declaration inside of a conditional (confuses IE). Closes #10882. [Jacco, Andrew Dupont]
|
||||
|
||||
* Fixed selector parsing so that "#foo [bar=baz]" is treated the same way as "#foo *[bar=baz]". Closes #10734. [jlukas, kangax, Andrew Dupont]
|
||||
|
||||
|
|
|
@ -297,7 +297,7 @@ Object.extend(Selector, {
|
|||
|
||||
attr: function(element, matches) {
|
||||
var nodeValue = Element.readAttribute(element, matches[1]);
|
||||
return Selector.operators[matches[2]](nodeValue, matches[3]);
|
||||
return nodeValue && Selector.operators[matches[2]](nodeValue, matches[3]);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -245,6 +245,9 @@
|
|||
assert(!span.match('span span'), 'different ancestry');
|
||||
assert(!span.match('span > span'), 'different parent');
|
||||
assert(!span.match('span:nth-child(5)'), 'different pseudoclass');
|
||||
|
||||
assert(!$('link_2').match('a[rel^=external]'));
|
||||
assert($('link_1').match('a[rel^=external]'));
|
||||
}},
|
||||
|
||||
testSelectorWithSpaceInAttributeValue: function() {with(this) {
|
||||
|
|
Loading…
Reference in New Issue