diff options
author | Martin Robinson <mrobinson@igalia.com> | 2023-10-19 15:43:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-19 13:43:55 +0000 |
commit | fd31da9102497cfaf5265bbab17df4424a8a1078 (patch) | |
tree | 1433f9c69456146ab4045fdd4a379f9b87185b6f /components/layout/construct.rs | |
parent | 634a5d9cf5cf45eaa284a8b4dfb0e1cdf75e08e6 (diff) | |
download | servo-fd31da9102497cfaf5265bbab17df4424a8a1078.tar.gz servo-fd31da9102497cfaf5265bbab17df4424a8a1078.zip |
Anonymous boxes that wrap inlines should not inherit overflow (#30579)
In legacy layout, anonymous text wrappers were inheriting the `overflow`
and `text-overflow` properties. This results in the creation of extra
clipping for these anonymous wrappers which could clip away floats. We
will likely implement `text-overflow` differently in non-legacy layout.
This change marks all legacy layout pseudo elements as "legacy" and also
adds a new pseudo element for non-legacy layout that does not inherit
`overflow`.
Fixes #30562.
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Diffstat (limited to 'components/layout/construct.rs')
-rw-r--r-- | components/layout/construct.rs | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/components/layout/construct.rs b/components/layout/construct.rs index bf1dcd2059f..ba6407f6bc0 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -805,7 +805,7 @@ where .stylist .style_for_anonymous::<ConcreteThreadSafeLayoutNode::ConcreteElement>( &context.guards, - &PseudoElement::ServoText, + &PseudoElement::ServoLegacyText, &style, ); if node_is_input_or_text_area { @@ -813,7 +813,7 @@ where .stylist .style_for_anonymous::<ConcreteThreadSafeLayoutNode::ConcreteElement>( &context.guards, - &PseudoElement::ServoInputText, + &PseudoElement::ServoLegacyInputText, &style, ) } @@ -1116,7 +1116,7 @@ where .stylist .style_for_anonymous::<ConcreteThreadSafeLayoutNode::ConcreteElement>( &context.guards, - &PseudoElement::ServoText, + &PseudoElement::ServoLegacyText, &style, ), node.restyle_damage(), @@ -1133,7 +1133,7 @@ where .stylist .style_for_anonymous::<ConcreteThreadSafeLayoutNode::ConcreteElement>( &context.guards, - &PseudoElement::ServoText, + &PseudoElement::ServoLegacyText, &style, ); self.create_fragments_for_node_text_content(&mut fragments, node, &text_style) @@ -1176,7 +1176,7 @@ where .stylist .style_for_anonymous::<ConcreteThreadSafeLayoutNode::ConcreteElement>( &context.guards, - &PseudoElement::ServoInlineBlockWrapper, + &PseudoElement::ServoLegacyInlineBlockWrapper, &style, ); let fragment_info = @@ -1227,7 +1227,7 @@ where .stylist .style_for_anonymous::<ConcreteThreadSafeLayoutNode::ConcreteElement>( &style_context.guards, - &PseudoElement::ServoInlineAbsolute, + &PseudoElement::ServoLegacyInlineAbsolute, &style, ); let fragment = Fragment::from_opaque_node_and_style( @@ -1372,7 +1372,7 @@ where .stylist .style_for_anonymous::<ConcreteThreadSafeLayoutNode::ConcreteElement>( &context.guards, - &PseudoElement::ServoTableWrapper, + &PseudoElement::ServoLegacyTableWrapper, &table_style, ); } @@ -2189,7 +2189,7 @@ where ))); let text_style = context.stylist.style_for_anonymous::<E>( &context.guards, - &PseudoElement::ServoText, + &PseudoElement::ServoLegacyText, &node.style, ); @@ -2317,7 +2317,7 @@ impl Legalizer { let mut block_wrapper = Legalizer::create_anonymous_flow::<E, _>( context, parent, - &[PseudoElement::ServoAnonymousBlock], + &[PseudoElement::ServoLegacyAnonymousBlock], SpecificFragmentInfo::Generic, BlockFlow::from_fragment, ); @@ -2378,21 +2378,21 @@ impl Legalizer { FlowClass::TableRow => self.push_new_anonymous_flow::<E, _>( context, parent, - &[PseudoElement::ServoAnonymousTableCell], + &[PseudoElement::ServoLegacyAnonymousTableCell], SpecificFragmentInfo::TableCell, TableCellFlow::from_fragment, ), FlowClass::Table | FlowClass::TableRowGroup => self.push_new_anonymous_flow::<E, _>( context, parent, - &[PseudoElement::ServoAnonymousTableRow], + &[PseudoElement::ServoLegacyAnonymousTableRow], SpecificFragmentInfo::TableRow, TableRowFlow::from_fragment, ), FlowClass::TableWrapper => self.push_new_anonymous_flow::<E, _>( context, parent, - &[PseudoElement::ServoAnonymousTable], + &[PseudoElement::ServoLegacyAnonymousTable], SpecificFragmentInfo::Table, TableFlow::from_fragment, ), @@ -2400,8 +2400,8 @@ impl Legalizer { context, parent, &[ - PseudoElement::ServoTableWrapper, - PseudoElement::ServoAnonymousTableWrapper, + PseudoElement::ServoLegacyTableWrapper, + PseudoElement::ServoLegacyAnonymousTableWrapper, ], SpecificFragmentInfo::TableWrapper, TableWrapperFlow::from_fragment, |