mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
layout: Fix painting order of collapsed table borders (#35219)
In #35075 I painted them in front of the decorations (backgrounds and borders) of any block-level box in the same stacking context. I did that because other browsers paint them in front of the decorations of the descendants of the table, but my approach also painted them in front of decorations of following siblings of the table, which was wrong. This patch makes it so that collapsed table orders are painted in the same step as decorations. However, tables defer painting their collapsed borders after the decorations of their descendants. This matches Blink and WebKit, and brings us closer to Gecko (which is slightly different in some corner cases). Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
2030b7affd
commit
7301af8468
16 changed files with 461 additions and 35 deletions
|
@ -245,6 +245,7 @@ impl Fragment {
|
|||
containing_block: &PhysicalRect<Au>,
|
||||
section: StackingContextSection,
|
||||
is_hit_test_for_scrollable_overflow: bool,
|
||||
is_collapsed_table_borders: bool,
|
||||
) {
|
||||
match self {
|
||||
Fragment::Box(box_fragment) | Fragment::Float(box_fragment) => {
|
||||
|
@ -254,6 +255,7 @@ impl Fragment {
|
|||
box_fragment,
|
||||
containing_block,
|
||||
is_hit_test_for_scrollable_overflow,
|
||||
is_collapsed_table_borders,
|
||||
)
|
||||
.build(builder, section),
|
||||
Visibility::Hidden => (),
|
||||
|
@ -515,6 +517,7 @@ struct BuilderForBoxFragment<'a> {
|
|||
padding_edge_clip_chain_id: RefCell<Option<ClipChainId>>,
|
||||
content_edge_clip_chain_id: RefCell<Option<ClipChainId>>,
|
||||
is_hit_test_for_scrollable_overflow: bool,
|
||||
is_collapsed_table_borders: bool,
|
||||
}
|
||||
|
||||
impl<'a> BuilderForBoxFragment<'a> {
|
||||
|
@ -522,6 +525,7 @@ impl<'a> BuilderForBoxFragment<'a> {
|
|||
fragment: &'a BoxFragment,
|
||||
containing_block: &'a PhysicalRect<Au>,
|
||||
is_hit_test_for_scrollable_overflow: bool,
|
||||
is_collapsed_table_borders: bool,
|
||||
) -> Self {
|
||||
let border_rect = fragment
|
||||
.border_rect()
|
||||
|
@ -562,6 +566,7 @@ impl<'a> BuilderForBoxFragment<'a> {
|
|||
padding_edge_clip_chain_id: RefCell::new(None),
|
||||
content_edge_clip_chain_id: RefCell::new(None),
|
||||
is_hit_test_for_scrollable_overflow,
|
||||
is_collapsed_table_borders,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -652,16 +657,14 @@ impl<'a> BuilderForBoxFragment<'a> {
|
|||
return;
|
||||
}
|
||||
|
||||
match section {
|
||||
StackingContextSection::CollapsedTableBorders => {
|
||||
self.build_collapsed_table_borders(builder);
|
||||
return;
|
||||
},
|
||||
StackingContextSection::Outline => {
|
||||
self.build_outline(builder);
|
||||
return;
|
||||
},
|
||||
_ => {},
|
||||
if self.is_collapsed_table_borders {
|
||||
self.build_collapsed_table_borders(builder);
|
||||
return;
|
||||
}
|
||||
|
||||
if section == StackingContextSection::Outline {
|
||||
self.build_outline(builder);
|
||||
return;
|
||||
}
|
||||
|
||||
self.build_hit_test(builder, self.border_rect);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue