1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Tests for `box-sizing` property in CSS
// Based on CSS Box Sizing Module Level 3:
// - content-box: width/height apply to content area only; padding/border add to total
// - border-box: width/height include padding and border; content area shrinks
// - padding-box: width/height include padding; border adds to total (non-standard)
use crate::*;
// Case: content-box sizing
// Spec points:
// - width/height specify content box dimensions
// - padding is added outside the content box
// In this test:
// - Element: 200x200px content, padding-left=20px, padding-top=30px
// - Expected: width=220px, height=230px
// - Child positioned at (20, 30) due to padding
// Case: border-box sizing
// Spec points:
// - width/height specify border box dimensions
// - padding is included within declared dimensions
// In this test:
// - Element: 200x200px total (border-box), padding-left=20px, padding-top=30px
// - Expected: width=200px, height=200px (unchanged)
// - Child positioned at (20, 30) due to padding