mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Fix rowspan handling for rows that span to the end of the rowgroup
This commit is contained in:
parent
b06f4aec67
commit
37d200e628
5 changed files with 76 additions and 14 deletions
|
@ -752,6 +752,7 @@ pub fn propagate_column_inline_sizes_to_child(
|
|||
// FIXME(pcwalton): This seems inefficient. Reference count it instead?
|
||||
match child_flow.class() {
|
||||
FlowClass::TableRowGroup => {
|
||||
incoming_rowspan.clear();
|
||||
let child_table_rowgroup_flow = child_flow.as_mut_table_rowgroup();
|
||||
child_table_rowgroup_flow.spacing = *border_spacing;
|
||||
for kid in child_table_rowgroup_flow.block_flow.base.child_iter_mut() {
|
||||
|
@ -789,7 +790,11 @@ pub fn propagate_column_inline_sizes_to_child(
|
|||
if incoming_rowspan.len() < col + 1 {
|
||||
incoming_rowspan.resize(col + 1, 1);
|
||||
}
|
||||
incoming_rowspan[col] = max(cell.row_span, incoming_rowspan[col]);
|
||||
// HTML § 4.9.11: For rowspan, the value 0 means the cell is to span all
|
||||
// the remaining rows in the rowgroup.
|
||||
if cell.row_span > incoming_rowspan[col] || cell.row_span == 0 {
|
||||
incoming_rowspan[col] = cell.row_span;
|
||||
}
|
||||
}
|
||||
col += 1;
|
||||
}
|
||||
|
|
|
@ -5292,6 +5292,18 @@
|
|||
"url": "/_mozilla/css/table_row_direction_a.html"
|
||||
}
|
||||
],
|
||||
"css/table_rowspan_rowgroup_a.html": [
|
||||
{
|
||||
"path": "css/table_rowspan_rowgroup_a.html",
|
||||
"references": [
|
||||
[
|
||||
"/_mozilla/css/table_rowspan_rowgroup_ref.html",
|
||||
"=="
|
||||
]
|
||||
],
|
||||
"url": "/_mozilla/css/table_rowspan_rowgroup_a.html"
|
||||
}
|
||||
],
|
||||
"css/table_rowspan_simple_a.html": [
|
||||
{
|
||||
"path": "css/table_rowspan_simple_a.html",
|
||||
|
@ -20550,6 +20562,18 @@
|
|||
"url": "/_mozilla/css/table_row_direction_a.html"
|
||||
}
|
||||
],
|
||||
"css/table_rowspan_rowgroup_a.html": [
|
||||
{
|
||||
"path": "css/table_rowspan_rowgroup_a.html",
|
||||
"references": [
|
||||
[
|
||||
"/_mozilla/css/table_rowspan_rowgroup_ref.html",
|
||||
"=="
|
||||
]
|
||||
],
|
||||
"url": "/_mozilla/css/table_rowspan_rowgroup_a.html"
|
||||
}
|
||||
],
|
||||
"css/table_rowspan_simple_a.html": [
|
||||
{
|
||||
"path": "css/table_rowspan_simple_a.html",
|
||||
|
@ -20562,18 +20586,6 @@
|
|||
"url": "/_mozilla/css/table_rowspan_simple_a.html"
|
||||
}
|
||||
],
|
||||
"css/table_rowspan_simple_ref.html": [
|
||||
{
|
||||
"path": "css/table_rowspan_simple_ref.html",
|
||||
"references": [
|
||||
[
|
||||
"/_mozilla/css/table_rowspan_simple_ref.html",
|
||||
"=="
|
||||
]
|
||||
],
|
||||
"url": "/_mozilla/css/table_rowspan_simple_ref.html"
|
||||
}
|
||||
],
|
||||
"css/table_specified_width_a.html": [
|
||||
{
|
||||
"path": "css/table_specified_width_a.html",
|
||||
|
|
24
tests/wpt/mozilla/tests/css/table_rowspan_rowgroup_a.html
Normal file
24
tests/wpt/mozilla/tests/css/table_rowspan_rowgroup_a.html
Normal file
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="match" href="table_rowspan_rowgroup_ref.html">
|
||||
<link rel="spec" href="https://html.spec.whatwg.org/multipage/#attributes-common-to-td-and-th-elements">
|
||||
<style>
|
||||
td {
|
||||
width: 100px;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<table border="1">
|
||||
<tbody>
|
||||
<tr><td rowspan="0">A</td><td>B</td></tr>
|
||||
<tr><td>C</td></tr>
|
||||
<tr><td>D</td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td>E</td><td>F</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
22
tests/wpt/mozilla/tests/css/table_rowspan_rowgroup_ref.html
Normal file
22
tests/wpt/mozilla/tests/css/table_rowspan_rowgroup_ref.html
Normal file
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
td {
|
||||
width: 100px;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<table border="1">
|
||||
<tbody>
|
||||
<tr><td rowspan="3">A</td><td>B</td></tr>
|
||||
<tr><td>C</td></tr>
|
||||
<tr><td>D</td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td>E</td><td>F</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="match" href="table_rowspan_simple_ref.html">
|
||||
<style>
|
||||
td {
|
||||
width: 100px;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue