Type Alias SharedStyle

Source
pub(crate) type SharedStyle = ArcRefCell<Arc<ComputedValues>>;
Expand description

At times, a style is “owned” by more than one layout object. For example, text fragments need a handle on their parent inline box’s style. In order to make incremental layout easier to implement, another layer of shared ownership is added via SharedStyle. This allows updating the style in originating layout object and having all “depdendent” objects update automatically.

Note that this is not a cost-free data structure, so should only be used when necessary.

Aliased Type§

pub(crate) struct SharedStyle {
    value: Arc<AtomicRefCell<Arc<ComputedValues>>>,
}

Fields§

§value: Arc<AtomicRefCell<Arc<ComputedValues>>>