diff options
| author | Simon Sapin <simon.sapin@exyr.org> | 2011-12-14 13:57:07 +0100 |
|---|---|---|
| committer | Simon Sapin <simon.sapin@exyr.org> | 2011-12-14 13:57:07 +0100 |
| commit | f4e1cbb9d398ececca797c0dd2ad684f36cc951a (patch) | |
| tree | 46f6a0d8f802e60a65089b79455825d36907a51a /src/lxml/cssselect.py | |
| parent | 8064b31df33c64a28cfd9eeae9316e9c26b8c6ab (diff) | |
| download | python-lxml-f4e1cbb9d398ececca797c0dd2ad684f36cc951a.tar.gz | |
Add support for the :root pseudo-class in cssselect.
Diffstat (limited to 'src/lxml/cssselect.py')
| -rw-r--r-- | src/lxml/cssselect.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lxml/cssselect.py b/src/lxml/cssselect.py index 8b738bf8..63dada1b 100644 --- a/src/lxml/cssselect.py +++ b/src/lxml/cssselect.py @@ -300,8 +300,8 @@ class Pseudo(object): return xpath def _xpath_root(self, xpath): - # if this element is the root element - raise NotImplementedError + xpath.add_condition("not(parent::*)") + return xpath def _xpath_first_child(self, xpath): xpath.add_star_prefix() |
