~n-muench/+junk/cssutils

« back to all changes in this revision

Viewing changes to docs/html/docs/css.html

  • Committer: Nate Muench
  • Date: 2010-12-06 02:08:09 UTC
  • Revision ID: nowiwilldestroyabydos@gmail.com-20101206020809-nkwl4mwplqyb52nj
Version 0.9.7 Final

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
 
3
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
 
 
6
 
<html xmlns="http://www.w3.org/1999/xhtml">
7
 
  <head>
8
 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9
 
    
10
 
    <title>Package cssutils.css &mdash; cssutils v0.9.7b4 documentation</title>
11
 
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
12
 
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
13
 
    <script type="text/javascript">
14
 
      var DOCUMENTATION_OPTIONS = {
15
 
        URL_ROOT:    '../',
16
 
        VERSION:     '0.9.7b4',
17
 
        COLLAPSE_INDEX: false,
18
 
        FILE_SUFFIX: '.html',
19
 
        HAS_SOURCE:  true
20
 
      };
21
 
    </script>
22
 
    <script type="text/javascript" src="../_static/jquery.js"></script>
23
 
    <script type="text/javascript" src="../_static/underscore.js"></script>
24
 
    <script type="text/javascript" src="../_static/doctools.js"></script>
25
 
    <link rel="top" title="cssutils v0.9.7b4 documentation" href="../index.html" />
26
 
    <link rel="next" title="Package cssutils.stylesheets" href="stylesheets.html" />
27
 
    <link rel="prev" title="serializing CSS" href="serialize.html" /> 
28
 
  </head>
29
 
  <body>
30
 
    <div class="related">
31
 
      <h3>Navigation</h3>
32
 
      <ul>
33
 
        <li class="right" style="margin-right: 10px">
34
 
          <a href="../genindex.html" title="General Index"
35
 
             accesskey="I">index</a></li>
36
 
        <li class="right" >
37
 
          <a href="../py-modindex.html" title="Python Module Index"
38
 
             >modules</a> |</li>
39
 
        <li class="right" >
40
 
          <a href="stylesheets.html" title="Package cssutils.stylesheets"
41
 
             accesskey="N">next</a> |</li>
42
 
        <li class="right" >
43
 
          <a href="serialize.html" title="serializing CSS"
44
 
             accesskey="P">previous</a> |</li>
45
 
        <li><a href="../index.html">cssutils v0.9.7b4 documentation</a> &raquo;</li> 
46
 
      </ul>
47
 
    </div>  
48
 
 
49
 
    <div class="document">
50
 
      <div class="documentwrapper">
51
 
        <div class="bodywrapper">
52
 
          <div class="body">
53
 
            
54
 
  <div class="section" id="module-cssutils.css">
55
 
<span id="package-cssutils-css"></span><h1>Package <tt class="docutils literal"><span class="pre">cssutils.css</span></tt><a class="headerlink" href="#module-cssutils.css" title="Permalink to this headline">¶</a></h1>
56
 
<p>Classes implementing <a class="reference external" href="http://www.w3.org/TR/DOM-Level-2-Style/css.html">DOM Level 2 CSS</a> and <a class="reference external" href="http://www.w3.org/TR/css3-namespace/">CSS Module: Namespaces (W3C Working Draft 28 August 2006)</a></p>
57
 
<div class="section" id="cssstylesheet">
58
 
<h2><tt class="docutils literal"><span class="pre">CSSStyleSheet</span></tt><a class="headerlink" href="#cssstylesheet" title="Permalink to this headline">¶</a></h2>
59
 
<p>A CSSStyleSheet contains all rules. It consists of the different CSS rules like <a class="reference internal" href="#cssutils.css.CSSImportRule" title="cssutils.css.CSSImportRule"><tt class="xref py py-class docutils literal"><span class="pre">CSSImportRule</span></tt></a>, <a class="reference internal" href="#cssutils.css.CSSStyleRule" title="cssutils.css.CSSStyleRule"><tt class="xref py py-class docutils literal"><span class="pre">CSSStyleRule</span></tt></a> etc. It also defines the encoding of the style sheet used for serialization. The encoding might by set with an <a class="reference internal" href="#cssutils.css.CSSCharsetRule" title="cssutils.css.CSSCharsetRule"><tt class="xref py py-class docutils literal"><span class="pre">CSSCharsetRule</span></tt></a> rule or simpler with the <a class="reference internal" href="#cssutils.css.CSSStyleSheet.encoding" title="cssutils.css.CSSStyleSheet.encoding"><tt class="xref py py-attr docutils literal"><span class="pre">encoding</span></tt></a> attribute. The serialized sheet may be obtained from <a class="reference internal" href="#cssutils.css.CSSStyleSheet.cssText" title="cssutils.css.CSSStyleSheet.cssText"><tt class="xref py py-attr docutils literal"><span class="pre">cssText</span></tt></a>. All rules are present in <tt class="xref py py-attr docutils literal"><span class="pre">cssRules</span></tt>, a stylesheet iterates on its rules so this might be easier. Namespaces are available via <a class="reference internal" href="#cssutils.css.CSSStyleSheet.namespaces" title="cssutils.css.CSSStyleSheet.namespaces"><tt class="xref py py-attr docutils literal"><span class="pre">namespaces</span></tt></a> (do not rely on prefixes, see <a class="reference external" href="http://www.w3.org/TR/REC-xml-names/">http://www.w3.org/TR/REC-xml-names/</a> how these work). Variables are available via <a class="reference internal" href="#cssutils.css.CSSStyleSheet.variables" title="cssutils.css.CSSStyleSheet.variables"><tt class="xref py py-attr docutils literal"><span class="pre">variables</span></tt></a> which is a <a class="reference internal" href="#cssutils.css.CSSVariablesDeclaration" title="cssutils.css.CSSVariablesDeclaration"><tt class="xref py py-class docutils literal"><span class="pre">CSSVariablesDeclaration</span></tt></a> and contains <strong>all</strong> available variables including the ones defined in imported style sheets. Changes to this object do NOT change the parent sheet!</p>
60
 
<dl class="class">
61
 
<dt id="cssutils.css.CSSStyleSheet">
62
 
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSStyleSheet</tt><big>(</big><em>href=None</em>, <em>media=None</em>, <em>title=u''</em>, <em>disabled=None</em>, <em>ownerNode=None</em>, <em>parentStyleSheet=None</em>, <em>readonly=False</em>, <em>ownerRule=None</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleSheet" title="Permalink to this definition">¶</a></dt>
63
 
<dd><p>CSSStyleSheet represents a CSS style sheet.</p>
64
 
<p>Format:</p>
65
 
<div class="highlight-python"><pre>stylesheet
66
 
  : [ CHARSET_SYM S* STRING S* ';' ]?
67
 
    [S|CDO|CDC]* [ import [S|CDO|CDC]* ]*
68
 
    [ namespace [S|CDO|CDC]* ]* # according to @namespace WD
69
 
    [ [ ruleset | media | page ] [S|CDO|CDC]* ]*</pre>
70
 
</div>
71
 
<dl class="docutils">
72
 
<dt><tt class="docutils literal"><span class="pre">cssRules</span></tt></dt>
73
 
<dd>All Rules in this style sheet, a <a class="reference internal" href="#cssutils.css.CSSRuleList" title="cssutils.css.CSSRuleList"><tt class="xref py py-class docutils literal"><span class="pre">CSSRuleList</span></tt></a>.</dd>
74
 
</dl>
75
 
<dl class="method">
76
 
<dt id="cssutils.css.CSSStyleSheet.add">
77
 
<tt class="descname">add</tt><big>(</big><em>rule</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleSheet.add" title="Permalink to this definition">¶</a></dt>
78
 
<dd><p>Add <cite>rule</cite> to style sheet at appropriate position.
79
 
Same as <tt class="docutils literal"><span class="pre">insertRule(rule,</span> <span class="pre">inOrder=True)</span></tt>.</p>
80
 
</dd></dl>
81
 
 
82
 
<dl class="attribute">
83
 
<dt id="cssutils.css.CSSStyleSheet.alternate">
84
 
<tt class="descname">alternate</tt><a class="headerlink" href="#cssutils.css.CSSStyleSheet.alternate" title="Permalink to this definition">¶</a></dt>
85
 
<dd><p>Not used in cssutils yet.</p>
86
 
</dd></dl>
87
 
 
88
 
<dl class="attribute">
89
 
<dt id="cssutils.css.CSSStyleSheet.cssText">
90
 
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.CSSStyleSheet.cssText" title="Permalink to this definition">¶</a></dt>
91
 
<dd><p>Textual representation of the stylesheet (a byte string).</p>
92
 
</dd></dl>
93
 
 
94
 
<dl class="method">
95
 
<dt id="cssutils.css.CSSStyleSheet.deleteRule">
96
 
<tt class="descname">deleteRule</tt><big>(</big><em>index</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleSheet.deleteRule" title="Permalink to this definition">¶</a></dt>
97
 
<dd><p>Delete rule at <cite>index</cite> from the style sheet.</p>
98
 
<table class="docutils field-list" frame="void" rules="none">
99
 
<col class="field-name" />
100
 
<col class="field-body" />
101
 
<tbody valign="top">
102
 
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
103
 
<li><strong>index</strong> &#8211; <p>The <cite>index</cite> of the rule to be removed from the StyleSheet&#8217;s rule
104
 
list. For an <cite>index</cite> &lt; 0 <strong>no</strong> <a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.IndexSizeErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">IndexSizeErr</span></tt></a> is
105
 
raised but rules for normal Python lists are used. E.g. 
106
 
<tt class="docutils literal"><span class="pre">deleteRule(-1)</span></tt> removes the last rule in cssRules.</p>
107
 
<p><cite>index</cite> may also be a CSSRule object which will then be removed
108
 
from the StyleSheet.</p>
109
 
</li>
110
 
</ul>
111
 
</td>
112
 
</tr>
113
 
<tr class="field"><th class="field-name">Exceptions :</th><td class="field-body"><ul class="first last simple">
114
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.IndexSizeErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">IndexSizeErr</span></tt></a>:
115
 
Raised if the specified index does not correspond to a rule in
116
 
the style sheet&#8217;s rule list.</li>
117
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.NamespaceErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">NamespaceErr</span></tt></a>:
118
 
Raised if removing this rule would result in an invalid StyleSheet</li>
119
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.NoModificationAllowedErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">NoModificationAllowedErr</span></tt></a>:
120
 
Raised if this style sheet is readonly.</li>
121
 
</ul>
122
 
</td>
123
 
</tr>
124
 
</tbody>
125
 
</table>
126
 
</dd></dl>
127
 
 
128
 
<dl class="attribute">
129
 
<dt id="cssutils.css.CSSStyleSheet.encoding">
130
 
<tt class="descname">encoding</tt><a class="headerlink" href="#cssutils.css.CSSStyleSheet.encoding" title="Permalink to this definition">¶</a></dt>
131
 
<dd><p>Encoding set in <a class="reference internal" href="#cssutils.css.CSSCharsetRule" title="cssutils.css.CSSCharsetRule"><tt class="xref py py-class docutils literal"><span class="pre">CSSCharsetRule</span></tt></a> or if <tt class="xref docutils literal"><span class="pre">None</span></tt>
132
 
resulting in default <tt class="docutils literal"><span class="pre">utf-8</span></tt> encoding being used.</p>
133
 
</dd></dl>
134
 
 
135
 
<dl class="attribute">
136
 
<dt id="cssutils.css.CSSStyleSheet.href">
137
 
<tt class="descname">href</tt><a class="headerlink" href="#cssutils.css.CSSStyleSheet.href" title="Permalink to this definition">¶</a></dt>
138
 
<dd><p>If the style sheet is a linked style sheet, the value of this attribute is its location. For inline style sheets, the value of this attribute is None. See the href attribute definition for the LINK element in HTML 4.0, and the href pseudo-attribute for the XML style sheet processing instruction.</p>
139
 
</dd></dl>
140
 
 
141
 
<dl class="method">
142
 
<dt id="cssutils.css.CSSStyleSheet.insertRule">
143
 
<tt class="descname">insertRule</tt><big>(</big><em>rule</em>, <em>index=None</em>, <em>inOrder=False</em>, <em>_clean=True</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleSheet.insertRule" title="Permalink to this definition">¶</a></dt>
144
 
<dd><p>Used to insert a new rule into the style sheet. The new rule now
145
 
becomes part of the cascade.</p>
146
 
<table class="docutils field-list" frame="void" rules="none">
147
 
<col class="field-name" />
148
 
<col class="field-body" />
149
 
<tbody valign="top">
150
 
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
151
 
<li><strong>rule</strong> &#8211; a parsable DOMString, in cssutils also a 
152
 
<a class="reference internal" href="#cssutils.css.CSSRule" title="cssutils.css.CSSRule"><tt class="xref py py-class docutils literal"><span class="pre">CSSRule</span></tt></a> or <a class="reference internal" href="#cssutils.css.CSSRuleList" title="cssutils.css.CSSRuleList"><tt class="xref py py-class docutils literal"><span class="pre">CSSRuleList</span></tt></a></li>
153
 
<li><strong>index</strong> &#8211; of the rule before the new rule will be inserted.
154
 
If the specified <cite>index</cite> is equal to the length of the
155
 
StyleSheet&#8217;s rule collection, the rule will be added to the end
156
 
of the style sheet.
157
 
If <cite>index</cite> is not given or <tt class="xref docutils literal"><span class="pre">None</span></tt> rule will be appended to rule
158
 
list.</li>
159
 
<li><strong>inOrder</strong> &#8211; if <tt class="xref docutils literal"><span class="pre">True</span></tt> the rule will be put to a proper location while
160
 
ignoring <cite>index</cite> and without raising 
161
 
<a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.HierarchyRequestErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">HierarchyRequestErr</span></tt></a>.
162
 
The resulting index is returned nevertheless.</li>
163
 
</ul>
164
 
</td>
165
 
</tr>
166
 
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The index within the style sheet&#8217;s rule collection</p>
167
 
</td>
168
 
</tr>
169
 
<tr class="field"><th class="field-name">Exceptions :</th><td class="field-body"><ul class="first last simple">
170
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.HierarchyRequestErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">HierarchyRequestErr</span></tt></a>:
171
 
Raised if the rule cannot be inserted at the specified <cite>index</cite>
172
 
e.g. if an &#64;import rule is inserted after a standard rule set
173
 
or other at-rule.</li>
174
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.IndexSizeErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">IndexSizeErr</span></tt></a>:
175
 
Raised if the specified <cite>index</cite> is not a valid insertion point.</li>
176
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.NoModificationAllowedErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">NoModificationAllowedErr</span></tt></a>:
177
 
Raised if this style sheet is readonly.</li>
178
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.SyntaxErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">SyntaxErr</span></tt></a>:
179
 
Raised if the specified rule has a syntax error and is
180
 
unparsable.</li>
181
 
</ul>
182
 
</td>
183
 
</tr>
184
 
</tbody>
185
 
</table>
186
 
</dd></dl>
187
 
 
188
 
<dl class="attribute">
189
 
<dt id="cssutils.css.CSSStyleSheet.namespaces">
190
 
<tt class="descname">namespaces</tt><a class="headerlink" href="#cssutils.css.CSSStyleSheet.namespaces" title="Permalink to this definition">¶</a></dt>
191
 
<dd><p>All Namespaces used in this CSSStyleSheet.</p>
192
 
</dd></dl>
193
 
 
194
 
<dl class="attribute">
195
 
<dt id="cssutils.css.CSSStyleSheet.ownerNode">
196
 
<tt class="descname">ownerNode</tt><a class="headerlink" href="#cssutils.css.CSSStyleSheet.ownerNode" title="Permalink to this definition">¶</a></dt>
197
 
<dd><p>Not used in cssutils yet.</p>
198
 
</dd></dl>
199
 
 
200
 
<dl class="attribute">
201
 
<dt id="cssutils.css.CSSStyleSheet.ownerRule">
202
 
<tt class="descname">ownerRule</tt><a class="headerlink" href="#cssutils.css.CSSStyleSheet.ownerRule" title="Permalink to this definition">¶</a></dt>
203
 
<dd><p>A ref to an &#64;import rule if it is imported, else <tt class="xref docutils literal"><span class="pre">None</span></tt>.</p>
204
 
</dd></dl>
205
 
 
206
 
<dl class="attribute">
207
 
<dt id="cssutils.css.CSSStyleSheet.parentStyleSheet">
208
 
<tt class="descname">parentStyleSheet</tt><a class="headerlink" href="#cssutils.css.CSSStyleSheet.parentStyleSheet" title="Permalink to this definition">¶</a></dt>
209
 
<dd><p>For style sheet languages that support the concept of style sheet inclusion, this attribute represents the including style sheet, if one exists. If the style sheet is a top-level style sheet, or the style sheet language does not support inclusion, the value of this attribute is None.</p>
210
 
</dd></dl>
211
 
 
212
 
<dl class="attribute">
213
 
<dt id="cssutils.css.CSSStyleSheet.seq">
214
 
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.CSSStyleSheet.seq" title="Permalink to this definition">¶</a></dt>
215
 
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
216
 
</dd></dl>
217
 
 
218
 
<dl class="method">
219
 
<dt id="cssutils.css.CSSStyleSheet.setSerializer">
220
 
<tt class="descname">setSerializer</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleSheet.setSerializer" title="Permalink to this definition">¶</a></dt>
221
 
<dd><p>Set the cssutils global Serializer used for all output.</p>
222
 
</dd></dl>
223
 
 
224
 
<dl class="method">
225
 
<dt id="cssutils.css.CSSStyleSheet.setSerializerPref">
226
 
<tt class="descname">setSerializerPref</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleSheet.setSerializerPref" title="Permalink to this definition">¶</a></dt>
227
 
<dd><p>Set a Preference of CSSSerializer used for output.
228
 
See <a class="reference internal" href="serialize.html#cssutils.serialize.Preferences" title="cssutils.serialize.Preferences"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.serialize.Preferences</span></tt></a> for possible
229
 
preferences to be set.</p>
230
 
</dd></dl>
231
 
 
232
 
<dl class="attribute">
233
 
<dt id="cssutils.css.CSSStyleSheet.type">
234
 
<tt class="descname">type</tt><a class="headerlink" href="#cssutils.css.CSSStyleSheet.type" title="Permalink to this definition">¶</a></dt>
235
 
<dd><p>This specifies the style sheet language for this style sheet. The style sheet language is specified as a content type (e.g. <tt class="docutils literal"><span class="pre">text/css</span></tt>). The content type is often specified in the ownerNode. Also see the type attribute definition for the LINK element in HTML 4.0, and the type pseudo-attribute for the XML style sheet processing instruction. For CSS this is always <tt class="docutils literal"><span class="pre">text/css</span></tt>.</p>
236
 
</dd></dl>
237
 
 
238
 
<dl class="attribute">
239
 
<dt id="cssutils.css.CSSStyleSheet.variables">
240
 
<tt class="descname">variables</tt><a class="headerlink" href="#cssutils.css.CSSStyleSheet.variables" title="Permalink to this definition">¶</a></dt>
241
 
<dd><p>A <a class="reference internal" href="#cssutils.css.CSSVariablesDeclaration" title="cssutils.css.CSSVariablesDeclaration"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSVariablesDeclaration</span></tt></a> containing all available variables in this CSSStyleSheet including the ones defined in imported sheets.</p>
242
 
</dd></dl>
243
 
 
244
 
</dd></dl>
245
 
 
246
 
</div>
247
 
<div class="section" id="css-rules">
248
 
<h2>CSS rules<a class="headerlink" href="#css-rules" title="Permalink to this headline">¶</a></h2>
249
 
<div class="section" id="cssrule">
250
 
<h3><tt class="docutils literal"><span class="pre">CSSRule</span></tt><a class="headerlink" href="#cssrule" title="Permalink to this headline">¶</a></h3>
251
 
<dl class="class">
252
 
<dt id="cssutils.css.CSSRule">
253
 
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSRule</tt><big>(</big><em>parentRule=None</em>, <em>parentStyleSheet=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSRule" title="Permalink to this definition">¶</a></dt>
254
 
<dd><p>Abstract base interface for any type of CSS statement. This includes
255
 
both rule sets and at-rules. An implementation is expected to preserve
256
 
all rules specified in a CSS style sheet, even if the rule is not
257
 
recognized by the parser. Unrecognized rules are represented using the
258
 
<tt class="xref py py-class docutils literal"><span class="pre">CSSUnknownRule</span></tt> interface.</p>
259
 
<dl class="attribute">
260
 
<dt id="cssutils.css.CSSRule.CHARSET_RULE">
261
 
<tt class="descname">CHARSET_RULE</tt><a class="headerlink" href="#cssutils.css.CSSRule.CHARSET_RULE" title="Permalink to this definition">¶</a></dt>
262
 
<dd><p><a class="reference internal" href="#cssutils.css.CSSCharsetRule" title="cssutils.css.CSSCharsetRule"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSCharsetRule</span></tt></a> (not used in CSSOM anymore)</p>
263
 
</dd></dl>
264
 
 
265
 
<dl class="attribute">
266
 
<dt id="cssutils.css.CSSRule.COMMENT">
267
 
<tt class="descname">COMMENT</tt><a class="headerlink" href="#cssutils.css.CSSRule.COMMENT" title="Permalink to this definition">¶</a></dt>
268
 
<dd><p><a class="reference internal" href="#cssutils.css.CSSComment" title="cssutils.css.CSSComment"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSComment</span></tt></a> - not in the offical spec,
269
 
Value has changed in 0.9.7a3</p>
270
 
</dd></dl>
271
 
 
272
 
<dl class="attribute">
273
 
<dt id="cssutils.css.CSSRule.FONT_FACE_RULE">
274
 
<tt class="descname">FONT_FACE_RULE</tt><a class="headerlink" href="#cssutils.css.CSSRule.FONT_FACE_RULE" title="Permalink to this definition">¶</a></dt>
275
 
<dd><p><a class="reference internal" href="#cssutils.css.CSSFontFaceRule" title="cssutils.css.CSSFontFaceRule"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSFontFaceRule</span></tt></a></p>
276
 
</dd></dl>
277
 
 
278
 
<dl class="attribute">
279
 
<dt id="cssutils.css.CSSRule.IMPORT_RULE">
280
 
<tt class="descname">IMPORT_RULE</tt><a class="headerlink" href="#cssutils.css.CSSRule.IMPORT_RULE" title="Permalink to this definition">¶</a></dt>
281
 
<dd><p><a class="reference internal" href="#cssutils.css.CSSImportRule" title="cssutils.css.CSSImportRule"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSImportRule</span></tt></a></p>
282
 
</dd></dl>
283
 
 
284
 
<dl class="attribute">
285
 
<dt id="cssutils.css.CSSRule.MEDIA_RULE">
286
 
<tt class="descname">MEDIA_RULE</tt><a class="headerlink" href="#cssutils.css.CSSRule.MEDIA_RULE" title="Permalink to this definition">¶</a></dt>
287
 
<dd><p><a class="reference internal" href="#cssutils.css.CSSMediaRule" title="cssutils.css.CSSMediaRule"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSMediaRule</span></tt></a></p>
288
 
</dd></dl>
289
 
 
290
 
<dl class="attribute">
291
 
<dt id="cssutils.css.CSSRule.NAMESPACE_RULE">
292
 
<tt class="descname">NAMESPACE_RULE</tt><a class="headerlink" href="#cssutils.css.CSSRule.NAMESPACE_RULE" title="Permalink to this definition">¶</a></dt>
293
 
<dd><p><a class="reference internal" href="#cssutils.css.CSSNamespaceRule" title="cssutils.css.CSSNamespaceRule"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSNamespaceRule</span></tt></a>,
294
 
Value has changed in 0.9.7a3 due to a change in the CSSOM spec.</p>
295
 
</dd></dl>
296
 
 
297
 
<dl class="attribute">
298
 
<dt id="cssutils.css.CSSRule.PAGE_RULE">
299
 
<tt class="descname">PAGE_RULE</tt><a class="headerlink" href="#cssutils.css.CSSRule.PAGE_RULE" title="Permalink to this definition">¶</a></dt>
300
 
<dd><p><a class="reference internal" href="#cssutils.css.CSSPageRule" title="cssutils.css.CSSPageRule"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSPageRule</span></tt></a></p>
301
 
</dd></dl>
302
 
 
303
 
<dl class="attribute">
304
 
<dt id="cssutils.css.CSSRule.STYLE_RULE">
305
 
<tt class="descname">STYLE_RULE</tt><a class="headerlink" href="#cssutils.css.CSSRule.STYLE_RULE" title="Permalink to this definition">¶</a></dt>
306
 
<dd><p><a class="reference internal" href="#cssutils.css.CSSStyleRule" title="cssutils.css.CSSStyleRule"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSStyleRule</span></tt></a></p>
307
 
</dd></dl>
308
 
 
309
 
<dl class="attribute">
310
 
<dt id="cssutils.css.CSSRule.UNKNOWN_RULE">
311
 
<tt class="descname">UNKNOWN_RULE</tt><a class="headerlink" href="#cssutils.css.CSSRule.UNKNOWN_RULE" title="Permalink to this definition">¶</a></dt>
312
 
<dd><p><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSUnknownRule</span></tt> (not used in CSSOM anymore)</p>
313
 
</dd></dl>
314
 
 
315
 
<dl class="attribute">
316
 
<dt id="cssutils.css.CSSRule.VARIABLES_RULE">
317
 
<tt class="descname">VARIABLES_RULE</tt><a class="headerlink" href="#cssutils.css.CSSRule.VARIABLES_RULE" title="Permalink to this definition">¶</a></dt>
318
 
<dd><p><a class="reference internal" href="#cssutils.css.CSSVariablesRule" title="cssutils.css.CSSVariablesRule"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSVariablesRule</span></tt></a> - experimental rule
319
 
not in the offical spec</p>
320
 
</dd></dl>
321
 
 
322
 
<dl class="attribute">
323
 
<dt id="cssutils.css.CSSRule.atkeyword">
324
 
<tt class="descname">atkeyword</tt><a class="headerlink" href="#cssutils.css.CSSRule.atkeyword" title="Permalink to this definition">¶</a></dt>
325
 
<dd><p>Literal keyword of an &#64;rule (e.g. <tt class="docutils literal"><span class="pre">&#64;IMport</span></tt>).</p>
326
 
</dd></dl>
327
 
 
328
 
<dl class="attribute">
329
 
<dt id="cssutils.css.CSSRule.cssText">
330
 
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.CSSRule.cssText" title="Permalink to this definition">¶</a></dt>
331
 
<dd><p>(DOM) The parsable textual representation of the rule. This reflects the current state of the rule and not its initial value.</p>
332
 
</dd></dl>
333
 
 
334
 
<dl class="attribute">
335
 
<dt id="cssutils.css.CSSRule.parent">
336
 
<tt class="descname">parent</tt><a class="headerlink" href="#cssutils.css.CSSRule.parent" title="Permalink to this definition">¶</a></dt>
337
 
<dd><p>The Parent Node of this CSSRule or None.</p>
338
 
</dd></dl>
339
 
 
340
 
<dl class="attribute">
341
 
<dt id="cssutils.css.CSSRule.parentRule">
342
 
<tt class="descname">parentRule</tt><a class="headerlink" href="#cssutils.css.CSSRule.parentRule" title="Permalink to this definition">¶</a></dt>
343
 
<dd><p>If this rule is contained inside another rule (e.g. a style rule inside an &#64;media block), this is the containing rule. If this rule is not nested inside any other rules, this returns None.</p>
344
 
</dd></dl>
345
 
 
346
 
<dl class="attribute">
347
 
<dt id="cssutils.css.CSSRule.parentStyleSheet">
348
 
<tt class="descname">parentStyleSheet</tt><a class="headerlink" href="#cssutils.css.CSSRule.parentStyleSheet" title="Permalink to this definition">¶</a></dt>
349
 
<dd><p>The style sheet that contains this rule.</p>
350
 
</dd></dl>
351
 
 
352
 
<dl class="attribute">
353
 
<dt id="cssutils.css.CSSRule.seq">
354
 
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.CSSRule.seq" title="Permalink to this definition">¶</a></dt>
355
 
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
356
 
</dd></dl>
357
 
 
358
 
<dl class="attribute">
359
 
<dt id="cssutils.css.CSSRule.type">
360
 
<tt class="descname">type</tt><a class="headerlink" href="#cssutils.css.CSSRule.type" title="Permalink to this definition">¶</a></dt>
361
 
<dd><p>The type of this rule, as defined by a CSSRule type constant.</p>
362
 
</dd></dl>
363
 
 
364
 
<dl class="attribute">
365
 
<dt id="cssutils.css.CSSRule.typeString">
366
 
<tt class="descname">typeString</tt><a class="headerlink" href="#cssutils.css.CSSRule.typeString" title="Permalink to this definition">¶</a></dt>
367
 
<dd><p>Descriptive name of this rule&#8217;s type.</p>
368
 
</dd></dl>
369
 
 
370
 
<dl class="attribute">
371
 
<dt id="cssutils.css.CSSRule.wellformed">
372
 
<tt class="descname">wellformed</tt><a class="headerlink" href="#cssutils.css.CSSRule.wellformed" title="Permalink to this definition">¶</a></dt>
373
 
<dd><p>If the rule is wellformed.</p>
374
 
</dd></dl>
375
 
 
376
 
</dd></dl>
377
 
 
378
 
</div>
379
 
<div class="section" id="cssrulelist">
380
 
<h3><tt class="docutils literal"><span class="pre">CSSRuleList</span></tt><a class="headerlink" href="#cssrulelist" title="Permalink to this headline">¶</a></h3>
381
 
<dl class="class">
382
 
<dt id="cssutils.css.CSSRuleList">
383
 
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSRuleList</tt><big>(</big><em>*ignored</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSRuleList" title="Permalink to this definition">¶</a></dt>
384
 
<dd><p>The CSSRuleList object represents an (ordered) list of statements.</p>
385
 
<p>The items in the CSSRuleList are accessible via an integral index,
386
 
starting from 0.</p>
387
 
<p>Subclasses a standard Python list so theoretically all standard list
388
 
methods are available. Setting methods like <tt class="docutils literal"><span class="pre">__init__</span></tt>, <tt class="docutils literal"><span class="pre">append</span></tt>,
389
 
<tt class="docutils literal"><span class="pre">extend</span></tt> or <tt class="docutils literal"><span class="pre">__setslice__</span></tt> are added later on instances of this
390
 
class if so desired.
391
 
E.g. CSSStyleSheet adds <tt class="docutils literal"><span class="pre">append</span></tt> which is not available in a simple
392
 
instance of this class!</p>
393
 
<dl class="method">
394
 
<dt id="cssutils.css.CSSRuleList.append">
395
 
<tt class="descname">append</tt><big>(</big><em>*ignored</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSRuleList.append" title="Permalink to this definition">¶</a></dt>
396
 
<dd><p>Implemented in class using a CSSRuleList only.</p>
397
 
</dd></dl>
398
 
 
399
 
<dl class="attribute">
400
 
<dt id="cssutils.css.CSSRuleList.count">
401
 
<tt class="descname">count</tt><a class="headerlink" href="#cssutils.css.CSSRuleList.count" title="Permalink to this definition">¶</a></dt>
402
 
<dd><p>L.count(value) -&gt; integer &#8211; return number of occurrences of value</p>
403
 
</dd></dl>
404
 
 
405
 
<dl class="method">
406
 
<dt id="cssutils.css.CSSRuleList.extend">
407
 
<tt class="descname">extend</tt><big>(</big><em>*ignored</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSRuleList.extend" title="Permalink to this definition">¶</a></dt>
408
 
<dd><p>Implemented in class using a CSSRuleList only.</p>
409
 
</dd></dl>
410
 
 
411
 
<dl class="attribute">
412
 
<dt id="cssutils.css.CSSRuleList.index">
413
 
<tt class="descname">index</tt><a class="headerlink" href="#cssutils.css.CSSRuleList.index" title="Permalink to this definition">¶</a></dt>
414
 
<dd><p>L.index(value, [start, [stop]]) -&gt; integer &#8211; return first index of value.
415
 
Raises ValueError if the value is not present.</p>
416
 
</dd></dl>
417
 
 
418
 
<dl class="attribute">
419
 
<dt id="cssutils.css.CSSRuleList.insert">
420
 
<tt class="descname">insert</tt><a class="headerlink" href="#cssutils.css.CSSRuleList.insert" title="Permalink to this definition">¶</a></dt>
421
 
<dd><p>L.insert(index, object) &#8211; insert object before index</p>
422
 
</dd></dl>
423
 
 
424
 
<dl class="method">
425
 
<dt id="cssutils.css.CSSRuleList.item">
426
 
<tt class="descname">item</tt><big>(</big><em>index</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSRuleList.item" title="Permalink to this definition">¶</a></dt>
427
 
<dd><p>(DOM) Retrieve a CSS rule by ordinal <cite>index</cite>. The order in this
428
 
collection represents the order of the rules in the CSS style
429
 
sheet. If index is greater than or equal to the number of rules in
430
 
the list, this returns None.</p>
431
 
<p>Returns CSSRule, the style rule at the index position in the
432
 
CSSRuleList, or None if that is not a valid index.</p>
433
 
</dd></dl>
434
 
 
435
 
<dl class="attribute">
436
 
<dt id="cssutils.css.CSSRuleList.length">
437
 
<tt class="descname">length</tt><a class="headerlink" href="#cssutils.css.CSSRuleList.length" title="Permalink to this definition">¶</a></dt>
438
 
<dd><p>(DOM) The number of CSSRules in the list.</p>
439
 
</dd></dl>
440
 
 
441
 
<dl class="attribute">
442
 
<dt id="cssutils.css.CSSRuleList.pop">
443
 
<tt class="descname">pop</tt><a class="headerlink" href="#cssutils.css.CSSRuleList.pop" title="Permalink to this definition">¶</a></dt>
444
 
<dd><p>L.pop([index]) -&gt; item &#8211; remove and return item at index (default last).
445
 
Raises IndexError if list is empty or index is out of range.</p>
446
 
</dd></dl>
447
 
 
448
 
<dl class="attribute">
449
 
<dt id="cssutils.css.CSSRuleList.remove">
450
 
<tt class="descname">remove</tt><a class="headerlink" href="#cssutils.css.CSSRuleList.remove" title="Permalink to this definition">¶</a></dt>
451
 
<dd><p>L.remove(value) &#8211; remove first occurrence of value.
452
 
Raises ValueError if the value is not present.</p>
453
 
</dd></dl>
454
 
 
455
 
<dl class="attribute">
456
 
<dt id="cssutils.css.CSSRuleList.reverse">
457
 
<tt class="descname">reverse</tt><a class="headerlink" href="#cssutils.css.CSSRuleList.reverse" title="Permalink to this definition">¶</a></dt>
458
 
<dd><p>L.reverse() &#8211; reverse <em>IN PLACE</em></p>
459
 
</dd></dl>
460
 
 
461
 
<dl class="method">
462
 
<dt id="cssutils.css.CSSRuleList.rulesOfType">
463
 
<tt class="descname">rulesOfType</tt><big>(</big><em>type</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSRuleList.rulesOfType" title="Permalink to this definition">¶</a></dt>
464
 
<dd><p>Yield the rules which have the given <cite>type</cite> only, one of the 
465
 
constants defined in <a class="reference internal" href="#cssutils.css.CSSRule" title="cssutils.css.CSSRule"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSRule</span></tt></a>.</p>
466
 
</dd></dl>
467
 
 
468
 
<dl class="attribute">
469
 
<dt id="cssutils.css.CSSRuleList.sort">
470
 
<tt class="descname">sort</tt><a class="headerlink" href="#cssutils.css.CSSRuleList.sort" title="Permalink to this definition">¶</a></dt>
471
 
<dd><p>L.sort(cmp=None, key=None, reverse=False) &#8211; stable sort <em>IN PLACE</em>;
472
 
cmp(x, y) -&gt; -1, 0, 1</p>
473
 
</dd></dl>
474
 
 
475
 
</dd></dl>
476
 
 
477
 
</div>
478
 
<div class="section" id="csscharsetrule">
479
 
<h3><tt class="docutils literal"><span class="pre">CSSCharsetRule</span></tt><a class="headerlink" href="#csscharsetrule" title="Permalink to this headline">¶</a></h3>
480
 
<dl class="class">
481
 
<dt id="cssutils.css.CSSCharsetRule">
482
 
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSCharsetRule</tt><big>(</big><em>encoding=None</em>, <em>parentRule=None</em>, <em>parentStyleSheet=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSCharsetRule" title="Permalink to this definition">¶</a></dt>
483
 
<dd><p>The CSSCharsetRule interface represents an &#64;charset rule in a CSS style
484
 
sheet. The value of the encoding attribute does not affect the encoding
485
 
of text data in the DOM objects; this encoding is always UTF-16
486
 
(also in Python?). After a stylesheet is loaded, the value of the
487
 
encoding attribute is the value found in the &#64;charset rule. If there
488
 
was no &#64;charset in the original document, then no CSSCharsetRule is
489
 
created. The value of the encoding attribute may also be used as a hint
490
 
for the encoding used on serialization of the style sheet.</p>
491
 
<p>The value of the &#64;charset rule (and therefore of the CSSCharsetRule)
492
 
may not correspond to the encoding the document actually came in;
493
 
character encoding information e.g. in an HTTP header, has priority
494
 
(see CSS document representation) but this is not reflected in the
495
 
CSSCharsetRule.</p>
496
 
<p>This rule is not really needed anymore as setting 
497
 
<a class="reference internal" href="#cssutils.css.CSSStyleSheet.encoding" title="cssutils.css.CSSStyleSheet.encoding"><tt class="xref py py-attr docutils literal"><span class="pre">CSSStyleSheet.encoding</span></tt></a> is much easier.</p>
498
 
<p>Format:</p>
499
 
<div class="highlight-python"><pre>charsetrule:
500
 
    CHARSET_SYM S* STRING S* ';'</pre>
501
 
</div>
502
 
<p>BUT: Only valid format is (single space, double quotes!):</p>
503
 
<div class="highlight-python"><pre>@charset "ENCODING";</pre>
504
 
</div>
505
 
<dl class="attribute">
506
 
<dt id="cssutils.css.CSSCharsetRule.atkeyword">
507
 
<tt class="descname">atkeyword</tt><a class="headerlink" href="#cssutils.css.CSSCharsetRule.atkeyword" title="Permalink to this definition">¶</a></dt>
508
 
<dd><p>Literal keyword of an &#64;rule (e.g. <tt class="docutils literal"><span class="pre">&#64;IMport</span></tt>).</p>
509
 
</dd></dl>
510
 
 
511
 
<dl class="attribute">
512
 
<dt id="cssutils.css.CSSCharsetRule.cssText">
513
 
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.CSSCharsetRule.cssText" title="Permalink to this definition">¶</a></dt>
514
 
<dd><p>(DOM) The parsable textual representation.</p>
515
 
</dd></dl>
516
 
 
517
 
<dl class="attribute">
518
 
<dt id="cssutils.css.CSSCharsetRule.encoding">
519
 
<tt class="descname">encoding</tt><a class="headerlink" href="#cssutils.css.CSSCharsetRule.encoding" title="Permalink to this definition">¶</a></dt>
520
 
<dd><p>(DOM)The encoding information used in this &#64;charset rule.</p>
521
 
</dd></dl>
522
 
 
523
 
<dl class="attribute">
524
 
<dt id="cssutils.css.CSSCharsetRule.parent">
525
 
<tt class="descname">parent</tt><a class="headerlink" href="#cssutils.css.CSSCharsetRule.parent" title="Permalink to this definition">¶</a></dt>
526
 
<dd><p>The Parent Node of this CSSRule or None.</p>
527
 
</dd></dl>
528
 
 
529
 
<dl class="attribute">
530
 
<dt id="cssutils.css.CSSCharsetRule.parentRule">
531
 
<tt class="descname">parentRule</tt><a class="headerlink" href="#cssutils.css.CSSCharsetRule.parentRule" title="Permalink to this definition">¶</a></dt>
532
 
<dd><p>If this rule is contained inside another rule (e.g. a style rule inside an &#64;media block), this is the containing rule. If this rule is not nested inside any other rules, this returns None.</p>
533
 
</dd></dl>
534
 
 
535
 
<dl class="attribute">
536
 
<dt id="cssutils.css.CSSCharsetRule.parentStyleSheet">
537
 
<tt class="descname">parentStyleSheet</tt><a class="headerlink" href="#cssutils.css.CSSCharsetRule.parentStyleSheet" title="Permalink to this definition">¶</a></dt>
538
 
<dd><p>The style sheet that contains this rule.</p>
539
 
</dd></dl>
540
 
 
541
 
<dl class="attribute">
542
 
<dt id="cssutils.css.CSSCharsetRule.seq">
543
 
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.CSSCharsetRule.seq" title="Permalink to this definition">¶</a></dt>
544
 
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
545
 
</dd></dl>
546
 
 
547
 
<dl class="attribute">
548
 
<dt id="cssutils.css.CSSCharsetRule.type">
549
 
<tt class="descname">type</tt><a class="headerlink" href="#cssutils.css.CSSCharsetRule.type" title="Permalink to this definition">¶</a></dt>
550
 
<dd><p>The type of this rule, as defined by a CSSRule type constant.</p>
551
 
</dd></dl>
552
 
 
553
 
<dl class="attribute">
554
 
<dt id="cssutils.css.CSSCharsetRule.typeString">
555
 
<tt class="descname">typeString</tt><a class="headerlink" href="#cssutils.css.CSSCharsetRule.typeString" title="Permalink to this definition">¶</a></dt>
556
 
<dd><p>Descriptive name of this rule&#8217;s type.</p>
557
 
</dd></dl>
558
 
 
559
 
</dd></dl>
560
 
 
561
 
</div>
562
 
<div class="section" id="cssfontfacerule">
563
 
<h3><tt class="docutils literal"><span class="pre">CSSFontFaceRule</span></tt><a class="headerlink" href="#cssfontfacerule" title="Permalink to this headline">¶</a></h3>
564
 
<dl class="class">
565
 
<dt id="cssutils.css.CSSFontFaceRule">
566
 
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSFontFaceRule</tt><big>(</big><em>style=None</em>, <em>parentRule=None</em>, <em>parentStyleSheet=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSFontFaceRule" title="Permalink to this definition">¶</a></dt>
567
 
<dd><p>The CSSFontFaceRule interface represents a &#64;font-face rule in a CSS
568
 
style sheet. The &#64;font-face rule is used to hold a set of font 
569
 
descriptions.</p>
570
 
<p>Format:</p>
571
 
<div class="highlight-python"><pre>font_face
572
 
  : FONT_FACE_SYM S*
573
 
    '{' S* declaration [ ';' S* declaration ]* '}' S*
574
 
  ;</pre>
575
 
</div>
576
 
<p>cssutils uses a <a class="reference internal" href="#cssutils.css.CSSStyleDeclaration" title="cssutils.css.CSSStyleDeclaration"><tt class="xref py py-class docutils literal"><span class="pre">CSSStyleDeclaration</span></tt></a>  to
577
 
represent the font descriptions. For validation a specific profile
578
 
is used though were some properties have other valid values than
579
 
when used in e.g. a <a class="reference internal" href="#cssutils.css.CSSStyleRule" title="cssutils.css.CSSStyleRule"><tt class="xref py py-class docutils literal"><span class="pre">CSSStyleRule</span></tt></a>.</p>
580
 
<dl class="attribute">
581
 
<dt id="cssutils.css.CSSFontFaceRule.atkeyword">
582
 
<tt class="descname">atkeyword</tt><a class="headerlink" href="#cssutils.css.CSSFontFaceRule.atkeyword" title="Permalink to this definition">¶</a></dt>
583
 
<dd><p>Literal keyword of an &#64;rule (e.g. <tt class="docutils literal"><span class="pre">&#64;IMport</span></tt>).</p>
584
 
</dd></dl>
585
 
 
586
 
<dl class="attribute">
587
 
<dt id="cssutils.css.CSSFontFaceRule.cssText">
588
 
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.CSSFontFaceRule.cssText" title="Permalink to this definition">¶</a></dt>
589
 
<dd><p>(DOM) The parsable textual representation of this rule.</p>
590
 
</dd></dl>
591
 
 
592
 
<dl class="attribute">
593
 
<dt id="cssutils.css.CSSFontFaceRule.parent">
594
 
<tt class="descname">parent</tt><a class="headerlink" href="#cssutils.css.CSSFontFaceRule.parent" title="Permalink to this definition">¶</a></dt>
595
 
<dd><p>The Parent Node of this CSSRule or None.</p>
596
 
</dd></dl>
597
 
 
598
 
<dl class="attribute">
599
 
<dt id="cssutils.css.CSSFontFaceRule.parentRule">
600
 
<tt class="descname">parentRule</tt><a class="headerlink" href="#cssutils.css.CSSFontFaceRule.parentRule" title="Permalink to this definition">¶</a></dt>
601
 
<dd><p>If this rule is contained inside another rule (e.g. a style rule inside an &#64;media block), this is the containing rule. If this rule is not nested inside any other rules, this returns None.</p>
602
 
</dd></dl>
603
 
 
604
 
<dl class="attribute">
605
 
<dt id="cssutils.css.CSSFontFaceRule.parentStyleSheet">
606
 
<tt class="descname">parentStyleSheet</tt><a class="headerlink" href="#cssutils.css.CSSFontFaceRule.parentStyleSheet" title="Permalink to this definition">¶</a></dt>
607
 
<dd><p>The style sheet that contains this rule.</p>
608
 
</dd></dl>
609
 
 
610
 
<dl class="attribute">
611
 
<dt id="cssutils.css.CSSFontFaceRule.seq">
612
 
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.CSSFontFaceRule.seq" title="Permalink to this definition">¶</a></dt>
613
 
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
614
 
</dd></dl>
615
 
 
616
 
<dl class="attribute">
617
 
<dt id="cssutils.css.CSSFontFaceRule.style">
618
 
<tt class="descname">style</tt><a class="headerlink" href="#cssutils.css.CSSFontFaceRule.style" title="Permalink to this definition">¶</a></dt>
619
 
<dd><p>(DOM) The declaration-block of this rule set, a <a class="reference internal" href="#cssutils.css.CSSStyleDeclaration" title="cssutils.css.CSSStyleDeclaration"><tt class="xref py py-class docutils literal"><span class="pre">CSSStyleDeclaration</span></tt></a>.</p>
620
 
</dd></dl>
621
 
 
622
 
<dl class="attribute">
623
 
<dt id="cssutils.css.CSSFontFaceRule.type">
624
 
<tt class="descname">type</tt><a class="headerlink" href="#cssutils.css.CSSFontFaceRule.type" title="Permalink to this definition">¶</a></dt>
625
 
<dd><p>The type of this rule, as defined by a CSSRule type constant.</p>
626
 
</dd></dl>
627
 
 
628
 
<dl class="attribute">
629
 
<dt id="cssutils.css.CSSFontFaceRule.typeString">
630
 
<tt class="descname">typeString</tt><a class="headerlink" href="#cssutils.css.CSSFontFaceRule.typeString" title="Permalink to this definition">¶</a></dt>
631
 
<dd><p>Descriptive name of this rule&#8217;s type.</p>
632
 
</dd></dl>
633
 
 
634
 
<dl class="attribute">
635
 
<dt id="cssutils.css.CSSFontFaceRule.valid">
636
 
<tt class="descname">valid</tt><a class="headerlink" href="#cssutils.css.CSSFontFaceRule.valid" title="Permalink to this definition">¶</a></dt>
637
 
<dd><p>CSSFontFace is valid if properties <cite>font-family</cite> and <cite>src</cite> are set and all properties are valid.</p>
638
 
</dd></dl>
639
 
 
640
 
</dd></dl>
641
 
 
642
 
</div>
643
 
<div class="section" id="cssimportrule">
644
 
<h3><tt class="docutils literal"><span class="pre">CSSImportRule</span></tt><a class="headerlink" href="#cssimportrule" title="Permalink to this headline">¶</a></h3>
645
 
<dl class="class">
646
 
<dt id="cssutils.css.CSSImportRule">
647
 
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSImportRule</tt><big>(</big><em>href=None</em>, <em>mediaText=None</em>, <em>name=None</em>, <em>parentRule=None</em>, <em>parentStyleSheet=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSImportRule" title="Permalink to this definition">¶</a></dt>
648
 
<dd><p>Represents an &#64;import rule within a CSS style sheet.  The &#64;import rule
649
 
is used to import style rules from other style sheets.</p>
650
 
<p>Format:</p>
651
 
<div class="highlight-python"><pre>import
652
 
  : IMPORT_SYM S*
653
 
  [STRING|URI] S* [ medium [ COMMA S* medium]* ]? S* STRING? S* ';' S*
654
 
  ;</pre>
655
 
</div>
656
 
<dl class="attribute">
657
 
<dt id="cssutils.css.CSSImportRule.atkeyword">
658
 
<tt class="descname">atkeyword</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.atkeyword" title="Permalink to this definition">¶</a></dt>
659
 
<dd><p>Literal keyword of an &#64;rule (e.g. <tt class="docutils literal"><span class="pre">&#64;IMport</span></tt>).</p>
660
 
</dd></dl>
661
 
 
662
 
<dl class="attribute">
663
 
<dt id="cssutils.css.CSSImportRule.cssText">
664
 
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.cssText" title="Permalink to this definition">¶</a></dt>
665
 
<dd><p>(DOM) The parsable textual representation of this rule.</p>
666
 
</dd></dl>
667
 
 
668
 
<dl class="attribute">
669
 
<dt id="cssutils.css.CSSImportRule.href">
670
 
<tt class="descname">href</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.href" title="Permalink to this definition">¶</a></dt>
671
 
<dd><p>Location of the style sheet to be imported.</p>
672
 
</dd></dl>
673
 
 
674
 
<dl class="attribute">
675
 
<dt id="cssutils.css.CSSImportRule.media">
676
 
<tt class="descname">media</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.media" title="Permalink to this definition">¶</a></dt>
677
 
<dd><p>(DOM) A list of media types for this rule of type <a class="reference internal" href="stylesheets.html#cssutils.stylesheets.MediaList" title="cssutils.stylesheets.MediaList"><tt class="xref py py-class docutils literal"><span class="pre">MediaList</span></tt></a>.</p>
678
 
</dd></dl>
679
 
 
680
 
<dl class="attribute">
681
 
<dt id="cssutils.css.CSSImportRule.name">
682
 
<tt class="descname">name</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.name" title="Permalink to this definition">¶</a></dt>
683
 
<dd><p>An optional name for the imported sheet.</p>
684
 
</dd></dl>
685
 
 
686
 
<dl class="attribute">
687
 
<dt id="cssutils.css.CSSImportRule.parent">
688
 
<tt class="descname">parent</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.parent" title="Permalink to this definition">¶</a></dt>
689
 
<dd><p>The Parent Node of this CSSRule or None.</p>
690
 
</dd></dl>
691
 
 
692
 
<dl class="attribute">
693
 
<dt id="cssutils.css.CSSImportRule.parentRule">
694
 
<tt class="descname">parentRule</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.parentRule" title="Permalink to this definition">¶</a></dt>
695
 
<dd><p>If this rule is contained inside another rule (e.g. a style rule inside an &#64;media block), this is the containing rule. If this rule is not nested inside any other rules, this returns None.</p>
696
 
</dd></dl>
697
 
 
698
 
<dl class="attribute">
699
 
<dt id="cssutils.css.CSSImportRule.parentStyleSheet">
700
 
<tt class="descname">parentStyleSheet</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.parentStyleSheet" title="Permalink to this definition">¶</a></dt>
701
 
<dd><p>The style sheet that contains this rule.</p>
702
 
</dd></dl>
703
 
 
704
 
<dl class="attribute">
705
 
<dt id="cssutils.css.CSSImportRule.seq">
706
 
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.seq" title="Permalink to this definition">¶</a></dt>
707
 
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
708
 
</dd></dl>
709
 
 
710
 
<dl class="attribute">
711
 
<dt id="cssutils.css.CSSImportRule.styleSheet">
712
 
<tt class="descname">styleSheet</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.styleSheet" title="Permalink to this definition">¶</a></dt>
713
 
<dd><p>(readonly) The style sheet referred to by this rule.</p>
714
 
</dd></dl>
715
 
 
716
 
<dl class="attribute">
717
 
<dt id="cssutils.css.CSSImportRule.type">
718
 
<tt class="descname">type</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.type" title="Permalink to this definition">¶</a></dt>
719
 
<dd><p>The type of this rule, as defined by a CSSRule type constant.</p>
720
 
</dd></dl>
721
 
 
722
 
<dl class="attribute">
723
 
<dt id="cssutils.css.CSSImportRule.typeString">
724
 
<tt class="descname">typeString</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.typeString" title="Permalink to this definition">¶</a></dt>
725
 
<dd><p>Descriptive name of this rule&#8217;s type.</p>
726
 
</dd></dl>
727
 
 
728
 
<dl class="attribute">
729
 
<dt id="cssutils.css.CSSImportRule.wellformed">
730
 
<tt class="descname">wellformed</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.wellformed" title="Permalink to this definition">¶</a></dt>
731
 
<dd><p>Depending on if media is used at all.</p>
732
 
</dd></dl>
733
 
 
734
 
</dd></dl>
735
 
 
736
 
</div>
737
 
<div class="section" id="cssmediarule">
738
 
<h3><tt class="docutils literal"><span class="pre">CSSMediaRule</span></tt><a class="headerlink" href="#cssmediarule" title="Permalink to this headline">¶</a></h3>
739
 
<dl class="class">
740
 
<dt id="cssutils.css.CSSMediaRule">
741
 
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSMediaRule</tt><big>(</big><em>mediaText='all'</em>, <em>name=None</em>, <em>parentRule=None</em>, <em>parentStyleSheet=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSMediaRule" title="Permalink to this definition">¶</a></dt>
742
 
<dd><p>Objects implementing the CSSMediaRule interface can be identified by the
743
 
MEDIA_RULE constant. On these objects the type attribute must return the
744
 
value of that constant.</p>
745
 
<p>Format:</p>
746
 
<div class="highlight-python"><pre>: MEDIA_SYM S* medium [ COMMA S* medium ]* 
747
 
 
748
 
    STRING? # the name
749
 
 
750
 
LBRACE S* ruleset* '}' S*;</pre>
751
 
</div>
752
 
<dl class="docutils">
753
 
<dt><tt class="docutils literal"><span class="pre">cssRules</span></tt></dt>
754
 
<dd>All Rules in this media rule, a <a class="reference internal" href="#cssutils.css.CSSRuleList" title="cssutils.css.CSSRuleList"><tt class="xref py py-class docutils literal"><span class="pre">CSSRuleList</span></tt></a>.</dd>
755
 
</dl>
756
 
<dl class="method">
757
 
<dt id="cssutils.css.CSSMediaRule.add">
758
 
<tt class="descname">add</tt><big>(</big><em>rule</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSMediaRule.add" title="Permalink to this definition">¶</a></dt>
759
 
<dd><p>Add <cite>rule</cite> to end of this mediarule. 
760
 
Same as <a class="reference internal" href="#cssutils.css.CSSMediaRule.insertRule" title="cssutils.css.CSSMediaRule.insertRule"><tt class="xref py py-meth docutils literal"><span class="pre">insertRule()</span></tt></a>.</p>
761
 
</dd></dl>
762
 
 
763
 
<dl class="attribute">
764
 
<dt id="cssutils.css.CSSMediaRule.atkeyword">
765
 
<tt class="descname">atkeyword</tt><a class="headerlink" href="#cssutils.css.CSSMediaRule.atkeyword" title="Permalink to this definition">¶</a></dt>
766
 
<dd><p>Literal keyword of an &#64;rule (e.g. <tt class="docutils literal"><span class="pre">&#64;IMport</span></tt>).</p>
767
 
</dd></dl>
768
 
 
769
 
<dl class="attribute">
770
 
<dt id="cssutils.css.CSSMediaRule.cssText">
771
 
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.CSSMediaRule.cssText" title="Permalink to this definition">¶</a></dt>
772
 
<dd><p>(DOM) The parsable textual representation of this rule.</p>
773
 
</dd></dl>
774
 
 
775
 
<dl class="method">
776
 
<dt id="cssutils.css.CSSMediaRule.deleteRule">
777
 
<tt class="descname">deleteRule</tt><big>(</big><em>index</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSMediaRule.deleteRule" title="Permalink to this definition">¶</a></dt>
778
 
<dd><p>Delete the rule at <cite>index</cite> from the media block.</p>
779
 
<table class="docutils field-list" frame="void" rules="none">
780
 
<col class="field-name" />
781
 
<col class="field-body" />
782
 
<tbody valign="top">
783
 
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
784
 
<li><strong>index</strong> &#8211; <p>The <cite>index</cite> of the rule to be removed from the media block&#8217;s rule
785
 
list. For an <cite>index</cite> &lt; 0 <strong>no</strong> <a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.IndexSizeErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">IndexSizeErr</span></tt></a> is
786
 
raised but rules for normal Python lists are used. E.g. 
787
 
<tt class="docutils literal"><span class="pre">deleteRule(-1)</span></tt> removes the last rule in cssRules.</p>
788
 
<p><cite>index</cite> may also be a CSSRule object which will then be removed
789
 
from the media block.</p>
790
 
</li>
791
 
</ul>
792
 
</td>
793
 
</tr>
794
 
<tr class="field"><th class="field-name">Exceptions :</th><td class="field-body"><ul class="first last simple">
795
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.IndexSizeErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">IndexSizeErr</span></tt></a>:
796
 
Raised if the specified index does not correspond to a rule in
797
 
the media rule list.</li>
798
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.NoModificationAllowedErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">NoModificationAllowedErr</span></tt></a>:
799
 
Raised if this media rule is readonly.</li>
800
 
</ul>
801
 
</td>
802
 
</tr>
803
 
</tbody>
804
 
</table>
805
 
</dd></dl>
806
 
 
807
 
<dl class="method">
808
 
<dt id="cssutils.css.CSSMediaRule.insertRule">
809
 
<tt class="descname">insertRule</tt><big>(</big><em>rule</em>, <em>index=None</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSMediaRule.insertRule" title="Permalink to this definition">¶</a></dt>
810
 
<dd><p>Insert <cite>rule</cite> into the media block.</p>
811
 
<table class="docutils field-list" frame="void" rules="none">
812
 
<col class="field-name" />
813
 
<col class="field-body" />
814
 
<tbody valign="top">
815
 
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
816
 
<li><strong>rule</strong> &#8211; <p>the parsable text representing the <cite>rule</cite> to be inserted. For rule
817
 
sets this contains both the selector and the style declaration. 
818
 
For at-rules, this specifies both the at-identifier and the rule
819
 
content.</p>
820
 
<p>cssutils also allows rule to be a valid 
821
 
<a class="reference internal" href="#cssutils.css.CSSRule" title="cssutils.css.CSSRule"><tt class="xref py py-class docutils literal"><span class="pre">CSSRule</span></tt></a> object.</p>
822
 
</li>
823
 
<li><strong>index</strong> &#8211; before the specified <cite>rule</cite> will be inserted. 
824
 
If the specified <cite>index</cite> is
825
 
equal to the length of the media blocks&#8217;s rule collection, the
826
 
rule will be added to the end of the media block.
827
 
If index is not given or None rule will be appended to rule
828
 
list.</li>
829
 
</ul>
830
 
</td>
831
 
</tr>
832
 
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">the index within the media block&#8217;s rule collection of the
833
 
newly inserted rule.</p>
834
 
</td>
835
 
</tr>
836
 
<tr class="field"><th class="field-name">Exceptions :</th><td class="field-body"><ul class="first last simple">
837
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.HierarchyRequestErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">HierarchyRequestErr</span></tt></a>:
838
 
Raised if the <cite>rule</cite> cannot be inserted at the specified <cite>index</cite>,
839
 
e.g., if an &#64;import rule is inserted after a standard rule set
840
 
or other at-rule.</li>
841
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.IndexSizeErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">IndexSizeErr</span></tt></a>:
842
 
Raised if the specified <cite>index</cite> is not a valid insertion point.</li>
843
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.NoModificationAllowedErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">NoModificationAllowedErr</span></tt></a>:
844
 
Raised if this media rule is readonly.</li>
845
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.SyntaxErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">SyntaxErr</span></tt></a>:
846
 
Raised if the specified <cite>rule</cite> has a syntax error and is
847
 
unparsable.</li>
848
 
</ul>
849
 
</td>
850
 
</tr>
851
 
</tbody>
852
 
</table>
853
 
</dd></dl>
854
 
 
855
 
<dl class="attribute">
856
 
<dt id="cssutils.css.CSSMediaRule.media">
857
 
<tt class="descname">media</tt><a class="headerlink" href="#cssutils.css.CSSMediaRule.media" title="Permalink to this definition">¶</a></dt>
858
 
<dd><p>(DOM) A list of media types for this rule of type <a class="reference internal" href="stylesheets.html#cssutils.stylesheets.MediaList" title="cssutils.stylesheets.MediaList"><tt class="xref py py-class docutils literal"><span class="pre">MediaList</span></tt></a>.</p>
859
 
</dd></dl>
860
 
 
861
 
<dl class="attribute">
862
 
<dt id="cssutils.css.CSSMediaRule.name">
863
 
<tt class="descname">name</tt><a class="headerlink" href="#cssutils.css.CSSMediaRule.name" title="Permalink to this definition">¶</a></dt>
864
 
<dd><p>An optional name for this media rule.</p>
865
 
</dd></dl>
866
 
 
867
 
<dl class="attribute">
868
 
<dt id="cssutils.css.CSSMediaRule.parent">
869
 
<tt class="descname">parent</tt><a class="headerlink" href="#cssutils.css.CSSMediaRule.parent" title="Permalink to this definition">¶</a></dt>
870
 
<dd><p>The Parent Node of this CSSRule or None.</p>
871
 
</dd></dl>
872
 
 
873
 
<dl class="attribute">
874
 
<dt id="cssutils.css.CSSMediaRule.parentRule">
875
 
<tt class="descname">parentRule</tt><a class="headerlink" href="#cssutils.css.CSSMediaRule.parentRule" title="Permalink to this definition">¶</a></dt>
876
 
<dd><p>If this rule is contained inside another rule (e.g. a style rule inside an &#64;media block), this is the containing rule. If this rule is not nested inside any other rules, this returns None.</p>
877
 
</dd></dl>
878
 
 
879
 
<dl class="attribute">
880
 
<dt id="cssutils.css.CSSMediaRule.parentStyleSheet">
881
 
<tt class="descname">parentStyleSheet</tt><a class="headerlink" href="#cssutils.css.CSSMediaRule.parentStyleSheet" title="Permalink to this definition">¶</a></dt>
882
 
<dd><p>The style sheet that contains this rule.</p>
883
 
</dd></dl>
884
 
 
885
 
<dl class="attribute">
886
 
<dt id="cssutils.css.CSSMediaRule.seq">
887
 
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.CSSMediaRule.seq" title="Permalink to this definition">¶</a></dt>
888
 
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
889
 
</dd></dl>
890
 
 
891
 
<dl class="attribute">
892
 
<dt id="cssutils.css.CSSMediaRule.type">
893
 
<tt class="descname">type</tt><a class="headerlink" href="#cssutils.css.CSSMediaRule.type" title="Permalink to this definition">¶</a></dt>
894
 
<dd><p>The type of this rule, as defined by a CSSRule type constant.</p>
895
 
</dd></dl>
896
 
 
897
 
<dl class="attribute">
898
 
<dt id="cssutils.css.CSSMediaRule.typeString">
899
 
<tt class="descname">typeString</tt><a class="headerlink" href="#cssutils.css.CSSMediaRule.typeString" title="Permalink to this definition">¶</a></dt>
900
 
<dd><p>Descriptive name of this rule&#8217;s type.</p>
901
 
</dd></dl>
902
 
 
903
 
</dd></dl>
904
 
 
905
 
</div>
906
 
<div class="section" id="cssnamespacerule">
907
 
<h3><tt class="docutils literal"><span class="pre">CSSNamespaceRule</span></tt><a class="headerlink" href="#cssnamespacerule" title="Permalink to this headline">¶</a></h3>
908
 
<dl class="class">
909
 
<dt id="cssutils.css.CSSNamespaceRule">
910
 
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSNamespaceRule</tt><big>(</big><em>namespaceURI=None</em>, <em>prefix=None</em>, <em>cssText=None</em>, <em>parentRule=None</em>, <em>parentStyleSheet=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSNamespaceRule" title="Permalink to this definition">¶</a></dt>
911
 
<dd><p>Represents an &#64;namespace rule within a CSS style sheet.</p>
912
 
<p>The &#64;namespace at-rule declares a namespace prefix and associates
913
 
it with a given namespace (a string). This namespace prefix can then be
914
 
used in namespace-qualified names such as those described in the
915
 
Selectors Module [SELECT] or the Values and Units module [CSS3VAL].</p>
916
 
<p>Dealing with these rules directly is not needed anymore, easier is 
917
 
the use of <a class="reference internal" href="#cssutils.css.CSSStyleSheet.namespaces" title="cssutils.css.CSSStyleSheet.namespaces"><tt class="xref py py-attr docutils literal"><span class="pre">cssutils.css.CSSStyleSheet.namespaces</span></tt></a>.</p>
918
 
<p>Format:</p>
919
 
<div class="highlight-python"><pre>namespace
920
 
  : NAMESPACE_SYM S* [namespace_prefix S*]? [STRING|URI] S* ';' S*
921
 
  ;
922
 
namespace_prefix
923
 
  : IDENT
924
 
  ;</pre>
925
 
</div>
926
 
<dl class="attribute">
927
 
<dt id="cssutils.css.CSSNamespaceRule.atkeyword">
928
 
<tt class="descname">atkeyword</tt><a class="headerlink" href="#cssutils.css.CSSNamespaceRule.atkeyword" title="Permalink to this definition">¶</a></dt>
929
 
<dd><p>Literal keyword of an &#64;rule (e.g. <tt class="docutils literal"><span class="pre">&#64;IMport</span></tt>).</p>
930
 
</dd></dl>
931
 
 
932
 
<dl class="attribute">
933
 
<dt id="cssutils.css.CSSNamespaceRule.cssText">
934
 
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.CSSNamespaceRule.cssText" title="Permalink to this definition">¶</a></dt>
935
 
<dd><p>(DOM) The parsable textual representation of this rule.</p>
936
 
</dd></dl>
937
 
 
938
 
<dl class="attribute">
939
 
<dt id="cssutils.css.CSSNamespaceRule.namespaceURI">
940
 
<tt class="descname">namespaceURI</tt><a class="headerlink" href="#cssutils.css.CSSNamespaceRule.namespaceURI" title="Permalink to this definition">¶</a></dt>
941
 
<dd><p>URI (handled as simple string) of the defined namespace.</p>
942
 
</dd></dl>
943
 
 
944
 
<dl class="attribute">
945
 
<dt id="cssutils.css.CSSNamespaceRule.parent">
946
 
<tt class="descname">parent</tt><a class="headerlink" href="#cssutils.css.CSSNamespaceRule.parent" title="Permalink to this definition">¶</a></dt>
947
 
<dd><p>The Parent Node of this CSSRule or None.</p>
948
 
</dd></dl>
949
 
 
950
 
<dl class="attribute">
951
 
<dt id="cssutils.css.CSSNamespaceRule.parentRule">
952
 
<tt class="descname">parentRule</tt><a class="headerlink" href="#cssutils.css.CSSNamespaceRule.parentRule" title="Permalink to this definition">¶</a></dt>
953
 
<dd><p>If this rule is contained inside another rule (e.g. a style rule inside an &#64;media block), this is the containing rule. If this rule is not nested inside any other rules, this returns None.</p>
954
 
</dd></dl>
955
 
 
956
 
<dl class="attribute">
957
 
<dt id="cssutils.css.CSSNamespaceRule.parentStyleSheet">
958
 
<tt class="descname">parentStyleSheet</tt><a class="headerlink" href="#cssutils.css.CSSNamespaceRule.parentStyleSheet" title="Permalink to this definition">¶</a></dt>
959
 
<dd><p>The style sheet that contains this rule.</p>
960
 
</dd></dl>
961
 
 
962
 
<dl class="attribute">
963
 
<dt id="cssutils.css.CSSNamespaceRule.prefix">
964
 
<tt class="descname">prefix</tt><a class="headerlink" href="#cssutils.css.CSSNamespaceRule.prefix" title="Permalink to this definition">¶</a></dt>
965
 
<dd><p>Prefix used for the defined namespace.</p>
966
 
</dd></dl>
967
 
 
968
 
<dl class="attribute">
969
 
<dt id="cssutils.css.CSSNamespaceRule.seq">
970
 
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.CSSNamespaceRule.seq" title="Permalink to this definition">¶</a></dt>
971
 
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
972
 
</dd></dl>
973
 
 
974
 
<dl class="attribute">
975
 
<dt id="cssutils.css.CSSNamespaceRule.type">
976
 
<tt class="descname">type</tt><a class="headerlink" href="#cssutils.css.CSSNamespaceRule.type" title="Permalink to this definition">¶</a></dt>
977
 
<dd><p>The type of this rule, as defined by a CSSRule type constant.</p>
978
 
</dd></dl>
979
 
 
980
 
<dl class="attribute">
981
 
<dt id="cssutils.css.CSSNamespaceRule.typeString">
982
 
<tt class="descname">typeString</tt><a class="headerlink" href="#cssutils.css.CSSNamespaceRule.typeString" title="Permalink to this definition">¶</a></dt>
983
 
<dd><p>Descriptive name of this rule&#8217;s type.</p>
984
 
</dd></dl>
985
 
 
986
 
</dd></dl>
987
 
 
988
 
</div>
989
 
<div class="section" id="csspagerule">
990
 
<h3><tt class="docutils literal"><span class="pre">CSSPageRule</span></tt><a class="headerlink" href="#csspagerule" title="Permalink to this headline">¶</a></h3>
991
 
<dl class="class">
992
 
<dt id="cssutils.css.CSSPageRule">
993
 
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSPageRule</tt><big>(</big><em>selectorText=None</em>, <em>style=None</em>, <em>parentRule=None</em>, <em>parentStyleSheet=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSPageRule" title="Permalink to this definition">¶</a></dt>
994
 
<dd><p>The CSSPageRule interface represents a &#64;page rule within a CSS style
995
 
sheet. The &#64;page rule is used to specify the dimensions, orientation,
996
 
margins, etc. of a page box for paged media.</p>
997
 
<p>Format:</p>
998
 
<div class="highlight-python"><pre>page
999
 
  PAGE_SYM S* IDENT? pseudo_page? S* 
1000
 
    '{' S* declaration [ ';' S* declaration ]* '}' S*
1001
 
  ;
1002
 
pseudo_page
1003
 
  ':' [ "left" | "right" | "first" ]
1004
 
  ;</pre>
1005
 
</div>
1006
 
<dl class="attribute">
1007
 
<dt id="cssutils.css.CSSPageRule.atkeyword">
1008
 
<tt class="descname">atkeyword</tt><a class="headerlink" href="#cssutils.css.CSSPageRule.atkeyword" title="Permalink to this definition">¶</a></dt>
1009
 
<dd><p>Literal keyword of an &#64;rule (e.g. <tt class="docutils literal"><span class="pre">&#64;IMport</span></tt>).</p>
1010
 
</dd></dl>
1011
 
 
1012
 
<dl class="attribute">
1013
 
<dt id="cssutils.css.CSSPageRule.cssText">
1014
 
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.CSSPageRule.cssText" title="Permalink to this definition">¶</a></dt>
1015
 
<dd><p>(DOM) The parsable textual representation of this rule.</p>
1016
 
</dd></dl>
1017
 
 
1018
 
<dl class="attribute">
1019
 
<dt id="cssutils.css.CSSPageRule.parent">
1020
 
<tt class="descname">parent</tt><a class="headerlink" href="#cssutils.css.CSSPageRule.parent" title="Permalink to this definition">¶</a></dt>
1021
 
<dd><p>The Parent Node of this CSSRule or None.</p>
1022
 
</dd></dl>
1023
 
 
1024
 
<dl class="attribute">
1025
 
<dt id="cssutils.css.CSSPageRule.parentRule">
1026
 
<tt class="descname">parentRule</tt><a class="headerlink" href="#cssutils.css.CSSPageRule.parentRule" title="Permalink to this definition">¶</a></dt>
1027
 
<dd><p>If this rule is contained inside another rule (e.g. a style rule inside an &#64;media block), this is the containing rule. If this rule is not nested inside any other rules, this returns None.</p>
1028
 
</dd></dl>
1029
 
 
1030
 
<dl class="attribute">
1031
 
<dt id="cssutils.css.CSSPageRule.parentStyleSheet">
1032
 
<tt class="descname">parentStyleSheet</tt><a class="headerlink" href="#cssutils.css.CSSPageRule.parentStyleSheet" title="Permalink to this definition">¶</a></dt>
1033
 
<dd><p>The style sheet that contains this rule.</p>
1034
 
</dd></dl>
1035
 
 
1036
 
<dl class="attribute">
1037
 
<dt id="cssutils.css.CSSPageRule.selectorText">
1038
 
<tt class="descname">selectorText</tt><a class="headerlink" href="#cssutils.css.CSSPageRule.selectorText" title="Permalink to this definition">¶</a></dt>
1039
 
<dd><p>(DOM) The parsable textual representation of the page selector for the rule.</p>
1040
 
</dd></dl>
1041
 
 
1042
 
<dl class="attribute">
1043
 
<dt id="cssutils.css.CSSPageRule.seq">
1044
 
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.CSSPageRule.seq" title="Permalink to this definition">¶</a></dt>
1045
 
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
1046
 
</dd></dl>
1047
 
 
1048
 
<dl class="attribute">
1049
 
<dt id="cssutils.css.CSSPageRule.style">
1050
 
<tt class="descname">style</tt><a class="headerlink" href="#cssutils.css.CSSPageRule.style" title="Permalink to this definition">¶</a></dt>
1051
 
<dd><p>(DOM) The declaration-block of this rule set, a <a class="reference internal" href="#cssutils.css.CSSStyleDeclaration" title="cssutils.css.CSSStyleDeclaration"><tt class="xref py py-class docutils literal"><span class="pre">CSSStyleDeclaration</span></tt></a>.</p>
1052
 
</dd></dl>
1053
 
 
1054
 
<dl class="attribute">
1055
 
<dt id="cssutils.css.CSSPageRule.type">
1056
 
<tt class="descname">type</tt><a class="headerlink" href="#cssutils.css.CSSPageRule.type" title="Permalink to this definition">¶</a></dt>
1057
 
<dd><p>The type of this rule, as defined by a CSSRule type constant.</p>
1058
 
</dd></dl>
1059
 
 
1060
 
<dl class="attribute">
1061
 
<dt id="cssutils.css.CSSPageRule.typeString">
1062
 
<tt class="descname">typeString</tt><a class="headerlink" href="#cssutils.css.CSSPageRule.typeString" title="Permalink to this definition">¶</a></dt>
1063
 
<dd><p>Descriptive name of this rule&#8217;s type.</p>
1064
 
</dd></dl>
1065
 
 
1066
 
</dd></dl>
1067
 
 
1068
 
</div>
1069
 
<div class="section" id="cssstylerule">
1070
 
<h3><tt class="docutils literal"><span class="pre">CSSStyleRule</span></tt><a class="headerlink" href="#cssstylerule" title="Permalink to this headline">¶</a></h3>
1071
 
<dl class="class">
1072
 
<dt id="cssutils.css.CSSStyleRule">
1073
 
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSStyleRule</tt><big>(</big><em>selectorText=None</em>, <em>style=None</em>, <em>parentRule=None</em>, <em>parentStyleSheet=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleRule" title="Permalink to this definition">¶</a></dt>
1074
 
<dd><p>The CSSStyleRule object represents a ruleset specified (if any) in a CSS
1075
 
style sheet. It provides access to a declaration block as well as to the
1076
 
associated group of selectors.</p>
1077
 
<p>Format:</p>
1078
 
<div class="highlight-python"><pre>: selector [ COMMA S* selector ]*
1079
 
LBRACE S* declaration [ ';' S* declaration ]* '}' S*
1080
 
;</pre>
1081
 
</div>
1082
 
<dl class="attribute">
1083
 
<dt id="cssutils.css.CSSStyleRule.atkeyword">
1084
 
<tt class="descname">atkeyword</tt><a class="headerlink" href="#cssutils.css.CSSStyleRule.atkeyword" title="Permalink to this definition">¶</a></dt>
1085
 
<dd><p>Literal keyword of an &#64;rule (e.g. <tt class="docutils literal"><span class="pre">&#64;IMport</span></tt>).</p>
1086
 
</dd></dl>
1087
 
 
1088
 
<dl class="attribute">
1089
 
<dt id="cssutils.css.CSSStyleRule.cssText">
1090
 
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.CSSStyleRule.cssText" title="Permalink to this definition">¶</a></dt>
1091
 
<dd><p>(DOM) The parsable textual representation of this rule.</p>
1092
 
</dd></dl>
1093
 
 
1094
 
<dl class="attribute">
1095
 
<dt id="cssutils.css.CSSStyleRule.parent">
1096
 
<tt class="descname">parent</tt><a class="headerlink" href="#cssutils.css.CSSStyleRule.parent" title="Permalink to this definition">¶</a></dt>
1097
 
<dd><p>The Parent Node of this CSSRule or None.</p>
1098
 
</dd></dl>
1099
 
 
1100
 
<dl class="attribute">
1101
 
<dt id="cssutils.css.CSSStyleRule.parentRule">
1102
 
<tt class="descname">parentRule</tt><a class="headerlink" href="#cssutils.css.CSSStyleRule.parentRule" title="Permalink to this definition">¶</a></dt>
1103
 
<dd><p>If this rule is contained inside another rule (e.g. a style rule inside an &#64;media block), this is the containing rule. If this rule is not nested inside any other rules, this returns None.</p>
1104
 
</dd></dl>
1105
 
 
1106
 
<dl class="attribute">
1107
 
<dt id="cssutils.css.CSSStyleRule.parentStyleSheet">
1108
 
<tt class="descname">parentStyleSheet</tt><a class="headerlink" href="#cssutils.css.CSSStyleRule.parentStyleSheet" title="Permalink to this definition">¶</a></dt>
1109
 
<dd><p>The style sheet that contains this rule.</p>
1110
 
</dd></dl>
1111
 
 
1112
 
<dl class="attribute">
1113
 
<dt id="cssutils.css.CSSStyleRule.selectorList">
1114
 
<tt class="descname">selectorList</tt><a class="headerlink" href="#cssutils.css.CSSStyleRule.selectorList" title="Permalink to this definition">¶</a></dt>
1115
 
<dd><p>The SelectorList of this rule.</p>
1116
 
</dd></dl>
1117
 
 
1118
 
<dl class="attribute">
1119
 
<dt id="cssutils.css.CSSStyleRule.selectorText">
1120
 
<tt class="descname">selectorText</tt><a class="headerlink" href="#cssutils.css.CSSStyleRule.selectorText" title="Permalink to this definition">¶</a></dt>
1121
 
<dd><p>(DOM) The textual representation of the selector for the rule set.</p>
1122
 
</dd></dl>
1123
 
 
1124
 
<dl class="attribute">
1125
 
<dt id="cssutils.css.CSSStyleRule.seq">
1126
 
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.CSSStyleRule.seq" title="Permalink to this definition">¶</a></dt>
1127
 
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
1128
 
</dd></dl>
1129
 
 
1130
 
<dl class="attribute">
1131
 
<dt id="cssutils.css.CSSStyleRule.style">
1132
 
<tt class="descname">style</tt><a class="headerlink" href="#cssutils.css.CSSStyleRule.style" title="Permalink to this definition">¶</a></dt>
1133
 
<dd><p>(DOM) The declaration-block of this rule set.</p>
1134
 
</dd></dl>
1135
 
 
1136
 
<dl class="attribute">
1137
 
<dt id="cssutils.css.CSSStyleRule.type">
1138
 
<tt class="descname">type</tt><a class="headerlink" href="#cssutils.css.CSSStyleRule.type" title="Permalink to this definition">¶</a></dt>
1139
 
<dd><p>The type of this rule, as defined by a CSSRule type constant.</p>
1140
 
</dd></dl>
1141
 
 
1142
 
<dl class="attribute">
1143
 
<dt id="cssutils.css.CSSStyleRule.typeString">
1144
 
<tt class="descname">typeString</tt><a class="headerlink" href="#cssutils.css.CSSStyleRule.typeString" title="Permalink to this definition">¶</a></dt>
1145
 
<dd><p>Descriptive name of this rule&#8217;s type.</p>
1146
 
</dd></dl>
1147
 
 
1148
 
</dd></dl>
1149
 
 
1150
 
</div>
1151
 
<div class="section" id="cssvariablesrule">
1152
 
<h3><tt class="docutils literal"><span class="pre">CSSVariablesRule</span></tt><a class="headerlink" href="#cssvariablesrule" title="Permalink to this headline">¶</a></h3>
1153
 
<dl class="class">
1154
 
<dt id="cssutils.css.CSSVariablesRule">
1155
 
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSVariablesRule</tt><big>(</big><em>mediaText=None</em>, <em>variables=None</em>, <em>parentRule=None</em>, <em>parentStyleSheet=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSVariablesRule" title="Permalink to this definition">¶</a></dt>
1156
 
<dd><p>The CSSVariablesRule interface represents a &#64;variables rule within a CSS
1157
 
style sheet. The &#64;variables rule is used to specify variables.</p>
1158
 
<p>cssutils uses a <a class="reference internal" href="#cssutils.css.CSSVariablesDeclaration" title="cssutils.css.CSSVariablesDeclaration"><tt class="xref py py-class docutils literal"><span class="pre">CSSVariablesDeclaration</span></tt></a>  to
1159
 
represent the variables.</p>
1160
 
<p>Format:</p>
1161
 
<div class="highlight-python"><pre>variables
1162
 
    VARIABLES_SYM S* medium [ COMMA S* medium ]* LBRACE S* 
1163
 
    variableset* '}' S*
1164
 
    ;</pre>
1165
 
</div>
1166
 
<p>for variableset see <a class="reference internal" href="#cssutils.css.CSSVariablesDeclaration" title="cssutils.css.CSSVariablesDeclaration"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSVariablesDeclaration</span></tt></a></p>
1167
 
<p><strong>Media are not implemented. Reason is that cssutils is using CSS
1168
 
variables in a kind of preprocessing and therefor no media information
1169
 
is available at this stage. For now do not use media!</strong></p>
1170
 
<p>Example:</p>
1171
 
<div class="highlight-python"><pre>@variables {
1172
 
  CorporateLogoBGColor: #fe8d12;
1173
 
}
1174
 
 
1175
 
div.logoContainer {
1176
 
  background-color: var(CorporateLogoBGColor);
1177
 
}</pre>
1178
 
</div>
1179
 
<dl class="attribute">
1180
 
<dt id="cssutils.css.CSSVariablesRule.atkeyword">
1181
 
<tt class="descname">atkeyword</tt><a class="headerlink" href="#cssutils.css.CSSVariablesRule.atkeyword" title="Permalink to this definition">¶</a></dt>
1182
 
<dd><p>Literal keyword of an &#64;rule (e.g. <tt class="docutils literal"><span class="pre">&#64;IMport</span></tt>).</p>
1183
 
</dd></dl>
1184
 
 
1185
 
<dl class="attribute">
1186
 
<dt id="cssutils.css.CSSVariablesRule.cssText">
1187
 
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.CSSVariablesRule.cssText" title="Permalink to this definition">¶</a></dt>
1188
 
<dd><p>(DOM) The parsable textual representation of this rule.</p>
1189
 
</dd></dl>
1190
 
 
1191
 
<dl class="attribute">
1192
 
<dt id="cssutils.css.CSSVariablesRule.media">
1193
 
<tt class="descname">media</tt><a class="headerlink" href="#cssutils.css.CSSVariablesRule.media" title="Permalink to this definition">¶</a></dt>
1194
 
<dd><p>NOT IMPLEMENTED! As cssutils resolves variables during serializing media information is lost.</p>
1195
 
</dd></dl>
1196
 
 
1197
 
<dl class="attribute">
1198
 
<dt id="cssutils.css.CSSVariablesRule.parent">
1199
 
<tt class="descname">parent</tt><a class="headerlink" href="#cssutils.css.CSSVariablesRule.parent" title="Permalink to this definition">¶</a></dt>
1200
 
<dd><p>The Parent Node of this CSSRule or None.</p>
1201
 
</dd></dl>
1202
 
 
1203
 
<dl class="attribute">
1204
 
<dt id="cssutils.css.CSSVariablesRule.parentRule">
1205
 
<tt class="descname">parentRule</tt><a class="headerlink" href="#cssutils.css.CSSVariablesRule.parentRule" title="Permalink to this definition">¶</a></dt>
1206
 
<dd><p>If this rule is contained inside another rule (e.g. a style rule inside an &#64;media block), this is the containing rule. If this rule is not nested inside any other rules, this returns None.</p>
1207
 
</dd></dl>
1208
 
 
1209
 
<dl class="attribute">
1210
 
<dt id="cssutils.css.CSSVariablesRule.parentStyleSheet">
1211
 
<tt class="descname">parentStyleSheet</tt><a class="headerlink" href="#cssutils.css.CSSVariablesRule.parentStyleSheet" title="Permalink to this definition">¶</a></dt>
1212
 
<dd><p>The style sheet that contains this rule.</p>
1213
 
</dd></dl>
1214
 
 
1215
 
<dl class="attribute">
1216
 
<dt id="cssutils.css.CSSVariablesRule.seq">
1217
 
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.CSSVariablesRule.seq" title="Permalink to this definition">¶</a></dt>
1218
 
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
1219
 
</dd></dl>
1220
 
 
1221
 
<dl class="attribute">
1222
 
<dt id="cssutils.css.CSSVariablesRule.type">
1223
 
<tt class="descname">type</tt><a class="headerlink" href="#cssutils.css.CSSVariablesRule.type" title="Permalink to this definition">¶</a></dt>
1224
 
<dd><p>The type of this rule, as defined by a CSSRule type constant.</p>
1225
 
</dd></dl>
1226
 
 
1227
 
<dl class="attribute">
1228
 
<dt id="cssutils.css.CSSVariablesRule.typeString">
1229
 
<tt class="descname">typeString</tt><a class="headerlink" href="#cssutils.css.CSSVariablesRule.typeString" title="Permalink to this definition">¶</a></dt>
1230
 
<dd><p>Descriptive name of this rule&#8217;s type.</p>
1231
 
</dd></dl>
1232
 
 
1233
 
<dl class="attribute">
1234
 
<dt id="cssutils.css.CSSVariablesRule.valid">
1235
 
<tt class="descname">valid</tt><a class="headerlink" href="#cssutils.css.CSSVariablesRule.valid" title="Permalink to this definition">¶</a></dt>
1236
 
<dd><p>NOT IMPLEMTED REALLY (TODO)</p>
1237
 
</dd></dl>
1238
 
 
1239
 
<dl class="attribute">
1240
 
<dt id="cssutils.css.CSSVariablesRule.variables">
1241
 
<tt class="descname">variables</tt><a class="headerlink" href="#cssutils.css.CSSVariablesRule.variables" title="Permalink to this definition">¶</a></dt>
1242
 
<dd><p>(DOM) The variables of this rule set, a <a class="reference internal" href="#cssutils.css.CSSVariablesDeclaration" title="cssutils.css.CSSVariablesDeclaration"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSVariablesDeclaration</span></tt></a>.</p>
1243
 
</dd></dl>
1244
 
 
1245
 
</dd></dl>
1246
 
 
1247
 
</div>
1248
 
<div class="section" id="csscomment">
1249
 
<h3><tt class="docutils literal"><span class="pre">CSSComment</span></tt><a class="headerlink" href="#csscomment" title="Permalink to this headline">¶</a></h3>
1250
 
<dl class="class">
1251
 
<dt id="cssutils.css.CSSComment">
1252
 
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSComment</tt><big>(</big><em>cssText=None</em>, <em>parentRule=None</em>, <em>parentStyleSheet=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSComment" title="Permalink to this definition">¶</a></dt>
1253
 
<dd><p>Represents a CSS comment (cssutils only).</p>
1254
 
<p>Format:</p>
1255
 
<div class="highlight-python"><pre>/*...*/</pre>
1256
 
</div>
1257
 
<dl class="attribute">
1258
 
<dt id="cssutils.css.CSSComment.atkeyword">
1259
 
<tt class="descname">atkeyword</tt><a class="headerlink" href="#cssutils.css.CSSComment.atkeyword" title="Permalink to this definition">¶</a></dt>
1260
 
<dd><p>Literal keyword of an &#64;rule (e.g. <tt class="docutils literal"><span class="pre">&#64;IMport</span></tt>).</p>
1261
 
</dd></dl>
1262
 
 
1263
 
<dl class="attribute">
1264
 
<dt id="cssutils.css.CSSComment.cssText">
1265
 
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.CSSComment.cssText" title="Permalink to this definition">¶</a></dt>
1266
 
<dd><p>The parsable textual representation of this rule.</p>
1267
 
</dd></dl>
1268
 
 
1269
 
<dl class="attribute">
1270
 
<dt id="cssutils.css.CSSComment.parent">
1271
 
<tt class="descname">parent</tt><a class="headerlink" href="#cssutils.css.CSSComment.parent" title="Permalink to this definition">¶</a></dt>
1272
 
<dd><p>The Parent Node of this CSSRule or None.</p>
1273
 
</dd></dl>
1274
 
 
1275
 
<dl class="attribute">
1276
 
<dt id="cssutils.css.CSSComment.parentRule">
1277
 
<tt class="descname">parentRule</tt><a class="headerlink" href="#cssutils.css.CSSComment.parentRule" title="Permalink to this definition">¶</a></dt>
1278
 
<dd><p>If this rule is contained inside another rule (e.g. a style rule inside an &#64;media block), this is the containing rule. If this rule is not nested inside any other rules, this returns None.</p>
1279
 
</dd></dl>
1280
 
 
1281
 
<dl class="attribute">
1282
 
<dt id="cssutils.css.CSSComment.parentStyleSheet">
1283
 
<tt class="descname">parentStyleSheet</tt><a class="headerlink" href="#cssutils.css.CSSComment.parentStyleSheet" title="Permalink to this definition">¶</a></dt>
1284
 
<dd><p>The style sheet that contains this rule.</p>
1285
 
</dd></dl>
1286
 
 
1287
 
<dl class="attribute">
1288
 
<dt id="cssutils.css.CSSComment.seq">
1289
 
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.CSSComment.seq" title="Permalink to this definition">¶</a></dt>
1290
 
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
1291
 
</dd></dl>
1292
 
 
1293
 
<dl class="attribute">
1294
 
<dt id="cssutils.css.CSSComment.type">
1295
 
<tt class="descname">type</tt><a class="headerlink" href="#cssutils.css.CSSComment.type" title="Permalink to this definition">¶</a></dt>
1296
 
<dd><p>The type of this rule, as defined by a CSSRule type constant.</p>
1297
 
</dd></dl>
1298
 
 
1299
 
<dl class="attribute">
1300
 
<dt id="cssutils.css.CSSComment.typeString">
1301
 
<tt class="descname">typeString</tt><a class="headerlink" href="#cssutils.css.CSSComment.typeString" title="Permalink to this definition">¶</a></dt>
1302
 
<dd><p>Descriptive name of this rule&#8217;s type.</p>
1303
 
</dd></dl>
1304
 
 
1305
 
</dd></dl>
1306
 
 
1307
 
</div>
1308
 
</div>
1309
 
<div class="section" id="selector-related-classes-selectorlist-and-selector">
1310
 
<h2>Selector related classes: <tt class="docutils literal"><span class="pre">SelectorList</span></tt> and <tt class="docutils literal"><span class="pre">Selector</span></tt><a class="headerlink" href="#selector-related-classes-selectorlist-and-selector" title="Permalink to this headline">¶</a></h2>
1311
 
<div class="section" id="selectorlist">
1312
 
<h3><tt class="docutils literal"><span class="pre">SelectorList</span></tt><a class="headerlink" href="#selectorlist" title="Permalink to this headline">¶</a></h3>
1313
 
<dl class="class">
1314
 
<dt id="cssutils.css.SelectorList">
1315
 
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">SelectorList</tt><big>(</big><em>selectorText=None</em>, <em>parentRule=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.SelectorList" title="Permalink to this definition">¶</a></dt>
1316
 
<dd><p>A list of <a class="reference internal" href="#cssutils.css.Selector" title="cssutils.css.Selector"><tt class="xref py py-class docutils literal"><span class="pre">Selector</span></tt></a> objects
1317
 
of a <a class="reference internal" href="#cssutils.css.CSSStyleRule" title="cssutils.css.CSSStyleRule"><tt class="xref py py-class docutils literal"><span class="pre">CSSStyleRule</span></tt></a>.</p>
1318
 
<dl class="method">
1319
 
<dt id="cssutils.css.SelectorList.append">
1320
 
<tt class="descname">append</tt><big>(</big><em>newSelector</em><big>)</big><a class="headerlink" href="#cssutils.css.SelectorList.append" title="Permalink to this definition">¶</a></dt>
1321
 
<dd><p>Same as <a class="reference internal" href="#cssutils.css.SelectorList.appendSelector" title="cssutils.css.SelectorList.appendSelector"><tt class="xref py py-meth docutils literal"><span class="pre">appendSelector()</span></tt></a>.</p>
1322
 
</dd></dl>
1323
 
 
1324
 
<dl class="method">
1325
 
<dt id="cssutils.css.SelectorList.appendSelector">
1326
 
<tt class="descname">appendSelector</tt><big>(</big><em>newSelector</em><big>)</big><a class="headerlink" href="#cssutils.css.SelectorList.appendSelector" title="Permalink to this definition">¶</a></dt>
1327
 
<dd><p>Append <cite>newSelector</cite> to this list (a string will be converted to a 
1328
 
<a class="reference internal" href="#cssutils.css.Selector" title="cssutils.css.Selector"><tt class="xref py py-class docutils literal"><span class="pre">Selector</span></tt></a>).</p>
1329
 
<table class="docutils field-list" frame="void" rules="none">
1330
 
<col class="field-name" />
1331
 
<col class="field-body" />
1332
 
<tbody valign="top">
1333
 
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1334
 
<li><strong>newSelector</strong> &#8211; comma-separated list of selectors (as a single string) or a tuple of
1335
 
<cite>(newSelector, dict-of-namespaces)</cite></li>
1336
 
</ul>
1337
 
</td>
1338
 
</tr>
1339
 
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">New <a class="reference internal" href="#cssutils.css.Selector" title="cssutils.css.Selector"><tt class="xref py py-class docutils literal"><span class="pre">Selector</span></tt></a> or <tt class="xref docutils literal"><span class="pre">None</span></tt> if 
1340
 
<cite>newSelector</cite> is not wellformed.</p>
1341
 
</td>
1342
 
</tr>
1343
 
<tr class="field"><th class="field-name">Exceptions :</th><td class="field-body"><ul class="first last simple">
1344
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.NamespaceErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">NamespaceErr</span></tt></a>:
1345
 
Raised if the specified selector uses an unknown namespace
1346
 
prefix.</li>
1347
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.SyntaxErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">SyntaxErr</span></tt></a>:
1348
 
Raised if the specified CSS string value has a syntax error
1349
 
and is unparsable.</li>
1350
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.NoModificationAllowedErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">NoModificationAllowedErr</span></tt></a>:
1351
 
Raised if this rule is readonly.</li>
1352
 
</ul>
1353
 
</td>
1354
 
</tr>
1355
 
</tbody>
1356
 
</table>
1357
 
</dd></dl>
1358
 
 
1359
 
<dl class="attribute">
1360
 
<dt id="cssutils.css.SelectorList.length">
1361
 
<tt class="descname">length</tt><a class="headerlink" href="#cssutils.css.SelectorList.length" title="Permalink to this definition">¶</a></dt>
1362
 
<dd><p>The number of <a class="reference internal" href="#cssutils.css.Selector" title="cssutils.css.Selector"><tt class="xref py py-class docutils literal"><span class="pre">Selector</span></tt></a> objects in the list.</p>
1363
 
</dd></dl>
1364
 
 
1365
 
<dl class="attribute">
1366
 
<dt id="cssutils.css.SelectorList.parentRule">
1367
 
<tt class="descname">parentRule</tt><a class="headerlink" href="#cssutils.css.SelectorList.parentRule" title="Permalink to this definition">¶</a></dt>
1368
 
<dd><p>(DOM) The CSS rule that contains this SelectorList or <tt class="xref docutils literal"><span class="pre">None</span></tt> if this SelectorList is not attached to a CSSRule.</p>
1369
 
</dd></dl>
1370
 
 
1371
 
<dl class="attribute">
1372
 
<dt id="cssutils.css.SelectorList.selectorText">
1373
 
<tt class="descname">selectorText</tt><a class="headerlink" href="#cssutils.css.SelectorList.selectorText" title="Permalink to this definition">¶</a></dt>
1374
 
<dd><p>(cssutils) The textual representation of the selector for a rule set.</p>
1375
 
</dd></dl>
1376
 
 
1377
 
</dd></dl>
1378
 
 
1379
 
</div>
1380
 
<div class="section" id="selector">
1381
 
<h3><tt class="docutils literal"><span class="pre">Selector</span></tt><a class="headerlink" href="#selector" title="Permalink to this headline">¶</a></h3>
1382
 
<dl class="class">
1383
 
<dt id="cssutils.css.Selector">
1384
 
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">Selector</tt><big>(</big><em>selectorText=None</em>, <em>parent=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.Selector" title="Permalink to this definition">¶</a></dt>
1385
 
<dd><p>(cssutils) a single selector in a <a class="reference internal" href="#cssutils.css.SelectorList" title="cssutils.css.SelectorList"><tt class="xref py py-class docutils literal"><span class="pre">SelectorList</span></tt></a> 
1386
 
of a <a class="reference internal" href="#cssutils.css.CSSStyleRule" title="cssutils.css.CSSStyleRule"><tt class="xref py py-class docutils literal"><span class="pre">CSSStyleRule</span></tt></a>.</p>
1387
 
<p>Format:</p>
1388
 
<div class="highlight-python"><pre># implemented in SelectorList
1389
 
selectors_group
1390
 
  : selector [ COMMA S* selector ]*
1391
 
  ;
1392
 
 
1393
 
selector
1394
 
  : simple_selector_sequence [ combinator simple_selector_sequence ]*
1395
 
  ;
1396
 
 
1397
 
combinator
1398
 
  /* combinators can be surrounded by white space */
1399
 
  : PLUS S* | GREATER S* | TILDE S* | S+
1400
 
  ;
1401
 
 
1402
 
simple_selector_sequence
1403
 
  : [ type_selector | universal ]
1404
 
    [ HASH | class | attrib | pseudo | negation ]*
1405
 
  | [ HASH | class | attrib | pseudo | negation ]+
1406
 
  ;
1407
 
 
1408
 
type_selector
1409
 
  : [ namespace_prefix ]? element_name
1410
 
  ;
1411
 
 
1412
 
namespace_prefix
1413
 
  : [ IDENT | '*' ]? '|'
1414
 
  ;
1415
 
 
1416
 
element_name
1417
 
  : IDENT
1418
 
  ;
1419
 
 
1420
 
universal
1421
 
  : [ namespace_prefix ]? '*'
1422
 
  ;
1423
 
 
1424
 
class
1425
 
  : '.' IDENT
1426
 
  ;
1427
 
 
1428
 
attrib
1429
 
  : '[' S* [ namespace_prefix ]? IDENT S*
1430
 
        [ [ PREFIXMATCH |
1431
 
            SUFFIXMATCH |
1432
 
            SUBSTRINGMATCH |
1433
 
            '=' |
1434
 
            INCLUDES |
1435
 
            DASHMATCH ] S* [ IDENT | STRING ] S*
1436
 
        ]? ']'
1437
 
  ;
1438
 
 
1439
 
pseudo
1440
 
  /* '::' starts a pseudo-element, ':' a pseudo-class */
1441
 
  /* Exceptions: :first-line, :first-letter, :before and :after. */
1442
 
  /* Note that pseudo-elements are restricted to one per selector and */
1443
 
  /* occur only in the last simple_selector_sequence. */
1444
 
  : ':' ':'? [ IDENT | functional_pseudo ]
1445
 
  ;
1446
 
 
1447
 
functional_pseudo
1448
 
  : FUNCTION S* expression ')'
1449
 
  ;
1450
 
 
1451
 
expression
1452
 
  /* In CSS3, the expressions are identifiers, strings, */
1453
 
  /* or of the form "an+b" */
1454
 
  : [ [ PLUS | '-' | DIMENSION | NUMBER | STRING | IDENT ] S* ]+
1455
 
  ;
1456
 
 
1457
 
negation
1458
 
  : NOT S* negation_arg S* ')'
1459
 
  ;
1460
 
 
1461
 
negation_arg
1462
 
  : type_selector | universal | HASH | class | attrib | pseudo
1463
 
  ;</pre>
1464
 
</div>
1465
 
<dl class="attribute">
1466
 
<dt id="cssutils.css.Selector.element">
1467
 
<tt class="descname">element</tt><a class="headerlink" href="#cssutils.css.Selector.element" title="Permalink to this definition">¶</a></dt>
1468
 
<dd><p>Effective element target of this selector.</p>
1469
 
</dd></dl>
1470
 
 
1471
 
<dl class="attribute">
1472
 
<dt id="cssutils.css.Selector.parent">
1473
 
<tt class="descname">parent</tt><a class="headerlink" href="#cssutils.css.Selector.parent" title="Permalink to this definition">¶</a></dt>
1474
 
<dd><p>(DOM) The SelectorList that contains this Selector or None if this Selector is not attached to a SelectorList.</p>
1475
 
</dd></dl>
1476
 
 
1477
 
<dl class="attribute">
1478
 
<dt id="cssutils.css.Selector.parentList">
1479
 
<tt class="descname">parentList</tt><a class="headerlink" href="#cssutils.css.Selector.parentList" title="Permalink to this definition">¶</a></dt>
1480
 
<dd><p>DEPRECATED, see property parent instead</p>
1481
 
</dd></dl>
1482
 
 
1483
 
<dl class="attribute">
1484
 
<dt id="cssutils.css.Selector.selectorText">
1485
 
<tt class="descname">selectorText</tt><a class="headerlink" href="#cssutils.css.Selector.selectorText" title="Permalink to this definition">¶</a></dt>
1486
 
<dd><p>(DOM) The parsable textual representation of the selector.</p>
1487
 
</dd></dl>
1488
 
 
1489
 
<dl class="attribute">
1490
 
<dt id="cssutils.css.Selector.seq">
1491
 
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.Selector.seq" title="Permalink to this definition">¶</a></dt>
1492
 
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
1493
 
</dd></dl>
1494
 
 
1495
 
<dl class="attribute">
1496
 
<dt id="cssutils.css.Selector.specificity">
1497
 
<tt class="descname">specificity</tt><a class="headerlink" href="#cssutils.css.Selector.specificity" title="Permalink to this definition">¶</a></dt>
1498
 
<dd><p>Specificity of this selector (READONLY). 
1499
 
Tuple of (a, b, c, d) where:</p>
1500
 
<dl class="docutils">
1501
 
<dt>a</dt>
1502
 
<dd>presence of style in document, always 0 if not used on a 
1503
 
document</dd>
1504
 
<dt>b</dt>
1505
 
<dd>number of ID selectors</dd>
1506
 
<dt>c </dt>
1507
 
<dd>number of .class selectors</dd>
1508
 
<dt>d </dt>
1509
 
<dd>number of Element (type) selectors</dd>
1510
 
</dl>
1511
 
</dd></dl>
1512
 
 
1513
 
</dd></dl>
1514
 
 
1515
 
</div>
1516
 
</div>
1517
 
<div class="section" id="style-related-classes-cssstyledeclaration-property-cssvalue-etc">
1518
 
<h2>Style related classes: <tt class="docutils literal"><span class="pre">CSSStyleDeclaration</span></tt>, <tt class="docutils literal"><span class="pre">Property</span></tt>, <tt class="docutils literal"><span class="pre">CSSValue</span></tt> etc<a class="headerlink" href="#style-related-classes-cssstyledeclaration-property-cssvalue-etc" title="Permalink to this headline">¶</a></h2>
1519
 
<div class="section" id="cssvariablesdeclaration">
1520
 
<h3><tt class="docutils literal"><span class="pre">CSSVariablesDeclaration</span></tt><a class="headerlink" href="#cssvariablesdeclaration" title="Permalink to this headline">¶</a></h3>
1521
 
<dl class="class">
1522
 
<dt id="cssutils.css.CSSVariablesDeclaration">
1523
 
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSVariablesDeclaration</tt><big>(</big><em>cssText=u''</em>, <em>parentRule=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSVariablesDeclaration" title="Permalink to this definition">¶</a></dt>
1524
 
<dd><p>The CSSVariablesDeclaration interface represents a single block of
1525
 
variable declarations.</p>
1526
 
<dl class="attribute">
1527
 
<dt id="cssutils.css.CSSVariablesDeclaration.cssText">
1528
 
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.CSSVariablesDeclaration.cssText" title="Permalink to this definition">¶</a></dt>
1529
 
<dd><p>(DOM) A parsable textual representation of the declaration block excluding the surrounding curly braces.</p>
1530
 
</dd></dl>
1531
 
 
1532
 
<dl class="method">
1533
 
<dt id="cssutils.css.CSSVariablesDeclaration.getVariableValue">
1534
 
<tt class="descname">getVariableValue</tt><big>(</big><em>variableName</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSVariablesDeclaration.getVariableValue" title="Permalink to this definition">¶</a></dt>
1535
 
<dd><p>Used to retrieve the value of a variable if it has been explicitly
1536
 
set within this variable declaration block.</p>
1537
 
<table class="docutils field-list" frame="void" rules="none">
1538
 
<col class="field-name" />
1539
 
<col class="field-body" />
1540
 
<tbody valign="top">
1541
 
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1542
 
<li><strong>variableName</strong> &#8211; The name of the variable.</li>
1543
 
</ul>
1544
 
</td>
1545
 
</tr>
1546
 
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">the value of the variable if it has been explicitly set in this
1547
 
variable declaration block. Returns the empty string if the
1548
 
variable has not been set.</p>
1549
 
</td>
1550
 
</tr>
1551
 
</tbody>
1552
 
</table>
1553
 
</dd></dl>
1554
 
 
1555
 
<dl class="method">
1556
 
<dt id="cssutils.css.CSSVariablesDeclaration.item">
1557
 
<tt class="descname">item</tt><big>(</big><em>index</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSVariablesDeclaration.item" title="Permalink to this definition">¶</a></dt>
1558
 
<dd><p>Used to retrieve the variables that have been explicitly set in
1559
 
this variable declaration block. The order of the variables
1560
 
retrieved using this method does not have to be the order in which
1561
 
they were set. This method can be used to iterate over all variables
1562
 
in this variable declaration block.</p>
1563
 
<table class="docutils field-list" frame="void" rules="none">
1564
 
<col class="field-name" />
1565
 
<col class="field-body" />
1566
 
<tbody valign="top">
1567
 
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1568
 
<li><strong>index</strong> &#8211; of the variable name to retrieve, negative values behave like
1569
 
negative indexes on Python lists, so -1 is the last element</li>
1570
 
</ul>
1571
 
</td>
1572
 
</tr>
1573
 
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The name of the variable at this ordinal position. The empty
1574
 
string if no variable exists at this position.</p>
1575
 
</td>
1576
 
</tr>
1577
 
</tbody>
1578
 
</table>
1579
 
</dd></dl>
1580
 
 
1581
 
<dl class="method">
1582
 
<dt id="cssutils.css.CSSVariablesDeclaration.keys">
1583
 
<tt class="descname">keys</tt><big>(</big><big>)</big><a class="headerlink" href="#cssutils.css.CSSVariablesDeclaration.keys" title="Permalink to this definition">¶</a></dt>
1584
 
<dd><p>Analoguous to standard dict returns variable names which are set in
1585
 
this declaration.</p>
1586
 
</dd></dl>
1587
 
 
1588
 
<dl class="attribute">
1589
 
<dt id="cssutils.css.CSSVariablesDeclaration.length">
1590
 
<tt class="descname">length</tt><a class="headerlink" href="#cssutils.css.CSSVariablesDeclaration.length" title="Permalink to this definition">¶</a></dt>
1591
 
<dd><p>The number of variables that have been explicitly set in this variable declaration block. The range of valid indices is 0 to length-1 inclusive.</p>
1592
 
</dd></dl>
1593
 
 
1594
 
<dl class="attribute">
1595
 
<dt id="cssutils.css.CSSVariablesDeclaration.parentRule">
1596
 
<tt class="descname">parentRule</tt><a class="headerlink" href="#cssutils.css.CSSVariablesDeclaration.parentRule" title="Permalink to this definition">¶</a></dt>
1597
 
<dd><p>(DOM) The CSS rule that contains this declaration block or None if this block is not attached to a CSSRule.</p>
1598
 
</dd></dl>
1599
 
 
1600
 
<dl class="method">
1601
 
<dt id="cssutils.css.CSSVariablesDeclaration.removeVariable">
1602
 
<tt class="descname">removeVariable</tt><big>(</big><em>variableName</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSVariablesDeclaration.removeVariable" title="Permalink to this definition">¶</a></dt>
1603
 
<dd><p>Used to remove a variable if it has been explicitly set within this
1604
 
variable declaration block.</p>
1605
 
<table class="docutils field-list" frame="void" rules="none">
1606
 
<col class="field-name" />
1607
 
<col class="field-body" />
1608
 
<tbody valign="top">
1609
 
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1610
 
<li><strong>variableName</strong> &#8211; The name of the variable.</li>
1611
 
</ul>
1612
 
</td>
1613
 
</tr>
1614
 
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">the value of the variable if it has been explicitly set for this
1615
 
variable declaration block. Returns the empty string if the
1616
 
variable has not been set.</p>
1617
 
</td>
1618
 
</tr>
1619
 
<tr class="field"><th class="field-name">Exceptions :</th><td class="field-body"><ul class="first last simple">
1620
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.NoModificationAllowedErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">NoModificationAllowedErr</span></tt></a>:
1621
 
Raised if this declaration is readonly is readonly.</li>
1622
 
</ul>
1623
 
</td>
1624
 
</tr>
1625
 
</tbody>
1626
 
</table>
1627
 
</dd></dl>
1628
 
 
1629
 
<dl class="attribute">
1630
 
<dt id="cssutils.css.CSSVariablesDeclaration.seq">
1631
 
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.CSSVariablesDeclaration.seq" title="Permalink to this definition">¶</a></dt>
1632
 
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
1633
 
</dd></dl>
1634
 
 
1635
 
<dl class="method">
1636
 
<dt id="cssutils.css.CSSVariablesDeclaration.setVariable">
1637
 
<tt class="descname">setVariable</tt><big>(</big><em>variableName</em>, <em>value</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSVariablesDeclaration.setVariable" title="Permalink to this definition">¶</a></dt>
1638
 
<dd><p>Used to set a variable value within this variable declaration block.</p>
1639
 
<table class="docutils field-list" frame="void" rules="none">
1640
 
<col class="field-name" />
1641
 
<col class="field-body" />
1642
 
<tbody valign="top">
1643
 
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1644
 
<li><strong>variableName</strong> &#8211; The name of the CSS variable.</li>
1645
 
<li><strong>value</strong> &#8211; The new value of the variable, may also be a CSSValue object.</li>
1646
 
</ul>
1647
 
</td>
1648
 
</tr>
1649
 
<tr class="field"><th class="field-name">Exceptions :</th><td class="field-body"><ul class="first last simple">
1650
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.SyntaxErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">SyntaxErr</span></tt></a>:
1651
 
Raised if the specified value has a syntax error and is
1652
 
unparsable.</li>
1653
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.NoModificationAllowedErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">NoModificationAllowedErr</span></tt></a>:
1654
 
Raised if this declaration is readonly or the property is
1655
 
readonly.</li>
1656
 
</ul>
1657
 
</td>
1658
 
</tr>
1659
 
</tbody>
1660
 
</table>
1661
 
</dd></dl>
1662
 
 
1663
 
</dd></dl>
1664
 
 
1665
 
</div>
1666
 
<div class="section" id="cssstyledeclaration">
1667
 
<h3><tt class="docutils literal"><span class="pre">CSSStyleDeclaration</span></tt><a class="headerlink" href="#cssstyledeclaration" title="Permalink to this headline">¶</a></h3>
1668
 
<dl class="class">
1669
 
<dt id="cssutils.css.CSSStyleDeclaration">
1670
 
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSStyleDeclaration</tt><big>(</big><em>cssText=u''</em>, <em>parentRule=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleDeclaration" title="Permalink to this definition">¶</a></dt>
1671
 
<dd><p>The CSSStyleDeclaration class represents a single CSS declaration
1672
 
block. This class may be used to determine the style properties
1673
 
currently set in a block or to set style properties explicitly
1674
 
within the block.</p>
1675
 
<p>While an implementation may not recognize all CSS properties within
1676
 
a CSS declaration block, it is expected to provide access to all
1677
 
specified properties in the style sheet through the
1678
 
CSSStyleDeclaration interface.
1679
 
Furthermore, implementations that support a specific level of CSS
1680
 
should correctly handle CSS shorthand properties for that level. For
1681
 
a further discussion of shorthand properties, see the CSS2Properties
1682
 
interface.</p>
1683
 
<p>Additionally the CSS2Properties interface is implemented.</p>
1684
 
<dl class="docutils">
1685
 
<dt>$css2propertyname</dt>
1686
 
<dd><p class="first">All properties defined in the CSS2Properties class are available
1687
 
as direct properties of CSSStyleDeclaration with their respective
1688
 
DOM name, so e.g. <tt class="docutils literal"><span class="pre">fontStyle</span></tt> for property &#8216;font-style&#8217;.</p>
1689
 
<p>These may be used as:</p>
1690
 
<div class="last highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">style</span> <span class="o">=</span> <span class="n">CSSStyleDeclaration</span><span class="p">(</span><span class="n">cssText</span><span class="o">=</span><span class="s">&#39;color: red&#39;</span><span class="p">)</span>
1691
 
<span class="gp">&gt;&gt;&gt; </span><span class="n">style</span><span class="o">.</span><span class="n">color</span> <span class="o">=</span> <span class="s">&#39;green&#39;</span>
1692
 
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">style</span><span class="o">.</span><span class="n">color</span>
1693
 
<span class="go">green</span>
1694
 
<span class="gp">&gt;&gt;&gt; </span><span class="k">del</span> <span class="n">style</span><span class="o">.</span><span class="n">color</span>
1695
 
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">style</span><span class="o">.</span><span class="n">color</span>
1696
 
<span class="go">&lt;BLANKLINE&gt;</span>
1697
 
</pre></div>
1698
 
</div>
1699
 
</dd>
1700
 
</dl>
1701
 
<p>Format:</p>
1702
 
<div class="highlight-python"><pre>[Property: Value Priority?;]* [Property: Value Priority?]?</pre>
1703
 
</div>
1704
 
<dl class="method">
1705
 
<dt id="cssutils.css.CSSStyleDeclaration.children">
1706
 
<tt class="descname">children</tt><big>(</big><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleDeclaration.children" title="Permalink to this definition">¶</a></dt>
1707
 
<dd><p>Generator yielding any known child in this declaration including
1708
 
<em>all</em> properties, comments or CSSUnknownrules.</p>
1709
 
</dd></dl>
1710
 
 
1711
 
<dl class="attribute">
1712
 
<dt id="cssutils.css.CSSStyleDeclaration.cssText">
1713
 
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.CSSStyleDeclaration.cssText" title="Permalink to this definition">¶</a></dt>
1714
 
<dd><p>(DOM) A parsable textual representation of the declaration block excluding the surrounding curly braces.</p>
1715
 
</dd></dl>
1716
 
 
1717
 
<dl class="method">
1718
 
<dt id="cssutils.css.CSSStyleDeclaration.getCssText">
1719
 
<tt class="descname">getCssText</tt><big>(</big><em>separator=None</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleDeclaration.getCssText" title="Permalink to this definition">¶</a></dt>
1720
 
<dd><table class="docutils field-list" frame="void" rules="none">
1721
 
<col class="field-name" />
1722
 
<col class="field-body" />
1723
 
<tbody valign="top">
1724
 
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">serialized property cssText, each property separated by
1725
 
given <cite>separator</cite> which may e.g. be <tt class="docutils literal"><span class="pre">u''</span></tt> to be able to use
1726
 
cssText directly in an HTML style attribute. <tt class="docutils literal"><span class="pre">;</span></tt> is part of
1727
 
each property (except the last one) and <strong>cannot</strong> be set with
1728
 
separator!</td>
1729
 
</tr>
1730
 
</tbody>
1731
 
</table>
1732
 
</dd></dl>
1733
 
 
1734
 
<dl class="method">
1735
 
<dt id="cssutils.css.CSSStyleDeclaration.getProperties">
1736
 
<tt class="descname">getProperties</tt><big>(</big><em>name=None</em>, <em>all=False</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleDeclaration.getProperties" title="Permalink to this definition">¶</a></dt>
1737
 
<dd><table class="docutils field-list" frame="void" rules="none">
1738
 
<col class="field-name" />
1739
 
<col class="field-body" />
1740
 
<tbody valign="top">
1741
 
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1742
 
<li><strong>name</strong> &#8211; optional <cite>name</cite> of properties which are requested.
1743
 
Only properties with this <strong>always normalized</strong> <cite>name</cite> are returned.
1744
 
If <cite>name</cite> is <tt class="xref docutils literal"><span class="pre">None</span></tt> all properties are returned (at least one for 
1745
 
each set name depending on parameter <cite>all</cite>).</li>
1746
 
<li><strong>all</strong> &#8211; <p>if <tt class="xref docutils literal"><span class="pre">False</span></tt> (DEFAULT) only the effective properties are returned. 
1747
 
If name is given a list with only one property is returned.</p>
1748
 
<p>if <tt class="xref docutils literal"><span class="pre">True</span></tt> all properties including properties set multiple times
1749
 
with different values or priorities for different UAs are returned.
1750
 
The order of the properties is fully kept as in the original 
1751
 
stylesheet.</p>
1752
 
</li>
1753
 
</ul>
1754
 
</td>
1755
 
</tr>
1756
 
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">a list of <a class="reference internal" href="#cssutils.css.Property" title="cssutils.css.Property"><tt class="xref py py-class docutils literal"><span class="pre">Property</span></tt></a> objects set in 
1757
 
this declaration.</p>
1758
 
</td>
1759
 
</tr>
1760
 
</tbody>
1761
 
</table>
1762
 
</dd></dl>
1763
 
 
1764
 
<dl class="method">
1765
 
<dt id="cssutils.css.CSSStyleDeclaration.getProperty">
1766
 
<tt class="descname">getProperty</tt><big>(</big><em>name</em>, <em>normalize=True</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleDeclaration.getProperty" title="Permalink to this definition">¶</a></dt>
1767
 
<dd><table class="docutils field-list" frame="void" rules="none">
1768
 
<col class="field-name" />
1769
 
<col class="field-body" />
1770
 
<tbody valign="top">
1771
 
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1772
 
<li><strong>name</strong> &#8211; of the CSS property, always lowercase (even if not normalized)</li>
1773
 
<li><strong>normalize</strong> &#8211; <p>if <tt class="xref docutils literal"><span class="pre">True</span></tt> (DEFAULT) name will be normalized (lowercase, no simple
1774
 
escapes) so &#8220;color&#8221;, &#8220;COLOR&#8221; or &#8220;Color&#8221; will all be equivalent</p>
1775
 
<p>If <tt class="xref docutils literal"><span class="pre">False</span></tt> may return <strong>NOT</strong> the effective value but the 
1776
 
effective for the unnormalized name.</p>
1777
 
</li>
1778
 
</ul>
1779
 
</td>
1780
 
</tr>
1781
 
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">the effective <a class="reference internal" href="#cssutils.css.Property" title="cssutils.css.Property"><tt class="xref py py-class docutils literal"><span class="pre">Property</span></tt></a> object.</p>
1782
 
</td>
1783
 
</tr>
1784
 
</tbody>
1785
 
</table>
1786
 
</dd></dl>
1787
 
 
1788
 
<dl class="method">
1789
 
<dt id="cssutils.css.CSSStyleDeclaration.getPropertyCSSValue">
1790
 
<tt class="descname">getPropertyCSSValue</tt><big>(</big><em>name</em>, <em>normalize=True</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleDeclaration.getPropertyCSSValue" title="Permalink to this definition">¶</a></dt>
1791
 
<dd><table class="docutils field-list" frame="void" rules="none">
1792
 
<col class="field-name" />
1793
 
<col class="field-body" />
1794
 
<tbody valign="top">
1795
 
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1796
 
<li><strong>name</strong> &#8211; of the CSS property, always lowercase (even if not normalized)</li>
1797
 
<li><strong>normalize</strong> &#8211; <p>if <tt class="xref docutils literal"><span class="pre">True</span></tt> (DEFAULT) name will be normalized (lowercase, no simple
1798
 
escapes) so &#8220;color&#8221;, &#8220;COLOR&#8221; or &#8220;Color&#8221; will all be equivalent</p>
1799
 
<p>If <tt class="xref docutils literal"><span class="pre">False</span></tt> may return <strong>NOT</strong> the effective value but the 
1800
 
effective for the unnormalized name.</p>
1801
 
</li>
1802
 
</ul>
1803
 
</td>
1804
 
</tr>
1805
 
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#cssutils.css.CSSValue" title="cssutils.css.CSSValue"><tt class="xref py py-class docutils literal"><span class="pre">CSSValue</span></tt></a>, the value of the effective
1806
 
property if it has been explicitly set for this declaration block.</p>
1807
 
</td>
1808
 
</tr>
1809
 
</tbody>
1810
 
</table>
1811
 
<p>(DOM)
1812
 
Used to retrieve the object representation of the value of a CSS
1813
 
property if it has been explicitly set within this declaration
1814
 
block. Returns None if the property has not been set.</p>
1815
 
<p>(This method returns None if the property is a shorthand
1816
 
property. Shorthand property values can only be accessed and
1817
 
modified as strings, using the getPropertyValue and setProperty
1818
 
methods.)</p>
1819
 
<p><strong>cssutils currently always returns a CSSValue if the property is 
1820
 
set.</strong></p>
1821
 
<dl class="docutils">
1822
 
<dt>for more on shorthand properties see</dt>
1823
 
<dd><a class="reference external" href="http://www.dustindiaz.com/css-shorthand/">http://www.dustindiaz.com/css-shorthand/</a></dd>
1824
 
</dl>
1825
 
</dd></dl>
1826
 
 
1827
 
<dl class="method">
1828
 
<dt id="cssutils.css.CSSStyleDeclaration.getPropertyPriority">
1829
 
<tt class="descname">getPropertyPriority</tt><big>(</big><em>name</em>, <em>normalize=True</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleDeclaration.getPropertyPriority" title="Permalink to this definition">¶</a></dt>
1830
 
<dd><table class="docutils field-list" frame="void" rules="none">
1831
 
<col class="field-name" />
1832
 
<col class="field-body" />
1833
 
<tbody valign="top">
1834
 
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1835
 
<li><strong>name</strong> &#8211; of the CSS property, always lowercase (even if not normalized)</li>
1836
 
<li><strong>normalize</strong> &#8211; <p>if <tt class="xref docutils literal"><span class="pre">True</span></tt> (DEFAULT) name will be normalized (lowercase, no simple
1837
 
escapes) so &#8220;color&#8221;, &#8220;COLOR&#8221; or &#8220;Color&#8221; will all be equivalent</p>
1838
 
<p>If <tt class="xref docutils literal"><span class="pre">False</span></tt> may return <strong>NOT</strong> the effective value but the
1839
 
effective for the unnormalized name.</p>
1840
 
</li>
1841
 
</ul>
1842
 
</td>
1843
 
</tr>
1844
 
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">the priority of the effective CSS property (e.g. the
1845
 
&#8220;important&#8221; qualifier) if the property has been explicitly set in
1846
 
this declaration block. The empty string if none exists.</p>
1847
 
</td>
1848
 
</tr>
1849
 
</tbody>
1850
 
</table>
1851
 
</dd></dl>
1852
 
 
1853
 
<dl class="method">
1854
 
<dt id="cssutils.css.CSSStyleDeclaration.getPropertyValue">
1855
 
<tt class="descname">getPropertyValue</tt><big>(</big><em>name</em>, <em>normalize=True</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleDeclaration.getPropertyValue" title="Permalink to this definition">¶</a></dt>
1856
 
<dd><table class="docutils field-list" frame="void" rules="none">
1857
 
<col class="field-name" />
1858
 
<col class="field-body" />
1859
 
<tbody valign="top">
1860
 
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1861
 
<li><strong>name</strong> &#8211; of the CSS property, always lowercase (even if not normalized)</li>
1862
 
<li><strong>normalize</strong> &#8211; <p>if <tt class="xref docutils literal"><span class="pre">True</span></tt> (DEFAULT) name will be normalized (lowercase, no simple
1863
 
escapes) so &#8220;color&#8221;, &#8220;COLOR&#8221; or &#8220;Color&#8221; will all be equivalent</p>
1864
 
<p>If <tt class="xref docutils literal"><span class="pre">False</span></tt> may return <strong>NOT</strong> the effective value but the
1865
 
effective for the unnormalized name.</p>
1866
 
</li>
1867
 
</ul>
1868
 
</td>
1869
 
</tr>
1870
 
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">the value of the effective property if it has been explicitly set
1871
 
for this declaration block. Returns the empty string if the
1872
 
property has not been set.</p>
1873
 
</td>
1874
 
</tr>
1875
 
</tbody>
1876
 
</table>
1877
 
</dd></dl>
1878
 
 
1879
 
<dl class="method">
1880
 
<dt id="cssutils.css.CSSStyleDeclaration.item">
1881
 
<tt class="descname">item</tt><big>(</big><em>index</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleDeclaration.item" title="Permalink to this definition">¶</a></dt>
1882
 
<dd><p>(DOM) Retrieve the properties that have been explicitly set in
1883
 
this declaration block. The order of the properties retrieved using
1884
 
this method does not have to be the order in which they were set.
1885
 
This method can be used to iterate over all properties in this
1886
 
declaration block.</p>
1887
 
<table class="docutils field-list" frame="void" rules="none">
1888
 
<col class="field-name" />
1889
 
<col class="field-body" />
1890
 
<tbody valign="top">
1891
 
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1892
 
<li><strong>index</strong> &#8211; of the property to retrieve, negative values behave like
1893
 
negative indexes on Python lists, so -1 is the last element</li>
1894
 
</ul>
1895
 
</td>
1896
 
</tr>
1897
 
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">the name of the property at this ordinal position. The
1898
 
empty string if no property exists at this position.</p>
1899
 
</td>
1900
 
</tr>
1901
 
</tbody>
1902
 
</table>
1903
 
<p><strong>ATTENTION:</strong>
1904
 
Only properties with different names are counted. If two
1905
 
properties with the same name are present in this declaration
1906
 
only the effective one is included.</p>
1907
 
<p><a class="reference internal" href="#cssutils.css.CSSStyleDeclaration.item" title="cssutils.css.CSSStyleDeclaration.item"><tt class="xref py py-meth docutils literal"><span class="pre">item()</span></tt></a> and <a class="reference internal" href="#cssutils.css.CSSStyleDeclaration.length" title="cssutils.css.CSSStyleDeclaration.length"><tt class="xref py py-attr docutils literal"><span class="pre">length</span></tt></a> work on the same set here.</p>
1908
 
</dd></dl>
1909
 
 
1910
 
<dl class="method">
1911
 
<dt id="cssutils.css.CSSStyleDeclaration.keys">
1912
 
<tt class="descname">keys</tt><big>(</big><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleDeclaration.keys" title="Permalink to this definition">¶</a></dt>
1913
 
<dd><p>Analoguous to standard dict returns property names which are set in
1914
 
this declaration.</p>
1915
 
</dd></dl>
1916
 
 
1917
 
<dl class="attribute">
1918
 
<dt id="cssutils.css.CSSStyleDeclaration.length">
1919
 
<tt class="descname">length</tt><a class="headerlink" href="#cssutils.css.CSSStyleDeclaration.length" title="Permalink to this definition">¶</a></dt>
1920
 
<dd><p>(DOM) The number of distinct properties that have been explicitly in this declaration block. The range of valid indices is 0 to length-1 inclusive. These are properties with a different <tt class="docutils literal"><span class="pre">name</span></tt> only. <a class="reference internal" href="#cssutils.css.CSSStyleDeclaration.item" title="cssutils.css.CSSStyleDeclaration.item"><tt class="xref py py-meth docutils literal"><span class="pre">item()</span></tt></a> and <a class="reference internal" href="#cssutils.css.CSSStyleDeclaration.length" title="cssutils.css.CSSStyleDeclaration.length"><tt class="xref py py-attr docutils literal"><span class="pre">length</span></tt></a> work on the same set here.</p>
1921
 
</dd></dl>
1922
 
 
1923
 
<dl class="attribute">
1924
 
<dt id="cssutils.css.CSSStyleDeclaration.parentRule">
1925
 
<tt class="descname">parentRule</tt><a class="headerlink" href="#cssutils.css.CSSStyleDeclaration.parentRule" title="Permalink to this definition">¶</a></dt>
1926
 
<dd><p>(DOM) The CSS rule that contains this declaration block or None if this CSSStyleDeclaration is not attached to a CSSRule.</p>
1927
 
</dd></dl>
1928
 
 
1929
 
<dl class="method">
1930
 
<dt id="cssutils.css.CSSStyleDeclaration.removeProperty">
1931
 
<tt class="descname">removeProperty</tt><big>(</big><em>name</em>, <em>normalize=True</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleDeclaration.removeProperty" title="Permalink to this definition">¶</a></dt>
1932
 
<dd><p>(DOM)
1933
 
Used to remove a CSS property if it has been explicitly set within
1934
 
this declaration block.</p>
1935
 
<table class="docutils field-list" frame="void" rules="none">
1936
 
<col class="field-name" />
1937
 
<col class="field-body" />
1938
 
<tbody valign="top">
1939
 
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1940
 
<li><strong>name</strong> &#8211; of the CSS property</li>
1941
 
<li><strong>normalize</strong> &#8211; <p>if <tt class="xref docutils literal"><span class="pre">True</span></tt> (DEFAULT) name will be normalized (lowercase, no simple
1942
 
escapes) so &#8220;color&#8221;, &#8220;COLOR&#8221; or &#8220;Color&#8221; will all be equivalent.
1943
 
The effective Property value is returned and <em>all</em> Properties
1944
 
with <tt class="docutils literal"><span class="pre">Property.name</span> <span class="pre">==</span> <span class="pre">name</span></tt> are removed.</p>
1945
 
<p>If <tt class="xref docutils literal"><span class="pre">False</span></tt> may return <strong>NOT</strong> the effective value but the 
1946
 
effective for the unnormalized <cite>name</cite> only. Also only the 
1947
 
Properties with the literal name <cite>name</cite> are removed.</p>
1948
 
</li>
1949
 
</ul>
1950
 
</td>
1951
 
</tr>
1952
 
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">the value of the property if it has been explicitly set for
1953
 
this declaration block. Returns the empty string if the property
1954
 
has not been set or the property name does not correspond to a
1955
 
known CSS property</p>
1956
 
</td>
1957
 
</tr>
1958
 
<tr class="field"><th class="field-name">Exceptions :</th><td class="field-body"><ul class="first last simple">
1959
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.NoModificationAllowedErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">NoModificationAllowedErr</span></tt></a>:
1960
 
Raised if this declaration is readonly or the property is
1961
 
readonly.</li>
1962
 
</ul>
1963
 
</td>
1964
 
</tr>
1965
 
</tbody>
1966
 
</table>
1967
 
</dd></dl>
1968
 
 
1969
 
<dl class="attribute">
1970
 
<dt id="cssutils.css.CSSStyleDeclaration.seq">
1971
 
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.CSSStyleDeclaration.seq" title="Permalink to this definition">¶</a></dt>
1972
 
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
1973
 
</dd></dl>
1974
 
 
1975
 
<dl class="method">
1976
 
<dt id="cssutils.css.CSSStyleDeclaration.setProperty">
1977
 
<tt class="descname">setProperty</tt><big>(</big><em>name</em>, <em>value=None</em>, <em>priority=u''</em>, <em>normalize=True</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleDeclaration.setProperty" title="Permalink to this definition">¶</a></dt>
1978
 
<dd><p>(DOM) Set a property value and priority within this declaration
1979
 
block.</p>
1980
 
<table class="docutils field-list" frame="void" rules="none">
1981
 
<col class="field-name" />
1982
 
<col class="field-body" />
1983
 
<tbody valign="top">
1984
 
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1985
 
<li><strong>name</strong> &#8211; <p>of the CSS property to set (in W3C DOM the parameter is called
1986
 
&#8220;propertyName&#8221;), always lowercase (even if not normalized)</p>
1987
 
<p>If a property with this <cite>name</cite> is present it will be reset.</p>
1988
 
<p>cssutils also allowed <cite>name</cite> to be a 
1989
 
<a class="reference internal" href="#cssutils.css.Property" title="cssutils.css.Property"><tt class="xref py py-class docutils literal"><span class="pre">Property</span></tt></a> object, all other
1990
 
parameter are ignored in this case</p>
1991
 
</li>
1992
 
<li><strong>value</strong> &#8211; the new value of the property, ignored if <cite>name</cite> is a Property.</li>
1993
 
<li><strong>priority</strong> &#8211; the optional priority of the property (e.g. &#8220;important&#8221;),
1994
 
ignored if <cite>name</cite> is a Property.</li>
1995
 
<li><strong>normalize</strong> &#8211; if True (DEFAULT) <cite>name</cite> will be normalized (lowercase, no simple
1996
 
escapes) so &#8220;color&#8221;, &#8220;COLOR&#8221; or &#8220;Color&#8221; will all be equivalent</li>
1997
 
</ul>
1998
 
</td>
1999
 
</tr>
2000
 
<tr class="field"><th class="field-name">Exceptions :</th><td class="field-body"><ul class="first last simple">
2001
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.SyntaxErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">SyntaxErr</span></tt></a>:
2002
 
Raised if the specified value has a syntax error and is
2003
 
unparsable.</li>
2004
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.NoModificationAllowedErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">NoModificationAllowedErr</span></tt></a>:
2005
 
Raised if this declaration is readonly or the property is
2006
 
readonly.</li>
2007
 
</ul>
2008
 
</td>
2009
 
</tr>
2010
 
</tbody>
2011
 
</table>
2012
 
</dd></dl>
2013
 
 
2014
 
</dd></dl>
2015
 
 
2016
 
<p>The official DOM provides no method to obtain all values set for a property. Cssutils from 0.9.4 implements the additional method <a class="reference internal" href="#cssutils.css.CSSStyleDeclaration.getProperties" title="cssutils.css.CSSStyleDeclaration.getProperties"><tt class="xref py py-meth docutils literal"><span class="pre">getProperties()</span></tt></a>, example:</p>
2017
 
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">cssText</span> <span class="o">=</span> <span class="s">&#39;&#39;&#39;background: white url(paper.png) scroll; /* for all UAs */</span>
2018
 
<span class="gp">... </span><span class="s">background: white url(ledger.png) fixed; /* for UAs that do fixed backgrounds */</span>
2019
 
<span class="gp">... </span><span class="s">&#39;&#39;&#39;</span>
2020
 
<span class="gp">&gt;&gt;&gt; </span><span class="c"># omit comments for this example</span>
2021
 
<span class="gp">&gt;&gt;&gt; </span><span class="n">cssutils</span><span class="o">.</span><span class="n">ser</span><span class="o">.</span><span class="n">prefs</span><span class="o">.</span><span class="n">keepComments</span> <span class="o">=</span> <span class="bp">False</span>
2022
 
<span class="gp">&gt;&gt;&gt; </span><span class="n">style</span> <span class="o">=</span> <span class="n">cssutils</span><span class="o">.</span><span class="n">css</span><span class="o">.</span><span class="n">CSSStyleDeclaration</span><span class="p">(</span><span class="n">cssText</span><span class="o">=</span><span class="n">cssText</span><span class="p">)</span>
2023
 
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">style</span><span class="o">.</span><span class="n">cssText</span>
2024
 
<span class="go">background: white url(paper.png) scroll;</span>
2025
 
<span class="go">background: white url(ledger.png) fixed;</span>
2026
 
<span class="gp">&gt;&gt;&gt; </span><span class="c"># work with properties:</span>
2027
 
<span class="gp">&gt;&gt;&gt; </span><span class="n">proplist</span> <span class="o">=</span> <span class="n">style</span><span class="o">.</span><span class="n">getProperties</span><span class="p">(</span><span class="s">&#39;background&#39;</span><span class="p">,</span> <span class="nb">all</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
2028
 
<span class="gp">&gt;&gt;&gt; </span><span class="n">proplist</span>
2029
 
<span class="go">[cssutils.css.Property(name=&#39;background&#39;, value=u&#39;white url(paper.png) scroll&#39;, priority=u&#39;&#39;), cssutils.css.Property(name=&#39;background&#39;, value=u&#39;white url(ledger.png) fixed&#39;, priority=u&#39;&#39;)]</span>
2030
 
<span class="gp">&gt;&gt;&gt; </span><span class="k">for</span> <span class="n">prop</span> <span class="ow">in</span> <span class="n">proplist</span><span class="p">:</span> <span class="k">print</span> <span class="n">prop</span><span class="o">.</span><span class="n">value</span>
2031
 
<span class="go">white url(paper.png) scroll</span>
2032
 
<span class="go">white url(ledger.png) fixed</span>
2033
 
<span class="gp">&gt;&gt;&gt; </span><span class="c"># overwrite the current property, to overwrite all iterate over proplist</span>
2034
 
<span class="gp">&gt;&gt;&gt; </span><span class="n">style</span><span class="p">[</span><span class="s">&#39;background&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="s">&#39;red&#39;</span><span class="p">,</span> <span class="s">&#39;!important&#39;</span><span class="p">)</span>
2035
 
<span class="gp">&gt;&gt;&gt; </span><span class="c"># importance in DOM ist &#39;important&#39; but &#39;!important&#39; works too</span>
2036
 
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">style</span><span class="p">[</span><span class="s">&#39;background&#39;</span><span class="p">],</span> <span class="n">style</span><span class="o">.</span><span class="n">getPropertyPriority</span><span class="p">(</span><span class="s">&#39;background&#39;</span><span class="p">)</span>
2037
 
<span class="go">red important</span>
2038
 
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">style</span><span class="o">.</span><span class="n">cssText</span>
2039
 
<span class="go">background: white url(paper.png) scroll;</span>
2040
 
<span class="go">background: red !important;</span>
2041
 
<span class="gp">&gt;&gt;&gt; </span><span class="c"># output only &quot;effective&quot; properties</span>
2042
 
<span class="gp">&gt;&gt;&gt; </span><span class="n">cssutils</span><span class="o">.</span><span class="n">ser</span><span class="o">.</span><span class="n">prefs</span><span class="o">.</span><span class="n">keepAllProperties</span> <span class="o">=</span> <span class="bp">False</span>
2043
 
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">style</span><span class="o">.</span><span class="n">cssText</span>
2044
 
<span class="go">background: red !important;</span>
2045
 
</pre></div>
2046
 
</div>
2047
 
</div>
2048
 
<div class="section" id="property">
2049
 
<h3><tt class="docutils literal"><span class="pre">Property</span></tt><a class="headerlink" href="#property" title="Permalink to this headline">¶</a></h3>
2050
 
<dl class="class">
2051
 
<dt id="cssutils.css.Property">
2052
 
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">Property</tt><big>(</big><em>name=None</em>, <em>value=None</em>, <em>priority=u''</em>, <em>_mediaQuery=False</em>, <em>parent=None</em><big>)</big><a class="headerlink" href="#cssutils.css.Property" title="Permalink to this definition">¶</a></dt>
2053
 
<dd><p>A CSS property in a StyleDeclaration of a CSSStyleRule (cssutils).</p>
2054
 
<p>Format:</p>
2055
 
<div class="highlight-python"><pre>property = name
2056
 
  : IDENT S*
2057
 
  ;
2058
 
 
2059
 
expr = value
2060
 
  : term [ operator term ]*
2061
 
  ;
2062
 
term
2063
 
  : unary_operator?
2064
 
    [ NUMBER S* | PERCENTAGE S* | LENGTH S* | EMS S* | EXS S* | 
2065
 
      ANGLE S* | TIME S* | FREQ S* | function ]
2066
 
  | STRING S* | IDENT S* | URI S* | hexcolor
2067
 
  ;
2068
 
function
2069
 
  : FUNCTION S* expr ')' S*
2070
 
  ;
2071
 
/*
2072
 
 * There is a constraint on the color that it must
2073
 
 * have either 3 or 6 hex-digits (i.e., [0-9a-fA-F])
2074
 
 * after the "#"; e.g., "#000" is OK, but "#abcd" is not.
2075
 
 */
2076
 
hexcolor
2077
 
  : HASH S*
2078
 
  ;
2079
 
 
2080
 
prio
2081
 
  : IMPORTANT_SYM S*
2082
 
  ;</pre>
2083
 
</div>
2084
 
<dl class="attribute">
2085
 
<dt id="cssutils.css.Property.cssText">
2086
 
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.Property.cssText" title="Permalink to this definition">¶</a></dt>
2087
 
<dd><p>A parsable textual representation.</p>
2088
 
</dd></dl>
2089
 
 
2090
 
<dl class="attribute">
2091
 
<dt id="cssutils.css.Property.cssValue">
2092
 
<tt class="descname">cssValue</tt><a class="headerlink" href="#cssutils.css.Property.cssValue" title="Permalink to this definition">¶</a></dt>
2093
 
<dd><p>(cssutils) CSSValue object of this property</p>
2094
 
</dd></dl>
2095
 
 
2096
 
<dl class="attribute">
2097
 
<dt id="cssutils.css.Property.literalname">
2098
 
<tt class="descname">literalname</tt><a class="headerlink" href="#cssutils.css.Property.literalname" title="Permalink to this definition">¶</a></dt>
2099
 
<dd><p>Readonly literal (not normalized) name of this property</p>
2100
 
</dd></dl>
2101
 
 
2102
 
<dl class="attribute">
2103
 
<dt id="cssutils.css.Property.literalpriority">
2104
 
<tt class="descname">literalpriority</tt><a class="headerlink" href="#cssutils.css.Property.literalpriority" title="Permalink to this definition">¶</a></dt>
2105
 
<dd><p>Readonly literal (not normalized) priority of this property</p>
2106
 
</dd></dl>
2107
 
 
2108
 
<dl class="attribute">
2109
 
<dt id="cssutils.css.Property.name">
2110
 
<tt class="descname">name</tt><a class="headerlink" href="#cssutils.css.Property.name" title="Permalink to this definition">¶</a></dt>
2111
 
<dd><p>Name of this property.</p>
2112
 
</dd></dl>
2113
 
 
2114
 
<dl class="attribute">
2115
 
<dt id="cssutils.css.Property.parent">
2116
 
<tt class="descname">parent</tt><a class="headerlink" href="#cssutils.css.Property.parent" title="Permalink to this definition">¶</a></dt>
2117
 
<dd><p>The Parent Node (normally a CSSStyledeclaration) of this Property</p>
2118
 
</dd></dl>
2119
 
 
2120
 
<dl class="attribute">
2121
 
<dt id="cssutils.css.Property.priority">
2122
 
<tt class="descname">priority</tt><a class="headerlink" href="#cssutils.css.Property.priority" title="Permalink to this definition">¶</a></dt>
2123
 
<dd><p>Priority of this property.</p>
2124
 
</dd></dl>
2125
 
 
2126
 
<dl class="attribute">
2127
 
<dt id="cssutils.css.Property.valid">
2128
 
<tt class="descname">valid</tt><a class="headerlink" href="#cssutils.css.Property.valid" title="Permalink to this definition">¶</a></dt>
2129
 
<dd><p>Check if value of this property is valid in the properties context.</p>
2130
 
</dd></dl>
2131
 
 
2132
 
<dl class="method">
2133
 
<dt id="cssutils.css.Property.validate">
2134
 
<tt class="descname">validate</tt><big>(</big><big>)</big><a class="headerlink" href="#cssutils.css.Property.validate" title="Permalink to this definition">¶</a></dt>
2135
 
<dd><p>Validate value against <cite>profiles</cite> which are checked dynamically.
2136
 
properties in e.g. &#64;font-face rules are checked against
2137
 
<tt class="docutils literal"><span class="pre">cssutils.profile.CSS3_FONT_FACE</span></tt> only.</p>
2138
 
<p>For each of the following cases a message is reported:</p>
2139
 
<ul>
2140
 
<li><dl class="first docutils">
2141
 
<dt>INVALID (so the property is known but not valid)</dt>
2142
 
<dd><p class="first last"><tt class="docutils literal"><span class="pre">ERROR</span>&nbsp;&nbsp;&nbsp; <span class="pre">Property:</span> <span class="pre">Invalid</span> <span class="pre">value</span> <span class="pre">for</span> <span class="pre">&quot;{PROFILE-1[/PROFILE-2...]&quot;</span>
2143
 
<span class="pre">property:</span> <span class="pre">...</span></tt></p>
2144
 
</dd>
2145
 
</dl>
2146
 
</li>
2147
 
<li><dl class="first docutils">
2148
 
<dt>VALID but not in given profiles or defaultProfiles</dt>
2149
 
<dd><p class="first last"><tt class="docutils literal"><span class="pre">WARNING</span>&nbsp;&nbsp;&nbsp; <span class="pre">Property:</span> <span class="pre">Not</span> <span class="pre">valid</span> <span class="pre">for</span> <span class="pre">profile</span> <span class="pre">&quot;{PROFILE-X}&quot;</span> <span class="pre">but</span> <span class="pre">valid</span>
2150
 
<span class="pre">&quot;{PROFILE-Y}&quot;</span> <span class="pre">property:</span> <span class="pre">...</span></tt></p>
2151
 
</dd>
2152
 
</dl>
2153
 
</li>
2154
 
<li><dl class="first docutils">
2155
 
<dt>VALID in current profile</dt>
2156
 
<dd><p class="first last"><tt class="docutils literal"><span class="pre">DEBUG</span>&nbsp;&nbsp;&nbsp; <span class="pre">Found</span> <span class="pre">valid</span> <span class="pre">&quot;{PROFILE-1[/PROFILE-2...]&quot;</span> <span class="pre">property...</span></tt></p>
2157
 
</dd>
2158
 
</dl>
2159
 
</li>
2160
 
<li><dl class="first docutils">
2161
 
<dt>UNKNOWN property</dt>
2162
 
<dd><p class="first last"><tt class="docutils literal"><span class="pre">WARNING</span>&nbsp;&nbsp;&nbsp; <span class="pre">Unknown</span> <span class="pre">Property</span> <span class="pre">name...</span></tt> is issued</p>
2163
 
</dd>
2164
 
</dl>
2165
 
</li>
2166
 
</ul>
2167
 
<p>so for example:</p>
2168
 
<div class="highlight-python"><pre>cssutils.log.setLevel(logging.DEBUG)
2169
 
parser = cssutils.CSSParser()
2170
 
s = parser.parseString('''body {
2171
 
    unknown-property: x;
2172
 
    color: 4;
2173
 
    color: rgba(1,2,3,4);
2174
 
    color: red
2175
 
}''')
2176
 
 
2177
 
# Log output:
2178
 
 
2179
 
WARNING Property: Unknown Property name. [2:9: unknown-property]
2180
 
ERROR   Property: Invalid value for "CSS Color Module Level 3/CSS Level 2.1" property: 4 [3:9: color]
2181
 
DEBUG   Property: Found valid "CSS Color Module Level 3" value: rgba(1, 2, 3, 4) [4:9: color]
2182
 
DEBUG   Property: Found valid "CSS Level 2.1" value: red [5:9: color]</pre>
2183
 
</div>
2184
 
<p>and when setting an explicit default profile:</p>
2185
 
<div class="highlight-python"><pre>cssutils.profile.defaultProfiles = cssutils.profile.CSS_LEVEL_2
2186
 
s = parser.parseString('''body {
2187
 
    unknown-property: x;
2188
 
    color: 4;
2189
 
    color: rgba(1,2,3,4);
2190
 
    color: red
2191
 
}''')
2192
 
 
2193
 
# Log output:
2194
 
 
2195
 
WARNING Property: Unknown Property name. [2:9: unknown-property]
2196
 
ERROR   Property: Invalid value for "CSS Color Module Level 3/CSS Level 2.1" property: 4 [3:9: color]
2197
 
WARNING Property: Not valid for profile "CSS Level 2.1" but valid "CSS Color Module Level 3" value: rgba(1, 2, 3, 4)  [4:9: color]
2198
 
DEBUG   Property: Found valid "CSS Level 2.1" value: red [5:9: color]</pre>
2199
 
</div>
2200
 
</dd></dl>
2201
 
 
2202
 
<dl class="attribute">
2203
 
<dt id="cssutils.css.Property.value">
2204
 
<tt class="descname">value</tt><a class="headerlink" href="#cssutils.css.Property.value" title="Permalink to this definition">¶</a></dt>
2205
 
<dd><p>The textual value of this Properties cssValue.</p>
2206
 
</dd></dl>
2207
 
 
2208
 
</dd></dl>
2209
 
 
2210
 
</div>
2211
 
<div class="section" id="values">
2212
 
<h3>Values<a class="headerlink" href="#values" title="Permalink to this headline">¶</a></h3>
2213
 
<div class="section" id="cssvalue">
2214
 
<h4><tt class="docutils literal"><span class="pre">CSSValue</span></tt><a class="headerlink" href="#cssvalue" title="Permalink to this headline">¶</a></h4>
2215
 
<dl class="class">
2216
 
<dt id="cssutils.css.CSSValue">
2217
 
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSValue</tt><big>(</big><em>cssText=None</em>, <em>parent=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSValue" title="Permalink to this definition">¶</a></dt>
2218
 
<dd><p>The CSSValue interface represents a simple or a complex value.
2219
 
A CSSValue object only occurs in a context of a CSS property.</p>
2220
 
<dl class="attribute">
2221
 
<dt id="cssutils.css.CSSValue.cssText">
2222
 
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.CSSValue.cssText" title="Permalink to this definition">¶</a></dt>
2223
 
<dd><p>A string representation of the current value.</p>
2224
 
</dd></dl>
2225
 
 
2226
 
<dl class="attribute">
2227
 
<dt id="cssutils.css.CSSValue.cssValueType">
2228
 
<tt class="descname">cssValueType</tt><a class="headerlink" href="#cssutils.css.CSSValue.cssValueType" title="Permalink to this definition">¶</a></dt>
2229
 
<dd><p>A (readonly) code defining the type of the value.</p>
2230
 
</dd></dl>
2231
 
 
2232
 
<dl class="attribute">
2233
 
<dt id="cssutils.css.CSSValue.cssValueTypeString">
2234
 
<tt class="descname">cssValueTypeString</tt><a class="headerlink" href="#cssutils.css.CSSValue.cssValueTypeString" title="Permalink to this definition">¶</a></dt>
2235
 
<dd><p>(readonly) Name of cssValueType.</p>
2236
 
</dd></dl>
2237
 
 
2238
 
<dl class="attribute">
2239
 
<dt id="cssutils.css.CSSValue.seq">
2240
 
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.CSSValue.seq" title="Permalink to this definition">¶</a></dt>
2241
 
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
2242
 
</dd></dl>
2243
 
 
2244
 
</dd></dl>
2245
 
 
2246
 
</div>
2247
 
<div class="section" id="cssprimitivevalue">
2248
 
<h4><tt class="docutils literal"><span class="pre">CSSPrimitiveValue</span></tt><a class="headerlink" href="#cssprimitivevalue" title="Permalink to this headline">¶</a></h4>
2249
 
<dl class="class">
2250
 
<dt id="cssutils.css.CSSPrimitiveValue">
2251
 
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSPrimitiveValue</tt><big>(</big><em>cssText=None</em>, <em>parent=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSPrimitiveValue" title="Permalink to this definition">¶</a></dt>
2252
 
<dd><p>Represents a single CSS Value.  May be used to determine the value of a
2253
 
specific style property currently set in a block or to set a specific
2254
 
style property explicitly within the block. Might be obtained from the
2255
 
getPropertyCSSValue method of CSSStyleDeclaration.</p>
2256
 
<p>Conversions are allowed between absolute values (from millimeters to
2257
 
centimeters, from degrees to radians, and so on) but not between
2258
 
relative values. (For example, a pixel value cannot be converted to a
2259
 
centimeter value.) Percentage values can&#8217;t be converted since they are
2260
 
relative to the parent value (or another property value). There is one
2261
 
exception for color percentage values: since a color percentage value
2262
 
is relative to the range 0-255, a color percentage value can be
2263
 
converted to a number; (see also the RGBColor interface).</p>
2264
 
<dl class="attribute">
2265
 
<dt id="cssutils.css.CSSPrimitiveValue.cssText">
2266
 
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.CSSPrimitiveValue.cssText" title="Permalink to this definition">¶</a></dt>
2267
 
<dd><p>A string representation of the current value.</p>
2268
 
</dd></dl>
2269
 
 
2270
 
<dl class="attribute">
2271
 
<dt id="cssutils.css.CSSPrimitiveValue.cssValueTypeString">
2272
 
<tt class="descname">cssValueTypeString</tt><a class="headerlink" href="#cssutils.css.CSSPrimitiveValue.cssValueTypeString" title="Permalink to this definition">¶</a></dt>
2273
 
<dd><p>(readonly) Name of cssValueType.</p>
2274
 
</dd></dl>
2275
 
 
2276
 
<dl class="method">
2277
 
<dt id="cssutils.css.CSSPrimitiveValue.getCounterValue">
2278
 
<tt class="descname">getCounterValue</tt><big>(</big><big>)</big><a class="headerlink" href="#cssutils.css.CSSPrimitiveValue.getCounterValue" title="Permalink to this definition">¶</a></dt>
2279
 
<dd><p>(DOM) This method is used to get the Counter value. If
2280
 
this CSS value doesn&#8217;t contain a counter value, a DOMException
2281
 
is raised. Modification to the corresponding style property
2282
 
can be achieved using the Counter interface.</p>
2283
 
<p><strong>Not implemented.</strong></p>
2284
 
</dd></dl>
2285
 
 
2286
 
<dl class="method">
2287
 
<dt id="cssutils.css.CSSPrimitiveValue.getFloatValue">
2288
 
<tt class="descname">getFloatValue</tt><big>(</big><em>unitType=None</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSPrimitiveValue.getFloatValue" title="Permalink to this definition">¶</a></dt>
2289
 
<dd><p>(DOM) This method is used to get a float value in a
2290
 
specified unit. If this CSS value doesn&#8217;t contain a float value
2291
 
or can&#8217;t be converted into the specified unit, a DOMException
2292
 
is raised.</p>
2293
 
<table class="docutils field-list" frame="void" rules="none">
2294
 
<col class="field-name" />
2295
 
<col class="field-body" />
2296
 
<tbody valign="top">
2297
 
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
2298
 
<li><strong>unitType</strong> &#8211; to get the float value. The unit code can only be a float unit type
2299
 
(i.e. CSS_NUMBER, CSS_PERCENTAGE, CSS_EMS, CSS_EXS, CSS_PX, CSS_CM,
2300
 
CSS_MM, CSS_IN, CSS_PT, CSS_PC, CSS_DEG, CSS_RAD, CSS_GRAD, CSS_MS,
2301
 
CSS_S, CSS_HZ, CSS_KHZ, CSS_DIMENSION) or None in which case
2302
 
the current dimension is used.</li>
2303
 
</ul>
2304
 
</td>
2305
 
</tr>
2306
 
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><p>not necessarily a float but some cases just an integer
2307
 
e.g. if the value is <tt class="docutils literal"><span class="pre">1px</span></tt> it return <tt class="docutils literal"><span class="pre">1</span></tt> and <strong>not</strong> <tt class="docutils literal"><span class="pre">1.0</span></tt></p>
2308
 
<p>Conversions might return strange values like 1.000000000001</p>
2309
 
</p>
2310
 
</td>
2311
 
</tr>
2312
 
</tbody>
2313
 
</table>
2314
 
</dd></dl>
2315
 
 
2316
 
<dl class="method">
2317
 
<dt id="cssutils.css.CSSPrimitiveValue.getRGBColorValue">
2318
 
<tt class="descname">getRGBColorValue</tt><big>(</big><big>)</big><a class="headerlink" href="#cssutils.css.CSSPrimitiveValue.getRGBColorValue" title="Permalink to this definition">¶</a></dt>
2319
 
<dd><p>(DOM) This method is used to get the RGB color. If this
2320
 
CSS value doesn&#8217;t contain a RGB color value, a DOMException
2321
 
is raised. Modification to the corresponding style property
2322
 
can be achieved using the RGBColor interface.</p>
2323
 
</dd></dl>
2324
 
 
2325
 
<dl class="method">
2326
 
<dt id="cssutils.css.CSSPrimitiveValue.getRectValue">
2327
 
<tt class="descname">getRectValue</tt><big>(</big><big>)</big><a class="headerlink" href="#cssutils.css.CSSPrimitiveValue.getRectValue" title="Permalink to this definition">¶</a></dt>
2328
 
<dd><p>(DOM) This method is used to get the Rect value. If this CSS
2329
 
value doesn&#8217;t contain a rect value, a DOMException is raised.
2330
 
Modification to the corresponding style property can be achieved
2331
 
using the Rect interface.</p>
2332
 
<p><strong>Not implemented.</strong></p>
2333
 
</dd></dl>
2334
 
 
2335
 
<dl class="method">
2336
 
<dt id="cssutils.css.CSSPrimitiveValue.getStringValue">
2337
 
<tt class="descname">getStringValue</tt><big>(</big><big>)</big><a class="headerlink" href="#cssutils.css.CSSPrimitiveValue.getStringValue" title="Permalink to this definition">¶</a></dt>
2338
 
<dd><p>(DOM) This method is used to get the string value. If the
2339
 
CSS value doesn&#8217;t contain a string value, a DOMException is raised.</p>
2340
 
<p>Some properties (like &#8216;font-family&#8217; or &#8216;voice-family&#8217;)
2341
 
convert a whitespace separated list of idents to a string.</p>
2342
 
<p>Only the actual value is returned so e.g. all the following return the
2343
 
actual value <tt class="docutils literal"><span class="pre">a</span></tt>: url(a), attr(a), &#8220;a&#8221;, &#8216;a&#8217;</p>
2344
 
</dd></dl>
2345
 
 
2346
 
<dl class="attribute">
2347
 
<dt id="cssutils.css.CSSPrimitiveValue.primitiveType">
2348
 
<tt class="descname">primitiveType</tt><a class="headerlink" href="#cssutils.css.CSSPrimitiveValue.primitiveType" title="Permalink to this definition">¶</a></dt>
2349
 
<dd><p>(readonly) The type of the value as defined by the constants in this class.</p>
2350
 
</dd></dl>
2351
 
 
2352
 
<dl class="attribute">
2353
 
<dt id="cssutils.css.CSSPrimitiveValue.primitiveTypeString">
2354
 
<tt class="descname">primitiveTypeString</tt><a class="headerlink" href="#cssutils.css.CSSPrimitiveValue.primitiveTypeString" title="Permalink to this definition">¶</a></dt>
2355
 
<dd><p>Name of primitive type of this value.</p>
2356
 
</dd></dl>
2357
 
 
2358
 
<dl class="attribute">
2359
 
<dt id="cssutils.css.CSSPrimitiveValue.seq">
2360
 
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.CSSPrimitiveValue.seq" title="Permalink to this definition">¶</a></dt>
2361
 
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
2362
 
</dd></dl>
2363
 
 
2364
 
<dl class="method">
2365
 
<dt id="cssutils.css.CSSPrimitiveValue.setFloatValue">
2366
 
<tt class="descname">setFloatValue</tt><big>(</big><em>unitType</em>, <em>floatValue</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSPrimitiveValue.setFloatValue" title="Permalink to this definition">¶</a></dt>
2367
 
<dd><p>(DOM) A method to set the float value with a specified unit.
2368
 
If the property attached with this value can not accept the
2369
 
specified unit or the float value, the value will be unchanged and
2370
 
a DOMException will be raised.</p>
2371
 
<table class="docutils field-list" frame="void" rules="none">
2372
 
<col class="field-name" />
2373
 
<col class="field-body" />
2374
 
<tbody valign="top">
2375
 
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
2376
 
<li><strong>unitType</strong> &#8211; a unit code as defined above. The unit code can only be a float
2377
 
unit type</li>
2378
 
<li><strong>floatValue</strong> &#8211; <p>the new float value which does not have to be a float value but
2379
 
may simple be an int e.g. if setting:</p>
2380
 
<div class="highlight-python"><div class="highlight"><pre><span class="n">setFloatValue</span><span class="p">(</span><span class="n">CSS_PX</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
2381
 
</pre></div>
2382
 
</div>
2383
 
</li>
2384
 
</ul>
2385
 
</td>
2386
 
</tr>
2387
 
<tr class="field"><th class="field-name">Exceptions :</th><td class="field-body"><ul class="first last simple">
2388
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.InvalidAccessErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">InvalidAccessErr</span></tt></a>:
2389
 
Raised if the attached property doesn&#8217;t
2390
 
support the float value or the unit type.</li>
2391
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.NoModificationAllowedErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">NoModificationAllowedErr</span></tt></a>:
2392
 
Raised if this property is readonly.</li>
2393
 
</ul>
2394
 
</td>
2395
 
</tr>
2396
 
</tbody>
2397
 
</table>
2398
 
</dd></dl>
2399
 
 
2400
 
<dl class="method">
2401
 
<dt id="cssutils.css.CSSPrimitiveValue.setStringValue">
2402
 
<tt class="descname">setStringValue</tt><big>(</big><em>stringType</em>, <em>stringValue</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSPrimitiveValue.setStringValue" title="Permalink to this definition">¶</a></dt>
2403
 
<dd><p>(DOM) A method to set the string value with the specified
2404
 
unit. If the property attached to this value can&#8217;t accept the
2405
 
specified unit or the string value, the value will be unchanged and
2406
 
a DOMException will be raised.</p>
2407
 
<table class="docutils field-list" frame="void" rules="none">
2408
 
<col class="field-name" />
2409
 
<col class="field-body" />
2410
 
<tbody valign="top">
2411
 
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
2412
 
<li><strong>stringType</strong> &#8211; a string code as defined above. The string code can only be a
2413
 
string unit type (i.e. CSS_STRING, CSS_URI, CSS_IDENT, and
2414
 
CSS_ATTR).</li>
2415
 
<li><strong>stringValue</strong> &#8211; the new string value
2416
 
Only the actual value is expected so for (CSS_URI, &#8220;a&#8221;) the
2417
 
new value will be <tt class="docutils literal"><span class="pre">url(a)</span></tt>. For (CSS_STRING, &#8220;&#8216;a&#8217;&#8221;)
2418
 
the new value will be <tt class="docutils literal"><span class="pre">&quot;\'a\'&quot;</span></tt> as the surrounding <tt class="docutils literal"><span class="pre">'</span></tt> are
2419
 
not part of the string value</li>
2420
 
</ul>
2421
 
</td>
2422
 
</tr>
2423
 
<tr class="field"><th class="field-name">Exceptions :</th><td class="field-body"><ul class="first last simple">
2424
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.InvalidAccessErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">InvalidAccessErr</span></tt></a>: 
2425
 
Raised if the CSS value doesn&#8217;t contain a
2426
 
string value or if the string value can&#8217;t be converted into
2427
 
the specified unit.</li>
2428
 
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.NoModificationAllowedErr" title="(in Python v3.2)"><tt class="xref py py-exc docutils literal"><span class="pre">NoModificationAllowedErr</span></tt></a>:
2429
 
Raised if this property is readonly.</li>
2430
 
</ul>
2431
 
</td>
2432
 
</tr>
2433
 
</tbody>
2434
 
</table>
2435
 
</dd></dl>
2436
 
 
2437
 
</dd></dl>
2438
 
 
2439
 
</div>
2440
 
<div class="section" id="cssvaluelist">
2441
 
<h4><tt class="docutils literal"><span class="pre">CSSValueList</span></tt><a class="headerlink" href="#cssvaluelist" title="Permalink to this headline">¶</a></h4>
2442
 
<dl class="class">
2443
 
<dt id="cssutils.css.CSSValueList">
2444
 
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSValueList</tt><big>(</big><em>cssText=None</em>, <em>parent=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSValueList" title="Permalink to this definition">¶</a></dt>
2445
 
<dd><p>The CSSValueList interface provides the abstraction of an ordered
2446
 
collection of CSS values.</p>
2447
 
<p>Some properties allow an empty list into their syntax. In that case,
2448
 
these properties take the none identifier. So, an empty list means
2449
 
that the property has the value none.</p>
2450
 
<p>The items in the CSSValueList are accessible via an integral index,
2451
 
starting from 0.</p>
2452
 
<dl class="attribute">
2453
 
<dt id="cssutils.css.CSSValueList.cssText">
2454
 
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.CSSValueList.cssText" title="Permalink to this definition">¶</a></dt>
2455
 
<dd><p>A string representation of the current value.</p>
2456
 
</dd></dl>
2457
 
 
2458
 
<dl class="attribute">
2459
 
<dt id="cssutils.css.CSSValueList.cssValueTypeString">
2460
 
<tt class="descname">cssValueTypeString</tt><a class="headerlink" href="#cssutils.css.CSSValueList.cssValueTypeString" title="Permalink to this definition">¶</a></dt>
2461
 
<dd><p>(readonly) Name of cssValueType.</p>
2462
 
</dd></dl>
2463
 
 
2464
 
<dl class="method">
2465
 
<dt id="cssutils.css.CSSValueList.item">
2466
 
<tt class="descname">item</tt><big>(</big><em>index</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSValueList.item" title="Permalink to this definition">¶</a></dt>
2467
 
<dd><p>(DOM) Retrieve a CSSValue by ordinal <cite>index</cite>. The
2468
 
order in this collection represents the order of the values in the
2469
 
CSS style property. If <cite>index</cite> is greater than or equal to the number
2470
 
of values in the list, this returns <tt class="xref docutils literal"><span class="pre">None</span></tt>.</p>
2471
 
</dd></dl>
2472
 
 
2473
 
<dl class="attribute">
2474
 
<dt id="cssutils.css.CSSValueList.length">
2475
 
<tt class="descname">length</tt><a class="headerlink" href="#cssutils.css.CSSValueList.length" title="Permalink to this definition">¶</a></dt>
2476
 
<dd><p>(DOM attribute) The number of CSSValues in the list.</p>
2477
 
</dd></dl>
2478
 
 
2479
 
<dl class="attribute">
2480
 
<dt id="cssutils.css.CSSValueList.seq">
2481
 
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.CSSValueList.seq" title="Permalink to this definition">¶</a></dt>
2482
 
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
2483
 
</dd></dl>
2484
 
 
2485
 
</dd></dl>
2486
 
 
2487
 
</div>
2488
 
<div class="section" id="cssfunction">
2489
 
<h4><tt class="docutils literal"><span class="pre">CSSFunction</span></tt><a class="headerlink" href="#cssfunction" title="Permalink to this headline">¶</a></h4>
2490
 
<dl class="class">
2491
 
<dt id="cssutils.css.cssvalue.CSSFunction">
2492
 
<em class="property">class </em><tt class="descclassname">cssutils.css.cssvalue.</tt><tt class="descname">CSSFunction</tt><big>(</big><em>cssText=None</em>, <em>parent=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.cssvalue.CSSFunction" title="Permalink to this definition">¶</a></dt>
2493
 
<dd><p>A CSS function value like rect() etc.</p>
2494
 
</dd></dl>
2495
 
 
2496
 
</div>
2497
 
<div class="section" id="cssvariable">
2498
 
<h4><tt class="docutils literal"><span class="pre">CSSVariable</span></tt><a class="headerlink" href="#cssvariable" title="Permalink to this headline">¶</a></h4>
2499
 
<dl class="class">
2500
 
<dt id="cssutils.css.CSSVariable">
2501
 
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSVariable</tt><big>(</big><em>cssText=None</em>, <em>parent=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSVariable" title="Permalink to this definition">¶</a></dt>
2502
 
<dd><p>The CSSVariable represents a call to CSS Variable.</p>
2503
 
<dl class="attribute">
2504
 
<dt id="cssutils.css.CSSVariable.cssText">
2505
 
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.CSSVariable.cssText" title="Permalink to this definition">¶</a></dt>
2506
 
<dd><p>A string representation of the current variable.</p>
2507
 
</dd></dl>
2508
 
 
2509
 
<dl class="attribute">
2510
 
<dt id="cssutils.css.CSSVariable.cssValueTypeString">
2511
 
<tt class="descname">cssValueTypeString</tt><a class="headerlink" href="#cssutils.css.CSSVariable.cssValueTypeString" title="Permalink to this definition">¶</a></dt>
2512
 
<dd><p>(readonly) Name of cssValueType.</p>
2513
 
</dd></dl>
2514
 
 
2515
 
<dl class="attribute">
2516
 
<dt id="cssutils.css.CSSVariable.seq">
2517
 
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.CSSVariable.seq" title="Permalink to this definition">¶</a></dt>
2518
 
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
2519
 
</dd></dl>
2520
 
 
2521
 
<dl class="attribute">
2522
 
<dt id="cssutils.css.CSSVariable.value">
2523
 
<tt class="descname">value</tt><a class="headerlink" href="#cssutils.css.CSSVariable.value" title="Permalink to this definition">¶</a></dt>
2524
 
<dd><p>Find contained sheet and &#64;variables there</p>
2525
 
</dd></dl>
2526
 
 
2527
 
</dd></dl>
2528
 
 
2529
 
</div>
2530
 
<div class="section" id="expressionvalue">
2531
 
<h4><tt class="docutils literal"><span class="pre">ExpressionValue</span></tt><a class="headerlink" href="#expressionvalue" title="Permalink to this headline">¶</a></h4>
2532
 
<dl class="class">
2533
 
<dt id="cssutils.css.cssvalue.ExpressionValue">
2534
 
<em class="property">class </em><tt class="descclassname">cssutils.css.cssvalue.</tt><tt class="descname">ExpressionValue</tt><big>(</big><em>cssText=None</em>, <em>parent=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.cssvalue.ExpressionValue" title="Permalink to this definition">¶</a></dt>
2535
 
<dd><p>Special IE only CSSFunction which may contain <em>anything</em>.
2536
 
Used for expressions and <tt class="docutils literal"><span class="pre">alpha(opacity=100)</span></tt> currently.</p>
2537
 
<dl class="attribute">
2538
 
<dt id="cssutils.css.cssvalue.ExpressionValue.cssText">
2539
 
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.cssvalue.ExpressionValue.cssText" title="Permalink to this definition">¶</a></dt>
2540
 
<dd><p>A string representation of the current value.</p>
2541
 
</dd></dl>
2542
 
 
2543
 
</dd></dl>
2544
 
 
2545
 
</div>
2546
 
</div>
2547
 
</div>
2548
 
<div class="section" id="additional-info">
2549
 
<h2>Additional Info<a class="headerlink" href="#additional-info" title="Permalink to this headline">¶</a></h2>
2550
 
<p>Some classes in this package support standard Python idioms like iteration on certain attributes:</p>
2551
 
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">cssutils</span>
2552
 
<span class="gp">&gt;&gt;&gt; </span><span class="n">sheet</span> <span class="o">=</span> <span class="n">cssutils</span><span class="o">.</span><span class="n">css</span><span class="o">.</span><span class="n">CSSStyleSheet</span><span class="p">()</span>
2553
 
<span class="gp">&gt;&gt;&gt; </span><span class="n">sheet</span><span class="o">.</span><span class="n">cssText</span> <span class="o">=</span> <span class="s">&#39;@charset &quot;ascii&quot;;a { color: green }&#39;</span>
2554
 
<span class="gp">&gt;&gt;&gt; </span><span class="k">for</span> <span class="n">rule</span> <span class="ow">in</span> <span class="n">sheet</span><span class="p">:</span>
2555
 
<span class="gp">... </span>    <span class="k">print</span> <span class="n">rule</span>
2556
 
<span class="gp">...</span>
2557
 
<span class="go">&lt;cssutils.css.CSSCharsetRule object encoding=&#39;ascii&#39; at 0x2ce7</span>
2558
 
<span class="go">&lt;cssutils.css.CSSStyleRule object selector=u&#39;a&#39; style=u&#39;color:</span>
2559
 
<span class="go">s=&lt;cssutils.util._Namespaces object at 0x02CE7B30&gt; at 0x2ce7d3</span>
2560
 
</pre></div>
2561
 
</div>
2562
 
<p><tt class="docutils literal"><span class="pre">for</span> <span class="pre">in</span></tt> is supported by <a class="reference internal" href="#cssutils.css.CSSStyleSheet" title="cssutils.css.CSSStyleSheet"><tt class="xref py py-class docutils literal"><span class="pre">CSSStyleSheet</span></tt></a> and  <a class="reference internal" href="#cssutils.css.CSSMediaRule" title="cssutils.css.CSSMediaRule"><tt class="xref py py-class docutils literal"><span class="pre">CSSMediaRule</span></tt></a> (iterating over the contained <a class="reference internal" href="#cssutils.css.CSSRule" title="cssutils.css.CSSRule"><tt class="xref py py-class docutils literal"><span class="pre">CSSRule</span></tt></a> objects, <a class="reference internal" href="#cssutils.css.CSSStyleDeclaration" title="cssutils.css.CSSStyleDeclaration"><tt class="xref py py-class docutils literal"><span class="pre">CSSStyleDeclaration</span></tt></a> (over the names of the contained <a class="reference internal" href="#cssutils.css.Property" title="cssutils.css.Property"><tt class="xref py py-class docutils literal"><span class="pre">Property</span></tt></a> objects), <a class="reference internal" href="#cssutils.css.CSSValueList" title="cssutils.css.CSSValueList"><tt class="xref py py-class docutils literal"><span class="pre">CSSValueList</span></tt></a> (over the <a class="reference internal" href="#cssutils.css.CSSValue" title="cssutils.css.CSSValue"><tt class="xref py py-class docutils literal"><span class="pre">CSSValue</span></tt></a> objects in the list).</p>
2563
 
</div>
2564
 
</div>
2565
 
 
2566
 
 
2567
 
          </div>
2568
 
        </div>
2569
 
      </div>
2570
 
      <div class="sphinxsidebar">
2571
 
        <div class="sphinxsidebarwrapper">
2572
 
  <h3><a href="../index.html">Table Of Contents</a></h3>
2573
 
  <ul>
2574
 
<li><a class="reference internal" href="#">Package <tt class="docutils literal"><span class="pre">cssutils.css</span></tt></a><ul>
2575
 
<li><a class="reference internal" href="#cssstylesheet"><tt class="docutils literal"><span class="pre">CSSStyleSheet</span></tt></a></li>
2576
 
<li><a class="reference internal" href="#css-rules">CSS rules</a><ul>
2577
 
<li><a class="reference internal" href="#cssrule"><tt class="docutils literal"><span class="pre">CSSRule</span></tt></a></li>
2578
 
<li><a class="reference internal" href="#cssrulelist"><tt class="docutils literal"><span class="pre">CSSRuleList</span></tt></a></li>
2579
 
<li><a class="reference internal" href="#csscharsetrule"><tt class="docutils literal"><span class="pre">CSSCharsetRule</span></tt></a></li>
2580
 
<li><a class="reference internal" href="#cssfontfacerule"><tt class="docutils literal"><span class="pre">CSSFontFaceRule</span></tt></a></li>
2581
 
<li><a class="reference internal" href="#cssimportrule"><tt class="docutils literal"><span class="pre">CSSImportRule</span></tt></a></li>
2582
 
<li><a class="reference internal" href="#cssmediarule"><tt class="docutils literal"><span class="pre">CSSMediaRule</span></tt></a></li>
2583
 
<li><a class="reference internal" href="#cssnamespacerule"><tt class="docutils literal"><span class="pre">CSSNamespaceRule</span></tt></a></li>
2584
 
<li><a class="reference internal" href="#csspagerule"><tt class="docutils literal"><span class="pre">CSSPageRule</span></tt></a></li>
2585
 
<li><a class="reference internal" href="#cssstylerule"><tt class="docutils literal"><span class="pre">CSSStyleRule</span></tt></a></li>
2586
 
<li><a class="reference internal" href="#cssvariablesrule"><tt class="docutils literal"><span class="pre">CSSVariablesRule</span></tt></a></li>
2587
 
<li><a class="reference internal" href="#csscomment"><tt class="docutils literal"><span class="pre">CSSComment</span></tt></a></li>
2588
 
</ul>
2589
 
</li>
2590
 
<li><a class="reference internal" href="#selector-related-classes-selectorlist-and-selector">Selector related classes: <tt class="docutils literal"><span class="pre">SelectorList</span></tt> and <tt class="docutils literal"><span class="pre">Selector</span></tt></a><ul>
2591
 
<li><a class="reference internal" href="#selectorlist"><tt class="docutils literal"><span class="pre">SelectorList</span></tt></a></li>
2592
 
<li><a class="reference internal" href="#selector"><tt class="docutils literal"><span class="pre">Selector</span></tt></a></li>
2593
 
</ul>
2594
 
</li>
2595
 
<li><a class="reference internal" href="#style-related-classes-cssstyledeclaration-property-cssvalue-etc">Style related classes: <tt class="docutils literal"><span class="pre">CSSStyleDeclaration</span></tt>, <tt class="docutils literal"><span class="pre">Property</span></tt>, <tt class="docutils literal"><span class="pre">CSSValue</span></tt> etc</a><ul>
2596
 
<li><a class="reference internal" href="#cssvariablesdeclaration"><tt class="docutils literal"><span class="pre">CSSVariablesDeclaration</span></tt></a></li>
2597
 
<li><a class="reference internal" href="#cssstyledeclaration"><tt class="docutils literal"><span class="pre">CSSStyleDeclaration</span></tt></a></li>
2598
 
<li><a class="reference internal" href="#property"><tt class="docutils literal"><span class="pre">Property</span></tt></a></li>
2599
 
<li><a class="reference internal" href="#values">Values</a><ul>
2600
 
<li><a class="reference internal" href="#cssvalue"><tt class="docutils literal"><span class="pre">CSSValue</span></tt></a></li>
2601
 
<li><a class="reference internal" href="#cssprimitivevalue"><tt class="docutils literal"><span class="pre">CSSPrimitiveValue</span></tt></a></li>
2602
 
<li><a class="reference internal" href="#cssvaluelist"><tt class="docutils literal"><span class="pre">CSSValueList</span></tt></a></li>
2603
 
<li><a class="reference internal" href="#cssfunction"><tt class="docutils literal"><span class="pre">CSSFunction</span></tt></a></li>
2604
 
<li><a class="reference internal" href="#cssvariable"><tt class="docutils literal"><span class="pre">CSSVariable</span></tt></a></li>
2605
 
<li><a class="reference internal" href="#expressionvalue"><tt class="docutils literal"><span class="pre">ExpressionValue</span></tt></a></li>
2606
 
</ul>
2607
 
</li>
2608
 
</ul>
2609
 
</li>
2610
 
<li><a class="reference internal" href="#additional-info">Additional Info</a></li>
2611
 
</ul>
2612
 
</li>
2613
 
</ul>
2614
 
 
2615
 
  <h4>Previous topic</h4>
2616
 
  <p class="topless"><a href="serialize.html"
2617
 
                        title="previous chapter">serializing CSS</a></p>
2618
 
  <h4>Next topic</h4>
2619
 
  <p class="topless"><a href="stylesheets.html"
2620
 
                        title="next chapter">Package <tt class="docutils literal"><span class="pre">cssutils.stylesheets</span></tt></a></p>
2621
 
  <h3>This Page</h3>
2622
 
  <ul class="this-page-menu">
2623
 
    <li><a href="../_sources/docs/css.txt"
2624
 
           rel="nofollow">Show Source</a></li>
2625
 
  </ul>
2626
 
<div id="searchbox" style="display: none">
2627
 
  <h3>Quick search</h3>
2628
 
    <form class="search" action="../search.html" method="get">
2629
 
      <input type="text" name="q" size="18" />
2630
 
      <input type="submit" value="Go" />
2631
 
      <input type="hidden" name="check_keywords" value="yes" />
2632
 
      <input type="hidden" name="area" value="default" />
2633
 
    </form>
2634
 
    <p class="searchtip" style="font-size: 90%">
2635
 
    Enter search terms or a module, class or function name.
2636
 
    </p>
2637
 
</div>
2638
 
<script type="text/javascript">$('#searchbox').show(0);</script>
2639
 
        </div>
2640
 
      </div>
2641
 
      <div class="clearer"></div>
2642
 
    </div>
2643
 
    <div class="related">
2644
 
      <h3>Navigation</h3>
2645
 
      <ul>
2646
 
        <li class="right" style="margin-right: 10px">
2647
 
          <a href="../genindex.html" title="General Index"
2648
 
             >index</a></li>
2649
 
        <li class="right" >
2650
 
          <a href="../py-modindex.html" title="Python Module Index"
2651
 
             >modules</a> |</li>
2652
 
        <li class="right" >
2653
 
          <a href="stylesheets.html" title="Package cssutils.stylesheets"
2654
 
             >next</a> |</li>
2655
 
        <li class="right" >
2656
 
          <a href="serialize.html" title="serializing CSS"
2657
 
             >previous</a> |</li>
2658
 
        <li><a href="../index.html">cssutils v0.9.7b4 documentation</a> &raquo;</li> 
2659
 
      </ul>
2660
 
    </div>
2661
 
    <div class="footer">
2662
 
        &copy; Copyright 2004-2010, Christof Höke.
2663
 
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.4.
2664
 
    </div>
2665
 
  </body>
2666
 
</html>
 
 
b'\\ No newline at end of file'