Skip to content

Loading…

Support @page :blank pseudo-class #3

Merged
merged 2 commits into from

3 participants

@liZe

This pseudo class has been added by the "Generated Content for Paged Media" module.

@travisbot

This pull request passes (merged 8a22d61 into 7852a27).

@SimonSapin SimonSapin merged commit dfe68f4 into SimonSapin:master

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 23, 2012
  1. @liZe
  2. @liZe

    Add test for blank pages

    liZe committed
Showing with 4 additions and 2 deletions.
  1. +3 −2 tinycss/page3.py
  2. +1 −0 tinycss/tests/test_page3.py
View
5 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)
View
1 tinycss/tests/test_page3.py
@@ -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']),
Something went wrong with that request. Please try again.