mirror of
https://github.com/servo/servo.git
synced 2025-07-23 23:33:43 +01:00
layout: Store shared styles for table backgrounds in SharedBackgroundStyle
(#36893)
Table cells share background styles with their track and track group boxes. When a track and track group style is repaired, this new data structure will allow reparing the style of the cell `Fragment`s without having to lay the table out again or walk through `Fragment`s and individually repair their background styles. Testing: This doesn't change behavior and is thus tested by existing WPT tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
68a76baea3
commit
348eede37b
5 changed files with 38 additions and 10 deletions
|
@ -17,6 +17,7 @@ use style::properties::ComputedValues;
|
|||
use style::values::specified::box_::DisplayOutside;
|
||||
|
||||
use super::{BaseFragment, BaseFragmentInfo, CollapsedBlockMargins, Fragment};
|
||||
use crate::ArcRefCell;
|
||||
use crate::display_list::ToWebRender;
|
||||
use crate::formatting_contexts::Baselines;
|
||||
use crate::geom::{
|
||||
|
@ -40,10 +41,14 @@ pub(crate) enum BackgroundMode {
|
|||
Normal,
|
||||
}
|
||||
|
||||
#[derive(Debug, MallocSizeOf)]
|
||||
pub(crate) struct BackgroundStyle(#[conditional_malloc_size_of] pub ServoArc<ComputedValues>);
|
||||
|
||||
pub(crate) type SharedBackgroundStyle = ArcRefCell<BackgroundStyle>;
|
||||
|
||||
#[derive(MallocSizeOf)]
|
||||
pub(crate) struct ExtraBackground {
|
||||
#[conditional_malloc_size_of]
|
||||
pub style: ServoArc<ComputedValues>,
|
||||
pub style: SharedBackgroundStyle,
|
||||
pub rect: PhysicalRect<Au>,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue