Skip to content

Commit

Permalink
Fixed colspan not including cell spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrewster committed May 24, 2016
1 parent 7d02c20 commit 5e73411
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 1 deletion.
2 changes: 1 addition & 1 deletion components/layout/table_row.rs
Expand Up @@ -357,7 +357,7 @@ impl Flow for TableRowFlow {
None => break,
};
column_computed_inline_size.size = column_computed_inline_size.size +
extra_column_computed_inline_size.size;
extra_column_computed_inline_size.size + self.spacing.horizontal;
}

computed_inline_size_for_cells.push(column_computed_inline_size)
Expand Down
24 changes: 24 additions & 0 deletions tests/wpt/mozilla/meta/MANIFEST.json
Expand Up @@ -4756,6 +4756,18 @@
"url": "/_mozilla/css/table_colspan_simple_a.html"
}
],
"css/table_colspan_spacing_a.html": [
{
"path": "css/table_colspan_spacing_a.html",
"references": [
[
"/_mozilla/css/table_colspan_spacing_ref.html",
"=="
]
],
"url": "/_mozilla/css/table_colspan_spacing_a.html"
}
],
"css/table_containing_block_a.html": [
{
"path": "css/table_containing_block_a.html",
Expand Down Expand Up @@ -11568,6 +11580,18 @@
"url": "/_mozilla/css/table_colspan_simple_a.html"
}
],
"css/table_colspan_spacing_a.html": [
{
"path": "css/table_colspan_spacing_a.html",
"references": [
[
"/_mozilla/css/table_colspan_spacing_ref.html",
"=="
]
],
"url": "/_mozilla/css/table_colspan_spacing_a.html"
}
],
"css/table_containing_block_a.html": [
{
"path": "css/table_containing_block_a.html",
Expand Down
26 changes: 26 additions & 0 deletions tests/wpt/mozilla/tests/css/table_colspan_spacing_a.html
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<link rel='match' href='table_colspan_spacing_ref.html'>
<style>
td[colspan="2"] {
background-color: blue;
color: white;
}
td[colspan="3"] {
background-color: green;
color: white;
}
td {
height: 23px;
padding: 0;
}
</style>
<body>
<table border=0 cellspacing=1 cellpadding=0>
<tr><td width=100>&nbsp;</td><td width=100>&nbsp;</td><td width=100>&nbsp;</td></tr>
<tr><td colspan=2>&nbsp;</td><td>&nbsp;</td></tr>
<tr><td>&nbsp;<td colspan=2>&nbsp;</td></tr>
<tr><td colspan=3>&nbsp;</td></tr>
</table>
</body>
</html>
37 changes: 37 additions & 0 deletions tests/wpt/mozilla/tests/css/table_colspan_spacing_ref.html
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>
<style>
.table {
padding-left: 1px;
}
.row {
height: 23px;
margin-top: 1px;
margin-right: 1px;
}
.row-0 {
height: 24px;
}
.row-1 {
width: 201px;
background-color: blue;
}
.row-2 {
margin-left: 101px;
width: 201px;
background-color: blue;
}
.row-3 {
width: 302px;
background-color: green;
}
</style>
<body>
<div class="table">
<div class="row row-0"></div>
<div class="row row-1"></div>
<div class="row row-2"></div>
<div class="row row-3"></div>
</div>
</body>
</html>

0 comments on commit 5e73411

Please sign in to comment.