From 0dd4ba70f60fe814e7e335c04a44b1df21d8e6c2 Mon Sep 17 00:00:00 2001 From: Andrew Dupont Date: Tue, 16 Oct 2007 02:28:28 +0000 Subject: [PATCH] * 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] --- CHANGELOG | 4 +++- src/selector.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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,