mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
Auto merge of #15156 - mbrubeck:border-collapse, r=notriddle
WIP: Fix missing borders in tables with border-collapse This fixes a pair of bugs that caused some borders to be ignored by the border-collapse code. r? @notriddle I haven't done a full test run with this change yet. After a `try` build I will update test expectations and/or add a new test. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #14834 (github issue number if applicable). - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15156) <!-- Reviewable:end -->
This commit is contained in:
commit
1b1557839a
3 changed files with 13 additions and 11 deletions
|
@ -681,13 +681,18 @@ fn perform_border_collapse_for_row(child_table_row: &mut TableRowFlow,
|
|||
}
|
||||
|
||||
// Compute block-start borders.
|
||||
match previous_block_borders {
|
||||
PreviousBlockCollapsedBorders::FromPreviousRow(previous_block_borders) => {
|
||||
child_table_row.final_collapsed_borders.block_start = previous_block_borders
|
||||
}
|
||||
PreviousBlockCollapsedBorders::FromTable(collapsed_border) => {
|
||||
child_table_row.final_collapsed_borders.block_start =
|
||||
vec![collapsed_border; child_table_row.block_flow.base.children.len()]
|
||||
let block_start_borders = &mut child_table_row.final_collapsed_borders.block_start;
|
||||
*block_start_borders = child_table_row.preliminary_collapsed_borders.block_start.clone();
|
||||
for (i, this_border) in block_start_borders.iter_mut().enumerate() {
|
||||
match previous_block_borders {
|
||||
PreviousBlockCollapsedBorders::FromPreviousRow(ref previous_block_borders) => {
|
||||
if previous_block_borders.len() > i {
|
||||
this_border.combine(&previous_block_borders[i]);
|
||||
}
|
||||
}
|
||||
PreviousBlockCollapsedBorders::FromTable(table_border) => {
|
||||
this_border.combine(&table_border);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -927,7 +927,7 @@ fn perform_inline_direction_border_collapse_for_row(
|
|||
let first_inline_border = &mut preliminary_collapsed_borders.inline[0];
|
||||
first_inline_border.combine(
|
||||
&CollapsedBorder::inline_start(&*child_table_cell.block_flow.fragment.style,
|
||||
CollapsedBorderProvenance::FromPreviousTableCell));
|
||||
CollapsedBorderProvenance::FromNextTableCell));
|
||||
}
|
||||
|
||||
let inline_collapsed_border = preliminary_collapsed_borders.inline.push_or_set(
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
[border-conflict-element-001c.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
Loading…
Add table
Add a link
Reference in a new issue