Skip to content

Commit 1d55057

Browse files
lilleschromium-wpt-export-bot
authored andcommitted
::column pseudo element parsing and computed style tests
Allowing ::column on ::before elements is not specifically mentioned in the spec, but a ::before element can be a multicol scroll container with generated content. There is also an assumption here that all properties fully cascade even if just a few actually have an effect. Bug: 365680822, 382090952 Change-Id: I73d725d4bbf071016d53fc5183f2b9cea177f9ce Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6068466 Reviewed-by: Daniil Sakhapov <[email protected]> Commit-Queue: Rune Lillesveen <[email protected]> Cr-Commit-Position: refs/heads/main@{#1391571}
1 parent b425579 commit 1d55057

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!DOCTYPE html>
2+
<title>CSS Multi-column Layout Test: Computed ::column style</title>
3+
<link rel="help" href="https://drafts.csswg.org/css-multicol-2/#column-pseudo">
4+
<script src="/resources/testharness.js"></script>
5+
<script src="/resources/testharnessreport.js"></script>
6+
<script src="/css/support/computed-testcommon.js"></script>
7+
<style>
8+
#target {
9+
font-size: 20px;
10+
scroll-margin-bottom: 4px;
11+
}
12+
#target::column {
13+
font-size: 40px;
14+
scroll-snap-align: start;
15+
scroll-snap-stop: always;
16+
scroll-margin: 2px;
17+
scroll-margin-top: 2em;
18+
scroll-margin-bottom: inherit;
19+
}
20+
</style>
21+
<div id="target"></div>
22+
<script>
23+
const column_style = getComputedStyle(target, "::column");
24+
25+
test(() => {
26+
assert_equals(column_style.fontSize, "40px");
27+
}, "::column font-size applied");
28+
29+
test(() => {
30+
assert_equals(column_style.scrollSnapAlign, "start");
31+
}, "::column scroll-snap-align");
32+
33+
test(() => {
34+
assert_equals(column_style.scrollSnapStop, "always");
35+
}, "::column scroll-snap-stop");
36+
37+
test(() => {
38+
assert_equals(column_style.scrollSnapMarginLeft, "2px");
39+
assert_equals(column_style.scrollSnapMarginRight, "2px");
40+
assert_equals(column_style.scrollSnapMarginTop, "80px");
41+
assert_equals(column_style.scrollSnapMarginBottom, "4px");
42+
}, "::column scroll-snap-margin");
43+
44+
</script>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<title>CSS Multi-column Layout Test: ::column pseudo element invalid parsing</title>
3+
<link rel="help" href="https://drafts.csswg.org/css-multicol-2/#column-pseudo">
4+
<script src="/resources/testharness.js"></script>
5+
<script src="/resources/testharnessreport.js"></script>
6+
<script src="/css/support/parsing-testcommon.js"></script>
7+
<script>
8+
test_invalid_selector("::column:hover");
9+
test_invalid_selector("::column::before");
10+
test_invalid_selector("::column::first-letter");
11+
test_invalid_selector("::column::first-line");
12+
test_invalid_selector("::first-letter::column");
13+
test_invalid_selector("::column::slotted(*)");
14+
</script>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<title>CSS Multi-column Layout Test: ::column pseudo element valid parsing</title>
3+
<link rel="help" href="https://drafts.csswg.org/css-multicol-2/#column-pseudo">
4+
<script src="/resources/testharness.js"></script>
5+
<script src="/resources/testharnessreport.js"></script>
6+
<script src="/css/support/parsing-testcommon.js"></script>
7+
<script>
8+
test_valid_selector("::column");
9+
test_valid_selector("::column::scroll-marker");
10+
test_valid_selector("::before::column");
11+
test_valid_selector("::before::column::scroll-marker");
12+
</script>

0 commit comments

Comments
 (0)