prototype: Allow Selector to correctly detect the presence of namespaced attributes. Closes #10987.

This commit is contained in:
Tobie Langel 2008-02-03 19:45:32 +00:00
parent ea9d81eea1
commit f4d68350f3
3 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,5 @@
* Allow Selector to correctly detect the presence of namespaced attributes. Closes #10987. [Samuel Lebeau, Tobie Langel]
* Make Element#absolutize and Element#relativize always return element. Closes #10983. [kangax]
* Add deprecation extension. [Tobie Langel]

View File

@ -273,7 +273,7 @@ Object.extend(Selector, {
className: /^\.([\w\-\*]+)(\b|$)/,
pseudo:
/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/,
attrPresence: /^\[([\w]+)\]/,
attrPresence: /^\[((?:[\w]+:)?[\w]+)\]/,
attr: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/
},

View File

@ -268,6 +268,9 @@
assertUndefined(new Selector('body p[xml:lang]').xpath);
} else
info("Could not test XPath bypass: no XPath to begin with!");
assertElementsMatch($$('[xml:lang]'), 'html', '#item_3');
assertElementsMatch($$('*[xml:lang]'), 'html', '#item_3');
}},
testSelectorWithChild: function() { with(this) {