Skip to content
This repository has been archived by the owner on Sep 18, 2019. It is now read-only.

Support @page :blank pseudo-class #3

Merged
merged 2 commits into from Sep 12, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions tinycss/page3.py
Expand Up @@ -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

Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions tinycss/tests/test_page3.py
Expand Up @@ -24,6 +24,7 @@
('@page :first {}', (None, 'first'), (0, 1, 0), []),
('@page:left{}', (None, 'left'), (0, 0, 1), []),
('@page :right {}', (None, 'right'), (0, 0, 1), []),
('@page :blank{}', (None, 'blank'), (0, 1, 0), []),
('@page :last {}', None, None, ['invalid @page selector']),
('@page : first {}', None, None, ['invalid @page selector']),

Expand Down