Skip to content

Commit 319c660

Browse files
authored
WebKit export: [rhythmic-sizing] Add block-step-round to CSS parser (#49490)
https://bugs.webkit.org/show_bug.cgi?id=252208
1 parent b5608e0 commit 319c660

File tree

4 files changed

+79
-0
lines changed

4 files changed

+79
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>CSS Rhythm: block-step-round computed values</title>
5+
<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m">
6+
<link rel="help" href="https://drafts.csswg.org/css-rhythm/#block-step-round">
7+
<meta name="assert" content="Checking computed values for block-step-round">
8+
<script src="/resources/testharness.js"></script>
9+
<script src="/resources/testharnessreport.js"></script>
10+
<script src="/css/support/computed-testcommon.js"></script>
11+
</head>
12+
<body>
13+
<div id="target"></div>
14+
<script>
15+
test_computed_value("block-step-round", "up");
16+
test_computed_value("block-step-round", "down");
17+
test_computed_value("block-step-round", "nearest");
18+
</script>
19+
</body>
20+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>CSS Rhythm: block-step-round invalid values</title>
5+
<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m">
6+
<link rel="help" href="https://drafts.csswg.org/css-rhythm/#block-step-round">
7+
<meta name="assert" content="Invalid values for block-step-round should not be parsed">
8+
<script src="/resources/testharness.js"></script>
9+
<script src="/resources/testharnessreport.js"></script>
10+
<script src="/css/support/parsing-testcommon.js"></script>
11+
</head>
12+
<body>
13+
<script>
14+
test_invalid_value("block-step-align", "up up");
15+
test_invalid_value("block-step-align", "up down");
16+
test_invalid_value("block-step-align", "up nearest");
17+
test_invalid_value("block-step-align", "down down");
18+
test_invalid_value("block-step-align", "down up");
19+
test_invalid_value("block-step-align", "down nearest");
20+
test_invalid_value("block-step-align", "nearest nearest");
21+
test_invalid_value("block-step-align", "nearest up");
22+
test_invalid_value("block-step-align", "nearest down");
23+
test_invalid_value("block-step-align", "-1px");
24+
test_invalid_value("block-step-align", "min-content");
25+
test_invalid_value("block-step-align", "10%");
26+
test_invalid_value("block-step-align", "20");
27+
test_invalid_value("block-step-align", "none");
28+
test_invalid_value("block-step-align", "border-box");
29+
test_invalid_value('block-step-align', "margin");
30+
test_invalid_value("block-step-align", "padding")
31+
test_invalid_value("block-step-align", "content")
32+
</script>
33+
</body>
34+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>CSS Rhythm: block-step-round valid values</title>
5+
<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m">
6+
<link rel="help" href="https://drafts.csswg.org/css-rhythm/#block-step-round">
7+
<meta name="assert" content="Parsing valid values for block-step-round property">
8+
<script src="/resources/testharness.js"></script>
9+
<script src="/resources/testharnessreport.js"></script>
10+
<script src="/css/support/parsing-testcommon.js"></script>
11+
</head>
12+
<body>
13+
<script>
14+
test_valid_value("block-step-round", "up");
15+
test_valid_value("block-step-round", "down");
16+
test_valid_value("block-step-round", "nearest");
17+
</script>
18+
</body>
19+
</html>

web-animations/animation-model/animation-types/property-list.js

+6
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ const gCSSProperties1 = {
116116
{ type: 'discrete', options: [ [ 'margin-box', 'padding-box'], ['margin-box', 'content-box'], ['padding-box', 'content-box'] ] }
117117
]
118118
},
119+
'block-step-round': {
120+
// https://drafts.csswg.org/css-rhythm/#block-step-round
121+
types: [
122+
{ type: 'discrete', options: [ [ 'up', 'down'], ['down', 'nearest'], ['nearest', 'up'] ] }
123+
]
124+
},
119125
'block-step-size': {
120126
// https://drafts.csswg.org/css-rhythm/#block-step-size
121127
types: [ 'length' ]

0 commit comments

Comments
 (0)