Skip to content

Commit 71cfdb5

Browse files
Sam Davis Omekara (from Dev Box)chromium-wpt-export-bot
authored andcommitted
[Gap Decorations]: Avoid 0px behavior for list of column-rule-widths
This CL avoids the "return 0px if style is none/hidden" behavior for column-rule-width when multiple values are involved. While ongoing work aims to decouple *-width and *-style values entirely, we want to ensure that gap decorations are not blocked by that effort due to potential compatibility concerns. To maintain backward compatibility, we preserve the current behavior for single values. However, for lists of values, we now avoid returning 0px, allowing us to move forward without inheriting that complexity. Bug: 357648037 Change-Id: I4986a7564b0a13c02195636020df1c42f309cada Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6533577 Reviewed-by: Alison Maher <almaher@microsoft.com> Commit-Queue: Sam Davis Omekara <samomekarajr@microsoft.com> Reviewed-by: Kevin Babbitt <kbabbitt@microsoft.com> Cr-Commit-Position: refs/heads/main@{#1458455}
1 parent 80c8117 commit 71cfdb5

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>CSS Gap Decorations: Ensure getComputedStyle for column-rule-width is as specified with multiple values</title>
6+
<link rel="help" href="https://drafts.csswg.org/css-gaps-1/#column-row-rule-width">
7+
<link rel="author" title="Sam Davis Omekara Jr." href="mailto:samomekarajr@microsoft.com">
8+
<script src="/resources/testharness.js" type="text/javascript"></script>
9+
<script src="/resources/testharnessreport.js" type="text/javascript"></script>
10+
</head>
11+
<body>
12+
<div id="target1"></div>
13+
<div id="target2"></div>
14+
<div id="target3"></div>
15+
<style>
16+
#target1 {
17+
column-rule-width: thin;
18+
}
19+
20+
#target2 {
21+
column-rule-width: 5px 10px 15px;
22+
}
23+
24+
#target3 {
25+
column-rule-width: repeat(auto, 5px);
26+
}
27+
</style>
28+
<script>
29+
test(function() {
30+
const containerStyle = window.getComputedStyle(document.querySelector('#target1'));
31+
const columnRuleWidth = containerStyle.getPropertyValue('column-rule-width');
32+
assert_equals(columnRuleWidth, '0px');
33+
34+
}, "`column-rule-width` should be `0px` when `column-rule-style` is `none` with single value");
35+
36+
test(function() {
37+
const containerStyle = window.getComputedStyle(document.querySelector('#target2'));
38+
const columnRuleWidth = containerStyle.getPropertyValue('column-rule-width');
39+
assert_equals(columnRuleWidth, '5px 10px 15px');
40+
41+
}, "`column-rule-width` should be as specified regardless of `column-rule-style` with multiple values");
42+
43+
test(function() {
44+
const containerStyle = window.getComputedStyle(document.querySelector('#target3'));
45+
const columnRuleWidth = containerStyle.getPropertyValue('column-rule-width');
46+
assert_equals(columnRuleWidth, 'repeat(auto, 5px)');
47+
48+
}, "`column-rule-width` should be as specified regardless of `column-rule-style` with multiple (repeat) values");
49+
</script>
50+
</body>
51+
</html>

0 commit comments

Comments
 (0)