Package cssutils :: Package css :: Module csspagerule :: Class CSSPageRule |
[hide private]
[frames] | no frames]

# Class CSSPageRule

source code

     object --+
              |
      util.Base --+
                  |
    cssrule.CSSRule --+
                      |
                     CSSPageRule

The CSSPageRule interface represents a @page rule within a CSS style sheet. The @page rule is used to specify the dimensions, orientation, margins, etc. of a page box for paged media.

# Properties

cssText: of type DOMString
  The parsable textual representation of this rule
selectorText: of type DOMString
  The parsable textual representation of the page selector for the rule.
style: of type CSSStyleDeclaration
  The declaration-block of this rule.

## cssutils only

atkeyword:
  the literal keyword used

Inherits properties from CSSRule

# Format

    page
      : PAGE_SYM S* pseudo_page? S*
        LBRACE S* declaration [ ';' S* declaration ]* '}' S*
      ;
    pseudo_page
      : ':' IDENT # :first, :left, :right in CSS 2.1
      ;

Nested Classes | [hide private]
Inherited from `util.Base` (private): `_prods`

Instance Methods | [hide private]
__init__(self, selectorText=None, style=None, readonly=False) if readonly allows setting of properties in constructor only | source code
__parseSelectorText(self, selectorText) parses selectorText which may also be a list of tokens and returns (selectorText, seq) | source code
_getCssText(self) returns serialized property cssText | source code
_setCssText(self, cssText) DOMException on setting | source code
_getSelectorText(self) wrapper for cssutils Selector object | source code
_setSelectorText(self, selectorText) wrapper for cssutils Selector object | source code
_getStyle(self) | source code
_setStyle(self, style) StyleDeclaration or string | source code
__repr__(self) repr(x) | source code
__str__(self) str(x) | source code
Inherited from `cssrule.CSSRule` (private): `_getTypeString` Inherited from `util.Base` (private): `_checkReadonly`, `_getProductions`, `_newseq`, `_nexttoken`, `_parse`, `_tokenize2`, `_tokensupto2`, `_tokenvalue`, `_type`, `_valuestr` Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`

Static Methods | [hide private]
Inherited from `util.Base` (private): `_normalize`

Class Variables | [hide private]
| type = `6` The type of this rule, as defined by a CSSRule type constant.
Inherited from `cssrule.CSSRule`: `COMMENT`, `FONT_FACE_RULE`, `UNKNOWN_RULE` Inherited from `cssrule.CSSRule` (private): `_typestrings` Inherited from `util.Base` (private): `_SHORTHANDPROPERTIES`, `_log`

Properties | [hide private]
| cssText (DOM) The parsable textual representation of the rule.
| selectorText (DOM) The parsable textual representation of the page selector for the rule.
| style (DOM) The declaration-block of this rule set.
Inherited from `cssrule.CSSRule`: `typeString` Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, selectorText=None, style=None, readonly=False) (Constructor) | source code
if readonly allows setting of properties in constructor only selectorText type string style CSSStyleDeclaration for this CSSStyleRule Overrides: cssrule.CSSRule.__init__

### __parseSelectorText(self, selectorText) | source code
parses selectorText which may also be a list of tokens and returns (selectorText, seq) see _setSelectorText for details

### _getCssText(self) | source code
returns serialized property cssText Overrides: cssrule.CSSRule._getCssText

### _setCssText(self, cssText) | source code
DOMException on setting SYNTAX_ERR: (self, StyleDeclaration) Raised if the specified CSS string value has a syntax error and is unparsable. INVALID_MODIFICATION_ERR: (self) Raised if the specified CSS string value represents a different type of rule than the current one. HIERARCHY_REQUEST_ERR: (CSSStylesheet) Raised if the rule cannot be inserted at this point in the style sheet. NO_MODIFICATION_ALLOWED_ERR: (CSSRule) Raised if the rule is readonly. Overrides: cssrule.CSSRule._setCssText

### _setSelectorText(self, selectorText) | source code
wrapper for cssutils Selector object selector: DOM String in CSS 2.1 one of - :first - :left - :right - empty If WS or Comments are included they are ignored here! Only way to add a comment is via setting `cssText` DOMException on setting SYNTAX_ERR: Raised if the specified CSS string value has a syntax error and is unparsable. NO_MODIFICATION_ALLOWED_ERR: (self) Raised if this rule is readonly.

### __repr__(self) (Representation operator) | source code
repr(x) Overrides: object.__repr__ (inherited documentation)

### __str__(self) (Informal representation operator) | source code
str(x) Overrides: object.__str__ (inherited documentation)

Property Details | [hide private]

  ### cssText (DOM) The parsable textual representation of the rule. Get Method: cssutils.css.csspagerule.CSSPageRule._getCssText(self) - returns serialized property cssText Set Method: cssutils.css.csspagerule.CSSPageRule._setCssText(self, cssText) - DOMException on setting Delete Method:
      None

  ### selectorText (DOM) The parsable textual representation of the page selector for the rule. Get Method: cssutils.css.csspagerule.CSSPageRule._getSelectorText(self) - wrapper for cssutils Selector object Set Method: cssutils.css.csspagerule.CSSPageRule._setSelectorText(self, selectorText) - wrapper for cssutils Selector object Delete Method:
      None

  ### style (DOM) The declaration-block of this rule set. Get Method: cssutils.css.csspagerule.CSSPageRule._getStyle(self) Set Method: cssutils.css.csspagerule.CSSPageRule._setStyle(self, style) - StyleDeclaration or string Delete Method:
      None