diff --git a/CHANGELOG b/CHANGELOG index 9dde224..5c50899 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ *SVN* -* Changed Selector pattern match so that descendant combinators after pseudoclass tokens are properly handled. [wiktor, kangax, Andrew Dupont] +* Changed the Selector regex that tests whether the selector can be expressed in XPath; added :checked, since XPath can't detect all scenarios in which an is checked. Fixes #9776. [StelardActek, kangax, Andrew Dupont] + +* Changed Selector pattern match so that descendant combinators after pseudoclass tokens are properly handled. Fixes #9696. [wiktor, kangax, Andrew Dupont] * Make sure $w always returns an array. [Andrew Dupont, Tobie Langel] diff --git a/src/selector.js b/src/selector.js index bfb150e..56d7745 100644 --- a/src/selector.js +++ b/src/selector.js @@ -10,7 +10,7 @@ var Selector = Class.create({ compileMatcher: function() { // Selectors with namespaced attributes can't use the XPath version - if (Prototype.BrowserFeatures.XPath && !(/\[[\w-]*?:/).test(this.expression)) + if (Prototype.BrowserFeatures.XPath && !(/(\[[\w-]*?:|:checked)/).test(this.expression)) return this.compileXPathMatcher(); var e = this.expression, ps = Selector.patterns, h = Selector.handlers,