Skip to content

Commit

Permalink
layout: Set padding to zero on tables in collapsed-borders mode
Browse files Browse the repository at this point in the history
https://drafts.csswg.org/css2/#collapsing-borders
> in this model, a table does not have padding

https://drafts.csswg.org/css-tables/#collapsed-style-overrides
> The padding of the table-root is ignored (as if it was set to 0px).

Signed-off-by: Oriol Brufau <[email protected]>
  • Loading branch information
Loirooriol authored and servo-wpt-sync committed Jan 9, 2025
1 parent e79ed20 commit 10af445
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 0 deletions.
17 changes: 17 additions & 0 deletions css/CSS2/tables/collapsing-border-model-011.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<title>CSS Test: Tables under the collapsing borders model don't have padding</title>
<link rel="author" title="Oriol Brufau" href="[email protected]">
<link rel="help" href="http://www.w3.org/TR/CSS21/tables.html#collapsing-borders">
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
<style>
table {
border-collapse: collapse;
box-sizing: content-box;
width: 100px;
height: 100px;
padding: 100px;
background: green;
}
</style>
<p>Test passes if there is a filled green square.</p>
<table></table>
17 changes: 17 additions & 0 deletions css/CSS2/tables/collapsing-border-model-012.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<title>CSS Test: Tables under the collapsing borders model don't have padding</title>
<link rel="author" title="Oriol Brufau" href="[email protected]">
<link rel="help" href="http://www.w3.org/TR/CSS21/tables.html#collapsing-borders">
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
<style>
table {
border-collapse: collapse;
box-sizing: border-box;
width: 100px;
height: 100px;
padding: 100px;
background: green;
}
</style>
<p>Test passes if there is a filled green square.</p>
<table></table>
22 changes: 22 additions & 0 deletions css/CSS2/tables/collapsing-border-model-013.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>CSS Test: Tables under the collapsing borders model don't have padding</title>
<link rel="author" title="Oriol Brufau" href="[email protected]">
<link rel="help" href="http://www.w3.org/TR/CSS21/tables.html#collapsing-borders">
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
<style>
div {
float: left;
background: green;
}
table {
border-collapse: collapse;
box-sizing: content-box;
width: 100px;
height: 100px;
padding: 100px;
}
</style>
<p>Test passes if there is a filled green square.</p>
<div>
<table></table>
</div>
22 changes: 22 additions & 0 deletions css/CSS2/tables/collapsing-border-model-014.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>CSS Test: Tables under the collapsing borders model don't have padding</title>
<link rel="author" title="Oriol Brufau" href="[email protected]">
<link rel="help" href="http://www.w3.org/TR/CSS21/tables.html#collapsing-borders">
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
<style>
div {
float: left;
background: green;
}
table {
border-collapse: collapse;
box-sizing: border-box;
width: 100px;
height: 100px;
padding: 100px;
}
</style>
<p>Test passes if there is a filled green square.</p>
<div>
<table></table>
</div>

0 comments on commit 10af445

Please sign in to comment.