diff --git a/CHANGELOG b/CHANGELOG index 2b07457..11c52ca 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Fix Selector to match elements with attributes containing hyphens. [#285 state:resolved] (leiyou, jddalton, kangax) + * Make sure Form.reset always returns a reference to the receiver element. [#309 state:resolved] (Phil, kangax) * Escape ":" and "." characters when doing contextual CSS selection in browsers that support querySelectorAll. [#559 state:resolved] (fxtentacle, Andrew Dupont) diff --git a/src/dom/selector.js b/src/dom/selector.js index 331299d..158877c 100644 --- a/src/dom/selector.js +++ b/src/dom/selector.js @@ -340,7 +340,7 @@ Object.extend(Selector, { { name: 'id', re: /^#([\w\-\*]+)(\b|$)/ }, { name: 'className', re: /^\.([\w\-\*]+)(\b|$)/ }, { name: 'pseudo', re: /^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/ }, - { name: 'attrPresence', re: /^\[((?:[\w]+:)?[\w]+)\]/ }, + { name: 'attrPresence', re: /^\[((?:[\w-]+:)?[\w]+)\]/ }, { name: 'attr', re: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/ } ], diff --git a/test/unit/fixtures/selector.html b/test/unit/fixtures/selector.html index d745c8f..cad88a6 100644 --- a/test/unit/fixtures/selector.html +++ b/test/unit/fixtures/selector.html @@ -66,4 +66,6 @@