Auto merge of #5887 - pcwalton:border-collapse-missing-cells, r=mbrubeck

This was seen in Twitter and the Google SERPs (sometimes).

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5887)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-04-28 15:32:31 -05:00
commit b6fc83cf2b
4 changed files with 52 additions and 1 deletions

View file

@ -760,7 +760,9 @@ fn perform_border_collapse_for_row(child_table_row: &mut TableRowFlow,
let next_block = next_block.push_or_mutate(i, *this_block_border);
match next_block_borders {
NextBlockCollapsedBorders::FromNextRow(next_block_borders) => {
next_block.combine(&next_block_borders[i]);
if next_block_borders.len() > i {
next_block.combine(&next_block_borders[i])
}
}
NextBlockCollapsedBorders::FromTable(ref next_block_borders) => {
next_block.combine(next_block_borders);

View file

@ -81,6 +81,7 @@ flaky_cpu == append_style_a.html append_style_b.html
!= border_black_ridge.html border_black_groove.html
!= border_black_ridge.html border_black_solid.html
== border_code_tag.html border_code_tag_ref.html
== border_collapse_missing_cell_a.html border_collapse_missing_cell_ref.html
== border_collapse_simple_a.html border_collapse_simple_ref.html
== border_radius_clip_a.html border_radius_clip_ref.html
== border_radius_overlapping_a.html border_radius_overlapping_ref.html

View file

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<!-- Tests that missing cells don't cause a crash in border collapse code. -->
<style>
table {
border-collapse: collapse;
}
</style>
</head>
<body>
<table>
<tr>
<td>United States</td>
<td>40404</td>
<td>(any)</td>
</tr>
<tr>
<td>3424486444</td>
<td>Vodafone</td>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<!-- Tests that missing cells don't cause a crash in border collapse code. -->
<style>
table {
border-collapse: collapse;
}
</style>
</head>
<body>
<table>
<tr>
<td>United States</td>
<td>40404</td>
<td>(any)</td>
</tr>
<tr>
<td>3424486444</td>
<td>Vodafone</td>
</tr>
</table>
</body>
</html>