weasyprint 64.1__py3-none-any.whl → 65.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
weasyprint/__init__.py CHANGED
@@ -15,7 +15,7 @@ import cssselect2
15
15
  import tinycss2
16
16
  import tinyhtml5
17
17
 
18
- VERSION = __version__ = '64.1'
18
+ VERSION = __version__ = '65.1'
19
19
 
20
20
  #: Default values for command-line and Python API options. See
21
21
  #: :func:`__main__.main` to learn more about specific options for
@@ -306,6 +306,7 @@ class CSS:
306
306
  self.base_url = base_url
307
307
  self.matcher = matcher or cssselect2.Matcher()
308
308
  self.page_rules = [] if page_rules is None else page_rules
309
+ counter_style = {} if counter_style is None else counter_style
309
310
  preprocess_stylesheet(
310
311
  media_type, base_url, stylesheet, url_fetcher, self.matcher,
311
312
  self.page_rules, font_config, counter_style)
@@ -337,7 +337,7 @@ def image_orientation(style, name, values):
337
337
  if values in ('none', 'from-image'):
338
338
  return values
339
339
  angle, flip = values
340
- return (int(round(angle / pi * 2)) % 4 * 90, flip)
340
+ return (round(angle / pi * 2) % 4 * 90, flip)
341
341
 
342
342
 
343
343
  @register_computer('border-top-width')
@@ -12,181 +12,68 @@ a "i" flag when CSS Selectors Level 4 is supported.
12
12
 
13
13
  */
14
14
 
15
- pre[wrap] { white-space: pre-wrap; }
16
-
17
- br[clear=left] { clear: left; }
18
- br[clear=right] { clear: right; }
19
- br[clear=all], br[clear=both] { clear: both; }
20
-
21
- ol[type="1"], li[type="1"] { list-style-type: decimal; }
22
- ol[type=a], li[type=a] { list-style-type: lower-alpha; }
23
- ol[type=A], li[type=A] { list-style-type: upper-alpha; }
24
- ol[type=i], li[type=i] { list-style-type: lower-roman; }
25
- ol[type=I], li[type=I] { list-style-type: upper-roman; }
26
- ul[type=disc], li[type=disc] { list-style-type: disc; }
27
- ul[type=circle], li[type=circle] { list-style-type: circle; }
28
- ul[type=square], li[type=square] { list-style-type: square; }
29
-
30
- table[align=left] { float: left; }
31
- table[align=right] { float: right; }
32
- table[align=center] { margin-left: auto; margin-right: auto; }
33
- thead[align=absmiddle], tbody[align=absmiddle], tfoot[align=absmiddle],
34
- tr[align=absmiddle], td[align=absmiddle], th[align=absmiddle] {
35
- text-align: center;
36
- }
37
-
38
- caption[align=bottom] { caption-side: bottom; }
39
- p[align=left], h1[align=left], h2[align=left], h3[align=left],
40
- h4[align=left], h5[align=left], h6[align=left] {
41
- text-align: left;
42
- }
43
- p[align=right], h1[align=right], h2[align=right], h3[align=right],
44
- h4[align=right], h5[align=right], h6[align=right] {
45
- text-align: right;
46
- }
47
- p[align=center], h1[align=center], h2[align=center], h3[align=center],
48
- h4[align=center], h5[align=center], h6[align=center] {
49
- text-align: center;
50
- }
51
- p[align=justify], h1[align=justify], h2[align=justify], h3[align=justify],
52
- h4[align=justify], h5[align=justify], h6[align=justify] {
53
- text-align: justify;
54
- }
55
- thead[valign=top], tbody[valign=top], tfoot[valign=top],
56
- tr[valign=top], td[valign=top], th[valign=top] {
57
- vertical-align: top;
58
- }
59
- thead[valign=middle], tbody[valign=middle], tfoot[valign=middle],
60
- tr[valign=middle], td[valign=middle], th[valign=middle] {
61
- vertical-align: middle;
62
- }
63
- thead[valign=bottom], tbody[valign=bottom], tfoot[valign=bottom],
64
- tr[valign=bottom], td[valign=bottom], th[valign=bottom] {
65
- vertical-align: bottom;
66
- }
67
- thead[valign=baseline], tbody[valign=baseline], tfoot[valign=baseline],
68
- tr[valign=baseline], td[valign=baseline], th[valign=baseline] {
69
- vertical-align: baseline;
70
- }
71
-
72
- td[nowrap], th[nowrap] { white-space: nowrap; }
73
-
74
- table[rules=none], table[rules=groups], table[rules=rows],
75
- table[rules=cols], table[rules=all] {
76
- border-style: hidden;
77
- border-collapse: collapse;
78
- }
79
- table[border]:not([border="0"]) { border-style: outset; }
80
- table[frame=void] { border-style: hidden; }
81
- table[frame=above] { border-style: outset hidden hidden hidden; }
82
- table[frame=below] { border-style: hidden hidden outset hidden; }
83
- table[frame=hsides] { border-style: outset hidden outset hidden; }
84
- table[frame=lhs] { border-style: hidden hidden hidden outset; }
85
- table[frame=rhs] { border-style: hidden outset hidden hidden; }
86
- table[frame=vsides] { border-style: hidden outset; }
87
- table[frame=box], table[frame=border] { border-style: outset; }
88
-
89
- table[border]:not([border="0"]) > tr > td, table[border]:not([border="0"]) > tr > th,
90
- table[border]:not([border="0"]) > thead > tr > td, table[border]:not([border="0"]) > thead > tr > th,
91
- table[border]:not([border="0"]) > tbody > tr > td, table[border]:not([border="0"]) > tbody > tr > th,
92
- table[border]:not([border="0"]) > tfoot > tr > td, table[border]:not([border="0"]) > tfoot > tr > th {
93
- border-width: 1px;
94
- border-style: inset;
95
- }
96
- table[rules=none] > tr > td, table[rules=none] > tr > th,
97
- table[rules=none] > thead > tr > td, table[rules=none] > thead > tr > th,
98
- table[rules=none] > tbody > tr > td, table[rules=none] > tbody > tr > th,
99
- table[rules=none] > tfoot > tr > td, table[rules=none] > tfoot > tr > th,
100
- table[rules=groups] > tr > td, table[rules=groups] > tr > th,
101
- table[rules=groups] > thead > tr > td, table[rules=groups] > thead > tr > th,
102
- table[rules=groups] > tbody > tr > td, table[rules=groups] > tbody > tr > th,
103
- table[rules=groups] > tfoot > tr > td, table[rules=groups] > tfoot > tr > th,
104
- table[rules=rows] > tr > td, table[rules=rows] > tr > th,
105
- table[rules=rows] > thead > tr > td, table[rules=rows] > thead > tr > th,
106
- table[rules=rows] > tbody > tr > td, table[rules=rows] > tbody > tr > th,
107
- table[rules=rows] > tfoot > tr > td, table[rules=rows] > tfoot > tr > th {
108
- border-width: 1px;
109
- border-style: none;
110
- }
111
- table[rules=cols] > tr > td, table[rules=cols] > tr > th,
112
- table[rules=cols] > thead > tr > td, table[rules=cols] > thead > tr > th,
113
- table[rules=cols] > tbody > tr > td, table[rules=cols] > tbody > tr > th,
114
- table[rules=cols] > tfoot > tr > td, table[rules=cols] > tfoot > tr > th {
115
- border-width: 1px;
116
- border-style: none solid;
117
- }
118
- table[rules=all] > tr > td, table[rules=all] > tr > th,
119
- table[rules=all] > thead > tr > td, table[rules=all] > thead > tr > th,
120
- table[rules=all] > tbody > tr > td, table[rules=all] > tbody > tr > th,
121
- table[rules=all] > tfoot > tr > td, table[rules=all] > tfoot > tr > th {
122
- border-width: 1px;
123
- border-style: solid;
124
- }
125
-
126
- table[rules=groups] > colgroup {
127
- border-left-width: 1px;
128
- border-left-style: solid;
129
- border-right-width: 1px;
130
- border-right-style: solid;
131
- }
132
- table[rules=groups] > thead,
133
- table[rules=groups] > tbody,
134
- table[rules=groups] > tfoot {
135
- border-top-width: 1px;
136
- border-top-style: solid;
137
- border-bottom-width: 1px;
138
- border-bottom-style: solid;
139
- }
140
-
141
- table[rules=rows] > tr, table[rules=rows] > thead > tr,
142
- table[rules=rows] > tbody > tr, table[rules=rows] > tfoot > tr {
143
- border-top-width: 1px;
144
- border-top-style: solid;
145
- border-bottom-width: 1px;
146
- border-bottom-style: solid;
147
- }
148
-
149
- hr[align=left] { margin-left: 0; margin-right: auto; }
150
- hr[align=right] { margin-left: auto; margin-right: 0; }
151
- hr[align=center] { margin-left: auto; margin-right: auto; }
152
- hr[color], hr[noshade] { border-style: solid; }
153
-
154
- iframe[frameborder="0"], iframe[frameborder=no] { border: none; }
155
-
156
- applet[align=left], embed[align=left], iframe[align=left],
157
- img[align=left], input[type=image][align=left], object[align=left] {
158
- float: left;
159
- }
160
-
161
- applet[align=right], embed[align=right], iframe[align=right],
162
- img[align=right], input[type=image][align=right], object[align=right] {
163
- float: right;
164
- }
165
-
166
- applet[align=top], embed[align=top], iframe[align=top],
167
- img[align=top], input[type=image][align=top], object[align=top] {
168
- vertical-align: top;
169
- }
170
-
171
- applet[align=baseline], embed[align=baseline], iframe[align=baseline],
172
- img[align=baseline], input[type=image][align=baseline], object[align=baseline] {
173
- vertical-align: baseline;
174
- }
175
-
176
- applet[align=texttop], embed[align=texttop], iframe[align=texttop],
177
- img[align=texttop], input[type=image][align=texttop], object[align=texttop] {
178
- vertical-align: text-top;
179
- }
180
-
181
- applet[align=absmiddle], embed[align=absmiddle], iframe[align=absmiddle],
182
- img[align=absmiddle], input[type=image][align=absmiddle], object[align=absmiddle],
183
- applet[align=abscenter], embed[align=abscenter], iframe[align=abscenter],
184
- img[align=abscenter], input[type=image][align=abscenter], object[align=abscenter] {
185
- vertical-align: middle;
186
- }
187
-
188
- applet[align=bottom], embed[align=bottom], iframe[align=bottom],
189
- img[align=bottom], input[type=image][align=bottom],
190
- object[align=bottom] {
191
- vertical-align: bottom;
192
- }
15
+ pre[wrap] { white-space: pre-wrap }
16
+
17
+ br[clear=left i] { clear: left }
18
+ br[clear=right i] { clear: right }
19
+ br[clear=all i], br[clear=both i] { clear: both }
20
+
21
+ :is(ol, li)[type="1"] { list-style-type: decimal }
22
+ :is(ol, li)[type=a] { list-style-type: lower-alpha }
23
+ :is(ol, li)[type=A] { list-style-type: upper-alpha }
24
+ :is(ol, li)[type=i] { list-style-type: lower-roman }
25
+ :is(ol, li)[type=I] { list-style-type: upper-roman }
26
+ :is(ul, li)[type=disc i] { list-style-type: disc }
27
+ :is(ul, li)[type=circle i] { list-style-type: circle }
28
+ :is(ul, li)[type=square i] { list-style-type: square }
29
+
30
+ table[align=left i] { float: left }
31
+ table[align=right i] { float: right }
32
+ table[align=center i] { margin-left: auto; margin-right: auto }
33
+ :is(thead, tbody, tfoot, tr, td, th)[align=absmiddle i] { text-align: center }
34
+
35
+ caption[align=bottom i] { caption-side: bottom }
36
+ :is(p, h1, h2, h3, h4, h5, h6)[align=left i] { text-align: left }
37
+ :is(p, h1, h2, h3, h4, h5, h6)[align=right i] { text-align: right }
38
+ :is(p, h1, h2, h3, h4, h5, h6)[align=center i] { text-align: center }
39
+ :is(p, h1, h2, h3, h4, h5, h6)[align=justify i] { text-align: justify }
40
+ :is(thead, tbody, tfoot, tr, td, th)[valign=top i] { vertical-align: top }
41
+ :is(thead, tbody, tfoot, tr, td, th)[valign=middle i] { vertical-align: middle }
42
+ :is(thead, tbody, tfoot, tr, td, th)[valign=bottom i] { vertical-align: bottom }
43
+ :is(thead, tbody, tfoot, tr, td, th)[valign=baseline i] { vertical-align: baseline }
44
+
45
+ :is(td, th)[nowrap] { white-space: nowrap }
46
+
47
+ table:is([rules=none i], [rules=groups i], [rules=rows i], [rules=cols i]) { border-style: hidden; border-collapse: collapse }
48
+ table[border]:not([border="0 i"]) { border-style: outset }
49
+ table[frame=void i] { border-style: hidden }
50
+ table[frame=above i] { border-style: outset hidden hidden hidden }
51
+ table[frame=below i] { border-style: hidden hidden outset hidden }
52
+ table[frame=hsides i] { border-style: outset hidden outset hidden }
53
+ table[frame=lhs i] { border-style: hidden hidden hidden outset }
54
+ table[frame=rhs i] { border-style: hidden outset hidden hidden }
55
+ table[frame=vsides i] { border-style: hidden outset }
56
+ table[frame=box i], table[frame=border i] { border-style: outset }
57
+
58
+ table[border]:not([border="0"]) > tr > :is(td, th), table[border]:not([border="0"]) > :is(thead, tbody, tfoot) > tr > :is(td, th) { border-width: 1px; border-style: inset }
59
+ table:is([rules=none i], [rules=groups i], [rules=rows i]) > tr > :is(td, th), table:is([rules=none i], [rules=groups i], [rules=rows i]) > :is(thead, tbody, tfoot) > tr > :is(td, th) { border-width: 1px; border-style: none }
60
+ table[rules=cols i] > tr > :is(td, th), table[rules=cols i] > :is(thead, tbody, tfoot) > tr > :is(td, th) { border-width: 1px; border-style: none solid }
61
+ table[rules=all i] > tr > :is(td, th), table[rules=all i] > :is(thead, tbody, tfoot) > tr > :is(td, th) { border-width: 1px; border-style: solid }
62
+ table[rules=groups i] > colgroup { border-left-width: 1px; border-left-style: solid; border-right-width: 1px; border-right-style: solid }
63
+ table[rules=groups i] > :is(thead, tbody, tfoot) { border-top-width: 1px; border-top-style: solid; border-bottom-width: 1px; border-bottom-style: solid }
64
+ table[rules=rows i] > tr, table[rules=rows i] > :is(thead, tbody, tfoot) > tr { border-top-width: 1px; border-top-style: solid; border-bottom-width: 1px; border-bottom-style: solid }
65
+
66
+ hr[align=left i] { margin-left: 0; margin-right: auto }
67
+ hr[align=right i] { margin-left: auto; margin-right: 0 }
68
+ hr[align=center i] { margin-left: auto; margin-right: auto }
69
+ hr[color], hr[noshade] { border-style: solid }
70
+
71
+ iframe[frameborder="0"], iframe[frameborder=no i] { border: none }
72
+
73
+ :is(applet, embed, iframe, img, input, object)[align=left i] { float: left }
74
+ :is(applet, embed, iframe, img, input, object)[align=right i] { float: right }
75
+ :is(applet, embed, iframe, img, input, object)[align=top i] { vertical-align: top }
76
+ :is(applet, embed, iframe, img, input, object)[align=baseline i] { vertical-align: baseline }
77
+ :is(applet, embed, iframe, img, input, object)[align=texttop i] { vertical-align: text-top }
78
+ :is(applet, embed, iframe, img, input, object):is([align=middle i], [align=absmiddle i], [align=absmiddle i]) { vertical-align: middle }
79
+ :is(applet, embed, iframe, img, input, object)[align=bottom i] { vertical-align: bottom }