File tree Expand file tree Collapse file tree 2 files changed +69
-0
lines changed Expand file tree Collapse file tree 2 files changed +69
-0
lines changed Original file line number Diff line number Diff line change @@ -257,6 +257,73 @@ mod tests {
257
257
};
258
258
);
259
259
260
+ #[test]
261
+ pub fn test_border_spacing() {
262
+ minify_test(
263
+ r#"
264
+ .foo {
265
+ border-spacing: 0px;
266
+ }
267
+ "#,
268
+ indoc! {".foo{border-spacing:0}"
269
+ },
270
+ );
271
+ minify_test(
272
+ r#"
273
+ .foo {
274
+ border-spacing: 0px 0px;
275
+ }
276
+ "#,
277
+ indoc! {".foo{border-spacing:0}"
278
+ },
279
+ );
280
+
281
+ minify_test(
282
+ r#"
283
+ .foo {
284
+ border-spacing: 12px 0px;
285
+ }
286
+ "#,
287
+ indoc! {".foo{border-spacing:12px 0}"
288
+ },
289
+ );
290
+
291
+ minify_test(
292
+ r#"
293
+ .foo {
294
+ border-spacing: calc(3px * 2) calc(5px * 0);
295
+ }
296
+ "#,
297
+ indoc! {".foo{border-spacing:6px 0}"
298
+ },
299
+ );
300
+
301
+ minify_test(
302
+ r#"
303
+ .foo {
304
+ border-spacing: calc(3px * 2) max(0px, 8px);
305
+ }
306
+ "#,
307
+ indoc! {".foo{border-spacing:6px 8px}"
308
+ },
309
+ );
310
+
311
+ // TODO: The `<length>` in border-spacing cannot have a negative value,
312
+ // we may need to implement NonNegativeLength like Servo does.
313
+ // Servo Code: https://github.com/servo/servo/blob/08bc2d53579c9ab85415d4363888881b91df073b/components/style/values/specified/length.rs#L875
314
+ // CSSWG issue: https://lists.w3.org/Archives/Public/www-style/2008Sep/0161.html
315
+ // `border-spacing = <length> <length>?`
316
+ minify_test(
317
+ r#"
318
+ .foo {
319
+ border-spacing: -20px;
320
+ }
321
+ "#,
322
+ indoc! {".foo{border-spacing:-20px}"
323
+ },
324
+ );
325
+ }
326
+
260
327
#[test]
261
328
pub fn test_border() {
262
329
test(
Original file line number Diff line number Diff line change @@ -805,6 +805,8 @@ define_properties! {
805
805
"inset-inline" : InsetInline ( InsetInline ) shorthand: true ,
806
806
"inset" : Inset ( Inset ) shorthand: true ,
807
807
808
+ "border-spacing" : BorderSpacing ( Size2D <Length >) ,
809
+
808
810
"border-top-color" : BorderTopColor ( CssColor ) [ logical_group: BorderColor , category: Physical ] ,
809
811
"border-bottom-color" : BorderBottomColor ( CssColor ) [ logical_group: BorderColor , category: Physical ] ,
810
812
"border-left-color" : BorderLeftColor ( CssColor ) [ logical_group: BorderColor , category: Physical ] ,
You can’t perform that action at this time.
0 commit comments