aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/table/layout.rs
diff options
context:
space:
mode:
authorOriol Brufau <obrufau@igalia.com>2025-01-20 09:18:20 -0800
committerGitHub <noreply@github.com>2025-01-20 17:18:20 +0000
commit9b388da9cb9f6a898050464360ae4c8ce90f6693 (patch)
tree00023a4b0142f3f6ee97480a3c6b7b6c6476401c /components/layout_2020/table/layout.rs
parentb5d1d0369859504963d6f1ad90a25672dcc09400 (diff)
downloadservo-9b388da9cb9f6a898050464360ae4c8ce90f6693.tar.gz
servo-9b388da9cb9f6a898050464360ae4c8ce90f6693.zip
layout: Fix clientWidth & friends for tables (#35096)
`clientWidth` shouldn't include the borders of a box. The problem was that we pretend that table wrapper boxes have the border specified on the table element, even though this border actually applies to the table grid box instead of the table wrapper box. Therefore, `clientWidth` was wrong when it subtracted the borders. This patch fixes it. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Diffstat (limited to 'components/layout_2020/table/layout.rs')
-rw-r--r--components/layout_2020/table/layout.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/components/layout_2020/table/layout.rs b/components/layout_2020/table/layout.rs
index 50a05e0b3dd..5d6c27d1796 100644
--- a/components/layout_2020/table/layout.rs
+++ b/components/layout_2020/table/layout.rs
@@ -41,7 +41,7 @@ use crate::sizing::{ComputeInlineContentSizes, ContentSizes, InlineContentSizesR
use crate::style_ext::{
BorderStyleColor, Clamp, ComputedValuesExt, LayoutStyle, PaddingBorderMargin,
};
-use crate::table::{SpecificTableOrTableCellInfo, TableSlotCoordinates};
+use crate::table::{SpecificTableGridOrTableCellInfo, TableSlotCoordinates};
use crate::{
ConstraintSpace, ContainingBlock, ContainingBlockSize, IndefiniteContainingBlock, WritingMode,
};
@@ -50,8 +50,8 @@ fn detailed_layout_info(
border_style_color: Option<LogicalSides<BorderStyleColor>>,
writing_mode: WritingMode,
) -> Option<SpecificLayoutInfo> {
- Some(SpecificLayoutInfo::TableOrTableCell(Box::new(
- SpecificTableOrTableCellInfo {
+ Some(SpecificLayoutInfo::TableGridOrTableCell(Box::new(
+ SpecificTableGridOrTableCellInfo {
border_style_color: border_style_color?.to_physical(writing_mode),
},
)))
@@ -1697,7 +1697,7 @@ impl<'a> TableLayout<'a> {
content_inline_size_for_table: None,
baselines: Baselines::default(),
depends_on_block_constraints,
- detailed_layout_info: None,
+ detailed_layout_info: Some(SpecificLayoutInfo::TableWrapper),
};
table_layout