mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
layout: Move text decoration propagation to stacking context tree construction (#37069)
Text decorations have a special kind of propagation. Instead of propating these during box tree construction, move propagation to stacking context tree construction. This will allow for using a very easy type of incremental layout when text decorations change. For instance, when a link changes color during hovering over it, we can skip all of box and fragment tree construction. In addition, propagation works a bit better now and color and style properly move down from their originating `Fragment`s. This introduces three new failures, because now we are drawing the text-decoration with the correct color in more places, which exposes an issue we have with text-decorations not being drawn in relation to the baseline (taking into account `vertical-align`). Testing: There are tests for these changes. Fixes #31736. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
cebb1619ae
commit
9781f1241a
23 changed files with 152 additions and 142 deletions
|
@ -81,12 +81,7 @@ impl Table {
|
|||
contents: NonReplacedContents,
|
||||
propagated_data: PropagatedBoxTreeData,
|
||||
) -> Self {
|
||||
let mut traversal = TableBuilderTraversal::new(
|
||||
context,
|
||||
info,
|
||||
grid_style,
|
||||
propagated_data.union(&info.style),
|
||||
);
|
||||
let mut traversal = TableBuilderTraversal::new(context, info, grid_style, propagated_data);
|
||||
contents.traverse(context, info, &mut traversal);
|
||||
traversal.finish()
|
||||
}
|
||||
|
@ -771,9 +766,6 @@ impl<'dom> TraversalHandler<'dom> for TableBuilderTraversal<'_, 'dom> {
|
|||
});
|
||||
self.builder.table.row_groups.push(row_group.clone());
|
||||
|
||||
let previous_propagated_data = self.current_propagated_data;
|
||||
self.current_propagated_data = self.current_propagated_data.union(&info.style);
|
||||
|
||||
let new_row_group_index = self.builder.table.row_groups.len() - 1;
|
||||
self.current_row_group_index = Some(new_row_group_index);
|
||||
|
||||
|
@ -785,7 +777,6 @@ impl<'dom> TraversalHandler<'dom> for TableBuilderTraversal<'_, 'dom> {
|
|||
self.finish_anonymous_row_if_needed();
|
||||
|
||||
self.current_row_group_index = None;
|
||||
self.current_propagated_data = previous_propagated_data;
|
||||
self.builder.incoming_rowspans.clear();
|
||||
|
||||
box_slot.set(LayoutBox::TableLevelBox(TableLevelBox::TrackGroup(
|
||||
|
@ -936,7 +927,7 @@ impl<'style, 'builder, 'dom, 'a> TableRowBuilder<'style, 'builder, 'dom, 'a> {
|
|||
table_traversal,
|
||||
info,
|
||||
current_anonymous_cell_content: Vec::new(),
|
||||
propagated_data: propagated_data.union(&info.style),
|
||||
propagated_data,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue