Skip to content

Commit c8e6ccd

Browse files
[css-tables] Add some subpixel collapsed border tests
This CL contains tests only, no behavior change. Chrome passes 001. Safari lodpi and Firefox pass 001 and 002. EdgeHTML 18.17763 and Safari hidpi pass 001, 002, and 003. Chrome probably passes 001 but fails 002 because of LayoutUnit's 1/64 pixel precision but that's not confirmed. Note that these tests will become invalid if the proposal in w3c/csswg-drafts#606 is adopted. Bug: 377847 Change-Id: Ifc9e8f9f878f7462cb949670350eadb17c7c2940
1 parent 6e07835 commit c8e6ccd

5 files changed

+134
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
>
2+
<link rel="author" title="David Grogan" href="mailto:[email protected]">
3+
<link rel="help" href="https://www.w3.org/TR/CSS22/tables.html#collapsing-borders">
4+
<link rel="help" href="https://drafts.csswg.org/css-tables-3/#border-conflict-resolution-algorithm">
5+
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/606">
6+
<link rel="match" href="subpixel-collapsed-borders-ref.html">
7+
<meta name="flags" content="" />
8+
<meta name="assert" content="When collapsed border tables have border widths larger than cells', the table border wins." />
9+
10+
<style>
11+
table {
12+
border: 5px solid green;
13+
border-collapse: collapse;
14+
}
15+
16+
td {
17+
width: 50px;
18+
height: 50px;
19+
border: 4.95px solid red;
20+
}
21+
style>
22+
23+
<p>There should be a square with a green border, not a red border.
24+
p>
25+
26+
<table>
27+
<tr>
28+
<td>td>
29+
tr>
30+
table>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
>
2+
<link rel="author" title="David Grogan" href="mailto:[email protected]">
3+
<link rel="help" href="https://www.w3.org/TR/CSS22/tables.html#collapsing-borders">
4+
<link rel="help" href="https://drafts.csswg.org/css-tables-3/#border-conflict-resolution-algorithm">
5+
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/606">
6+
<link rel="match" href="subpixel-collapsed-borders-ref.html">
7+
<meta name="flags" content="" />
8+
<meta name="assert" content="When collapsed border tables have border widths larger than cells', the table border wins even when the cell border is merely 0.01 pixels narrower" />
9+
10+
<style>
11+
table {
12+
border: 5px solid green;
13+
border-collapse: collapse;
14+
}
15+
16+
td {
17+
width: 50px;
18+
height: 50px;
19+
border: 4.99px solid red;
20+
}
21+
style>
22+
23+
<p>There should be a square with a green border, not a red border.
24+
p>
25+
26+
<table>
27+
<tr>
28+
<td>td>
29+
tr>
30+
table>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
>
2+
<style>
3+
table {
4+
border: 5.95px solid green;
5+
border-collapse: collapse;
6+
}
7+
8+
td {
9+
width: 50px;
10+
height: 50px;
11+
border: 1px solid red;
12+
}
13+
style>
14+
15+
<p>There should be a square with a green border, not a red border.
16+
p>
17+
18+
<table>
19+
<tr>
20+
<td>td>
21+
tr>
22+
table>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
>
2+
<link rel="author" title="David Grogan" href="mailto:[email protected]">
3+
<link rel="help" href="https://www.w3.org/TR/CSS22/tables.html#collapsing-borders">
4+
<link rel="help" href="https://drafts.csswg.org/css-tables-3/#border-conflict-resolution-algorithm">
5+
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/606">
6+
<link rel="match" href="subpixel-collapsed-borders-003-ref.html">
7+
<meta name="flags" content="" />
8+
<meta name="assert" content="When collapsed border tables have border widths larger than cells', the table border wins even when the floored table border is the same size as the cell's." />
9+
10+
<style>
11+
table {
12+
border: 5.95px solid green;
13+
border-collapse: collapse;
14+
}
15+
16+
td {
17+
width: 50px;
18+
height: 50px;
19+
border: 5px solid red;
20+
}
21+
style>
22+
23+
<p>There should be a square with a green border, not a red border.
24+
p>
25+
26+
<table>
27+
<tr>
28+
<td>td>
29+
tr>
30+
table>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
>
2+
<style>
3+
table {
4+
border: 5px solid green;
5+
border-collapse: collapse;
6+
}
7+
8+
td {
9+
width: 50px;
10+
height: 50px;
11+
border: 1px solid red;
12+
}
13+
style>
14+
15+
<p>There should be a square with a green border, not a red border.
16+
p>
17+
18+
<table>
19+
<tr>
20+
<td>td>
21+
tr>
22+
table>

0 commit comments

Comments
 (0)