mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
layout: Improve sizing of tables in collapsed-borders mode (#34932)
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
754ec455bc
commit
25a94efcdf
20 changed files with 44 additions and 42 deletions
|
@ -616,6 +616,23 @@ impl ComputedValuesExt for ComputedValues {
|
|||
|
||||
fn border_width(&self, containing_block_writing_mode: WritingMode) -> LogicalSides<Au> {
|
||||
let border = self.get_border();
|
||||
if self.get_box().display.inside() == stylo::DisplayInside::Table &&
|
||||
!matches!(self.pseudo(), Some(PseudoElement::ServoTableGrid)) &&
|
||||
self.get_inherited_table().border_collapse == BorderCollapse::Collapse
|
||||
{
|
||||
// For tables in collapsed-borders mode we halve the border widths, because
|
||||
// > in this model, the width of the table includes half the table border.
|
||||
// https://www.w3.org/TR/CSS22/tables.html#collapsing-borders
|
||||
return LogicalSides::from_physical(
|
||||
&PhysicalSides::new(
|
||||
border.border_top_width / 2,
|
||||
border.border_right_width / 2,
|
||||
border.border_bottom_width / 2,
|
||||
border.border_left_width / 2,
|
||||
),
|
||||
containing_block_writing_mode,
|
||||
);
|
||||
}
|
||||
LogicalSides::from_physical(
|
||||
&PhysicalSides::new(
|
||||
border.border_top_width,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue