summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-shapes/parsing/shape-outside-valid.html
blob: e5587c6b233a0c94568447777e95533ecbb50b29 (plain)
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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Shapes Module Level 1: parsing shape-outside with valid values</title>
<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-shapes/#shape-outside-property">
<meta name="assert" content="shape-outside supports the full grammar 'none | [ <basic-shape> || <shape-box> ] | <image>'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_valid_value("shape-outside", "none");

// <basic-shape>
test_valid_value("shape-outside", "inset(100%)");
test_valid_value("shape-outside", "inset(0 1px)", "inset(0px 1px)");
test_valid_value("shape-outside", "inset(0px 1px 2%)");
test_valid_value("shape-outside", "inset(0px 1px 2% 3em)");
test_valid_value("shape-outside", "inset(0px round 100%)");
test_valid_value("shape-outside", "inset(0px round 0 1px)", "inset(0px round 0px 1px)");
test_valid_value("shape-outside", "inset(0px round 0px 1px 2%)");
test_valid_value("shape-outside", "inset(0px round 0px 1px 2% 3em)");
test_valid_value("shape-outside", "inset(10px round 20% / 0px 1px 2% 3em)");

test_valid_value("shape-outside", "circle()");
test_valid_value("shape-outside", "circle(1px)");
test_valid_value("shape-outside", "circle(closest-side)", "circle()");
test_valid_value("shape-outside", "circle(at 10% 20%)");
test_valid_value("shape-outside", "circle(farthest-side at center top)", "circle(farthest-side at 50% 0%)");
test_valid_value("shape-outside", "circle(4% at top right)", "circle(4% at 100% 0%)");

test_valid_value("shape-outside", "ellipse()", "ellipse()");
test_valid_value("shape-outside", "ellipse(3% 2%)");
test_valid_value("shape-outside", "ellipse(closest-side 1px)");
test_valid_value("shape-outside", "ellipse(10% closest-side)");
test_valid_value("shape-outside", "ellipse(closest-side closest-side at 60% 70%)", "ellipse(at 60% 70%)");
test_valid_value("shape-outside", "ellipse(at 10% 20%)");
test_valid_value("shape-outside", "ellipse(farthest-side 4% at bottom left)", "ellipse(farthest-side 4% at 0% 100%)");

test_valid_value("shape-outside", "polygon(1% 2%)");
test_valid_value("shape-outside", "polygon(nonzero, 1px 2px, 3em 4em)", "polygon(1px 2px, 3em 4em)");
test_valid_value("shape-outside", "polygon(evenodd, 1px 2px, 3em 4em, 5pt 6%)");

// <shape-box>
test_valid_value("shape-outside", "border-box");
test_valid_value("shape-outside", "padding-box");
test_valid_value("shape-outside", "content-box");
test_valid_value("shape-outside", "margin-box");

// basic-shape> <shape-box>
test_valid_value("shape-outside", "circle(7% at 8% 9%) border-box");

// <shape-box> <basic-shape>
test_valid_value("shape-outside", "padding-box inset(10em)", "inset(10em) padding-box");
test_valid_value("shape-outside", "border-box circle(7% at 8% 9%)", "circle(7% at 8% 9%) border-box");
test_valid_value("shape-outside", "margin-box ellipse(at 1em 2em)", ["ellipse(at 1em 2em) margin-box", "ellipse(at 1em 2em)"]);
test_valid_value("shape-outside", "content-box polygon(1% 2%)", "polygon(1% 2%) content-box");

// <image>
// Spec is silent about url serialization.
// Blink, Edge, Firefox add quotes. WebKit removes quotes.
test_valid_value("shape-outside", "url(https://example.com/)", ["url(https://example.com/)", "url(\"https://example.com/\")"]);
test_valid_value("shape-outside", "url(\"https://example.com/\")", ["url(https://example.com/)", "url(\"https://example.com/\")"]);
test_valid_value("shape-outside", "cross-fade(url(\"https://example.com/\"), green)");
test_valid_value("shape-outside", "linear-gradient(yellow, blue)");
</script>
</body>
</html>