From d2cf7f03bbd3652532ba4b0ee211a8fd0233b5b0 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Thu, 23 Aug 2012 23:49:45 +0200 Subject: [PATCH] Add support for @page:blank pseudo-class --- tinycss/page3.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tinycss/page3.py b/tinycss/page3.py index 1d1a51e..3c87860 100644 --- a/tinycss/page3.py +++ b/tinycss/page3.py @@ -130,7 +130,7 @@ def parse_page_selector(self, head): The ``head`` attribute of an unparsed :class:`AtRule`. :returns: A page selector. For CSS 2.1, this is 'first', 'left', 'right' - or None. + or None. 'blank' is added by GCPM. :raises: :class`~parsing.ParseError` on invalid selectors @@ -151,7 +151,8 @@ def parse_page_selector(self, head): and head[1].type == 'IDENT'): pseudo_class = head[1].value specificity = { - 'first': (1, 0), 'left': (0, 1), 'right': (0, 1), + 'first': (1, 0), 'blank': (1, 0), + 'left': (0, 1), 'right': (0, 1), }.get(pseudo_class) if specificity: return (name, pseudo_class), (name_specificity + specificity)