From 5fc9eac1edea42ec46422c6c7b017ee11c4a9531 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Thu, 3 Nov 2011 22:17:42 +0100 Subject: another fix for the 'descendant' problem in cssselect to undo a serious performance regression in 2.3.1 --HG-- extra : rebase_source : 2c4c89423870a16cc9aedc19532032d2a10bae5e --- CHANGES.txt | 16 ++++++++++++---- src/lxml/cssselect.py | 2 +- src/lxml/tests/test_css.txt | 6 +++--- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 195affbc..89b6c307 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -20,6 +20,13 @@ Features added Bugs fixed ---------- +* Fixed the "descendant" bug in cssselect a second time (after a first + fix in lxml 2.3.1). The previous change resulted in a serious + performance regression for the XPath based evaluation of the + translated expression. Note that this breaks the usage of some of + the generated XPath expressions as XSLT location paths that + previously worked in 2.3.1. + Other changes -------------- @@ -69,10 +76,11 @@ Bugs fixed * Assertion error in lxml.html.cleaner when discarding top-level elements. * In lxml.cssselect, use the xpath 'A//B' (short for - 'A/descendant-or-self::node()/B') instead of 'A/descendant::B' for the css - descendant selector ('A B'). This makes a few edge cases to be consistent - with the selector behavior in WebKit and Firefox, and makes more css - expressions valid location paths (for use in xsl:template match). + 'A/descendant-or-self::node()/B') instead of 'A/descendant::B' for + the css descendant selector ('A B'). This makes a few edge cases + like ``"div *:last-child"`` consistent with the selector behavior in + WebKit and Firefox, and makes more css expressions valid location + paths (for use in xsl:template match). * In lxml.html, non-selected ``