@@ -29,48 +29,14 @@ def test_css_parse_normalisation(name, norm, abnorm):
29
29
assert_same_resolution (norm , abnorm )
30
30
31
31
32
- @pytest .mark .xfail (reason = 'CSS comments not yet stripped' )
33
- def test_css_parse_comments ():
34
- assert_same_resolution ('hello: world' ,
35
- 'hello/* foo */:/* bar \n */ world /*;not:here*/' )
36
-
37
-
38
- @pytest .mark .xfail (reason = '''we don't need to handle specificity
39
- markers like !important, but we should
40
- ignore them in the future''' )
41
- def test_css_parse_specificity ():
42
- assert_same_resolution ('font-weight: bold' , 'font-weight: bold !important' )
43
-
44
-
45
- @pytest .mark .xfail (reason = 'Splitting CSS declarations not yet sensitive to '
46
- '; in CSS strings' )
47
- def test_css_parse_strings ():
48
- # semicolons in strings
49
- with tm .assert_produces_warning (CSSWarning ):
50
- assert_resolves (
51
- 'background-image: url(\' http://blah.com/foo?a;b=c\' )' ,
52
- {'background-image' : 'url(\' http://blah.com/foo?a;b=c\' )' })
53
- assert_resolves (
54
- 'background-image: url("http://blah.com/foo?a;b=c")' ,
55
- {'background-image' : 'url("http://blah.com/foo?a;b=c")' })
56
-
57
-
58
32
@pytest .mark .parametrize (
59
33
'invalid_css,remainder' , [
60
34
# No colon
61
35
('hello-world' , '' ),
62
36
('border-style: solid; hello-world' , 'border-style: solid' ),
63
37
('border-style: solid; hello-world; font-weight: bold' ,
64
38
'border-style: solid; font-weight: bold' ),
65
- # Unclosed string
66
- pytest .mark .xfail (('background-image: "abc' , '' ),
67
- reason = 'Unclosed CSS strings not detected' ),
68
- pytest .mark .xfail (('font-family: "abc' , '' ),
69
- reason = 'Unclosed CSS strings not detected' ),
70
- pytest .mark .xfail (('background-image: \' abc' , '' ),
71
- reason = 'Unclosed CSS strings not detected' ),
72
- pytest .mark .xfail (('font-family: \' abc' , '' ),
73
- reason = 'Unclosed CSS strings not detected' ),
39
+ # Unclosed string fail
74
40
# Invalid size
75
41
('font-size: blah' , 'font-size: 1em' ),
76
42
('font-size: 1a2b' , 'font-size: 1em' ),
@@ -124,46 +90,6 @@ def test_css_side_shorthands(shorthand, expansions):
124
90
{})
125
91
126
92
127
- @pytest .mark .xfail (reason = 'CSS font shorthand not yet handled' )
128
- @pytest .mark .parametrize ('css,props' , [
129
- ('font: italic bold 12pt helvetica,sans-serif' ,
130
- {'font-family' : 'helvetica,sans-serif' ,
131
- 'font-style' : 'italic' ,
132
- 'font-weight' : 'bold' ,
133
- 'font-size' : '12pt' }),
134
- ('font: bold italic 12pt helvetica,sans-serif' ,
135
- {'font-family' : 'helvetica,sans-serif' ,
136
- 'font-style' : 'italic' ,
137
- 'font-weight' : 'bold' ,
138
- 'font-size' : '12pt' }),
139
- ])
140
- def test_css_font_shorthand (css , props ):
141
- assert_resolves (css , props )
142
-
143
-
144
- @pytest .mark .xfail (reason = 'CSS background shorthand not yet handled' )
145
- @pytest .mark .parametrize ('css,props' , [
146
- ('background: blue' , {'background-color' : 'blue' }),
147
- ('background: fixed blue' ,
148
- {'background-color' : 'blue' , 'background-attachment' : 'fixed' }),
149
- ])
150
- def test_css_background_shorthand (css , props ):
151
- assert_resolves (css , props )
152
-
153
-
154
- @pytest .mark .xfail (reason = 'CSS border shorthand not yet handled' )
155
- @pytest .mark .parametrize ('style,equiv' , [
156
- ('border: 1px solid red' ,
157
- 'border-width: 1px; border-style: solid; border-color: red' ),
158
- ('border: solid red 1px' ,
159
- 'border-width: 1px; border-style: solid; border-color: red' ),
160
- ('border: red solid' ,
161
- 'border-style: solid; border-color: red' ),
162
- ])
163
- def test_css_border_shorthand (style , equiv ):
164
- assert_same_resolution (style , equiv )
165
-
166
-
167
93
@pytest .mark .parametrize ('style,inherited,equiv' , [
168
94
('margin: 1px; margin: 2px' , '' ,
169
95
'margin: 2px' ),
0 commit comments