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 +2 -1
- weasyprint/css/computed_values.py +1 -1
- weasyprint/css/html5_ph.css +65 -178
- weasyprint/css/html5_ua.css +249 -749
- weasyprint/css/html5_ua_form.css +3 -13
- weasyprint/css/validation/descriptors.py +9 -0
- weasyprint/draw/border.py +4 -4
- weasyprint/draw/text.py +12 -8
- weasyprint/formatting_structure/build.py +17 -17
- weasyprint/images.py +2 -2
- weasyprint/layout/__init__.py +17 -0
- weasyprint/layout/absolute.py +1 -1
- weasyprint/layout/block.py +23 -20
- weasyprint/layout/column.py +2 -3
- weasyprint/layout/flex.py +396 -571
- weasyprint/layout/float.py +6 -4
- weasyprint/layout/inline.py +23 -27
- weasyprint/layout/page.py +22 -18
- weasyprint/layout/percent.py +41 -46
- weasyprint/layout/preferred.py +13 -16
- weasyprint/pdf/fonts.py +22 -23
- weasyprint/stacking.py +2 -2
- weasyprint/svg/__init__.py +6 -3
- weasyprint/text/constants.py +5 -0
- weasyprint/text/ffi.py +12 -0
- weasyprint/text/fonts.py +12 -3
- weasyprint/text/line_break.py +8 -7
- {weasyprint-64.1.dist-info → weasyprint-65.1.dist-info}/METADATA +2 -2
- {weasyprint-64.1.dist-info → weasyprint-65.1.dist-info}/RECORD +32 -32
- {weasyprint-64.1.dist-info → weasyprint-65.1.dist-info}/WHEEL +1 -1
- {weasyprint-64.1.dist-info → weasyprint-65.1.dist-info}/entry_points.txt +0 -0
- {weasyprint-64.1.dist-info → weasyprint-65.1.dist-info}/licenses/LICENSE +0 -0
weasyprint/__init__.py
CHANGED
|
@@ -15,7 +15,7 @@ import cssselect2
|
|
|
15
15
|
import tinycss2
|
|
16
16
|
import tinyhtml5
|
|
17
17
|
|
|
18
|
-
VERSION = __version__ = '
|
|
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 (
|
|
340
|
+
return (round(angle / pi * 2) % 4 * 90, flip)
|
|
341
341
|
|
|
342
342
|
|
|
343
343
|
@register_computer('border-top-width')
|
weasyprint/css/html5_ph.css
CHANGED
|
@@ -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
|
|
22
|
-
ol
|
|
23
|
-
ol
|
|
24
|
-
ol
|
|
25
|
-
ol
|
|
26
|
-
ul
|
|
27
|
-
ul
|
|
28
|
-
ul
|
|
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
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
p
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
|
|
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 }
|