Skip to content

Commit 29e1b5b

Browse files
committed
Clean up css-borders-4
1 parent 336719a commit 29e1b5b

File tree

1 file changed

+73
-169
lines changed

1 file changed

+73
-169
lines changed

tests/css-borders-4.js

Lines changed: 73 additions & 169 deletions
Original file line numberDiff line numberDiff line change
@@ -49,110 +49,43 @@ export default {
4949
},
5050
},
5151
properties: {
52-
'border-top-radius': {
52+
'border-<side>-radius': {
5353
link: '#corner-sizing-side-shorthands',
54-
tests: border_radius_tests,
55-
},
56-
'border-right-radius': {
57-
link: '#corner-sizing-side-shorthands',
58-
tests: border_radius_tests,
59-
},
60-
'border-bottom-radius': {
61-
link: '#corner-sizing-side-shorthands',
62-
tests: border_radius_tests,
63-
},
64-
'border-left-radius': {
65-
link: '#corner-sizing-side-shorthands',
66-
tests: border_radius_tests,
67-
},
68-
'border-block-start-radius': {
69-
link: '#corner-sizing-side-shorthands',
70-
tests: border_radius_tests,
71-
},
72-
'border-block-end-radius': {
73-
link: '#corner-sizing-side-shorthands',
74-
tests: border_radius_tests,
75-
},
76-
'border-inline-start-radius': {
77-
link: '#corner-sizing-side-shorthands',
78-
tests: border_radius_tests,
79-
},
80-
'border-inline-end-radius': {
81-
link: '#corner-sizing-side-shorthands',
82-
tests: border_radius_tests,
54+
values: border_radius_tests,
55+
children: [
56+
'border-top-radius', 'border-right-radius', 'border-bottom-radius', 'border-left-radius',
57+
'border-block-start-radius', 'border-block-end-radius', 'border-inline-start-radius', 'border-inline-end-radius',
58+
],
8359
},
8460
'corner-shape': {
61+
isGroup: true,
8562
link: '#corner-shaping',
86-
tests: [
87-
...corner_shape_tests,
88-
'round scoop',
89-
'round scoop bevel',
90-
'round scoop bevel notch',
91-
],
92-
},
93-
'corner-top-left-shape': {
94-
link: '#corner-shape-shorthands',
95-
tests: corner_shape_tests,
96-
},
97-
'corner-top-right-shape': {
98-
link: '#corner-shape-shorthands',
99-
tests: corner_shape_tests,
100-
},
101-
'corner-bottom-right-shape': {
102-
link: '#corner-shape-shorthands',
103-
tests: corner_shape_tests,
104-
},
105-
'corner-bottom-left-shape': {
106-
link: '#corner-shape-shorthands',
107-
tests: corner_shape_tests,
108-
},
109-
'corner-start-start-shape': {
110-
link: '#corner-shape-shorthands',
111-
tests: corner_shape_tests,
112-
},
113-
'corner-start-end-shape': {
114-
link: '#corner-shape-shorthands',
115-
tests: corner_shape_tests,
116-
},
117-
'corner-end-end-shape': {
118-
link: '#corner-shape-shorthands',
119-
tests: corner_shape_tests,
120-
},
121-
'corner-end-start-shape': {
122-
link: '#corner-shape-shorthands',
123-
tests: corner_shape_tests,
124-
},
125-
'corner-top-shape': {
126-
link: '#corner-shape-shorthands',
127-
tests: corner_shape_tests,
128-
},
129-
'corner-bottom-shape': {
130-
link: '#corner-shape-shorthands',
131-
tests: corner_shape_tests,
132-
},
133-
'corner-left-shape': {
134-
link: '#corner-shape-shorthands',
135-
tests: corner_shape_tests,
136-
},
137-
'corner-right-shape': {
138-
link: '#corner-shape-shorthands',
139-
tests: corner_shape_tests,
140-
},
141-
'corner-block-start-shape': {
142-
link: '#corner-shape-shorthands',
143-
tests: corner_shape_tests,
144-
},
145-
'corner-block-end-shape': {
146-
link: '#corner-shape-shorthands',
147-
tests: corner_shape_tests,
148-
},
149-
'corner-inline-start-shape': {
150-
link: '#corner-shape-shorthands',
151-
tests: corner_shape_tests,
152-
},
153-
'corner-inline-end-shape': {
154-
link: '#corner-shape-shorthands',
155-
tests: corner_shape_tests,
63+
values: corner_shape_tests,
64+
children: {
65+
'corner-shape': {
66+
values: [
67+
...corner_shape_tests,
68+
'round scoop',
69+
'round scoop bevel',
70+
'round scoop bevel notch',
71+
]
72+
},
73+
'corner-<side>-shape': {
74+
link: '#corner-shape-shorthands',
75+
values: corner_shape_tests,
76+
children: [
77+
'corner-top-shape', 'corner-right-shape', 'corner-bottom-shape', 'corner-left-shape',
78+
'corner-block-start-shape', 'corner-block-end-shape', 'corner-inline-start-shape', 'corner-inline-end-shape',
79+
],
80+
},
81+
'corner-<corner>-shape': {
82+
values: corner_shape_tests,
83+
children: [
84+
'corner-top-left-shape', 'corner-top-right-shape', 'corner-bottom-right-shape', 'corner-bottom-left-shape',
85+
'corner-start-start-shape', 'corner-start-end-shape', 'corner-end-end-shape', 'corner-end-start-shape',
86+
],
87+
},
88+
},
15689
},
15790
'border-limit': {
15891
link: '#border-limit',
@@ -176,87 +109,45 @@ export default {
176109
},
177110
'border-clip': {
178111
link: '#border-clip',
179-
tests: border_clip_tests,
180-
},
181-
'border-clip-top': {
182-
link: '#border-clip',
183-
tests: border_clip_tests,
184-
},
185-
'border-clip-right': {
186-
link: '#border-clip',
187-
tests: border_clip_tests,
188-
},
189-
'border-clip-bottom': {
190-
link: '#border-clip',
191-
tests: border_clip_tests,
192-
},
193-
'border-clip-left': {
194-
link: '#border-clip',
195-
tests: border_clip_tests,
196-
},
197-
'box-shadow-color': {
198-
link: '#box-shadow-color',
199-
tests: [
200-
'green',
201-
'green, blue'
112+
values: border_clip_tests,
113+
children: [
114+
'border-clip',
115+
'border-clip-top', 'border-clip-right', 'border-clip-bottom', 'border-clip-left',
116+
'border-clip-block-start', 'border-clip-block-end', 'border-clip-inline-start', 'border-clip-inline-end',
202117
],
203118
},
204-
'box-shadow-offset': {
205-
link: '#box-shadow-offset',
206-
tests: [
207-
'none',
208-
'0 0',
209-
'10px 1em',
210-
'-10px -1em',
211-
'none, 0 0, 10px 1em',
212-
],
213-
},
214-
'box-shadow-blur': {
215-
link: '#box-shadow-blur',
216-
tests: [
217-
'0',
218-
'10px',
219-
'1em',
220-
'10px, 1em',
221-
],
222-
},
223-
'box-shadow-spread': {
224-
link: '#box-shadow-spread',
225-
tests: [
226-
'0',
227-
'10px',
228-
'1em',
229-
'10px, 1em',
230-
],
231-
},
232-
'box-shadow-position': {
233-
link: '#box-shadow-position',
234-
tests: [
235-
'outset',
236-
'inset',
237-
'outset, inset',
238-
],
119+
'`box-shadow` longhands': {
120+
isGroup: true,
121+
children: {
122+
'box-shadow-color': {
123+
link: '#box-shadow-color',
124+
},
125+
'box-shadow-offset': {
126+
link: '#box-shadow-offset',
127+
},
128+
'box-shadow-blur': {
129+
link: '#box-shadow-blur',
130+
},
131+
'box-shadow-spread': {
132+
link: '#box-shadow-spread',
133+
},
134+
'box-shadow-position': {
135+
link: '#box-shadow-position',
136+
},
137+
},
239138
},
139+
240140
'border-shape': {
241141
link: '#border-shape',
242-
tests: [
142+
values: [
243143
'none',
244144
'inset(10% round 10% 40% 10% 40%)',
245145
'ellipse(at top 50% left 20%)',
246146
'circle(at top left)',
247147
'polygon(100% 0, 100% 100%, 0 100%)',
248-
"path('M 20 20 H 80 V 30')",
148+
"path('M 0 0')",
249149
'rect(10% 20px 30% 40px)',
250150
'xywh(10% 40% 100px 200px round 10% 40% 10% 40%)',
251-
'inset(10% round 10% 40% 10% 40%) margin-box',
252-
'ellipse(at top 50% left 20%) margin-box',
253-
'circle(at top left) margin-box',
254-
'polygon(100% 0, 100% 100%, 0 100%) margin-box',
255-
"path('M 20 20 H 80 V 30') margin-box",
256-
'rect(10% 20px 30% 40px) margin-box',
257-
'xywh(10% 40% 100px 200px round 10% 40% 10% 40%) margin-box',
258-
'shape(from 30% 60px, curve to 180px 180px via 90px 190px, close)',
259-
'attr(src url)',
260151
'url(image.png)',
261152
'margin-box',
262153
'border-box',
@@ -265,6 +156,19 @@ export default {
265156
'fill-box',
266157
'stroke-box',
267158
'view-box',
159+
{
160+
id: '<shape> margin-box',
161+
isGroup: false,
162+
children: [
163+
'inset(10% round 10% 40% 10% 40%) margin-box',
164+
'ellipse(at top 50% left 20%) margin-box',
165+
'circle(at top left) margin-box',
166+
'polygon(100% 0, 100% 100%, 0 100%) margin-box',
167+
"path('M 0 0') margin-box",
168+
'rect(10% 20px 30% 40px) margin-box',
169+
'xywh(10% 40% 100px 200px round 10% 40% 10% 40%) margin-box',
170+
]
171+
},
268172
],
269173
},
270174
},

0 commit comments

Comments
 (0)