pub struct ComputedValues {
    inner: ComputedValuesInner,
    pseudo: Option<PseudoElement>,
}
Expand description

The struct that Servo uses to represent computed values.

This struct contains an immutable atomically-reference-counted pointer to every kind of style struct.

When needed, the structs may be copied in order to get mutated.

Fields

inner: ComputedValuesInner

The actual computed values

In Gecko the outer ComputedValues is actually a ComputedStyle, whereas ComputedValuesInner is the core set of computed values.

We maintain this distinction in servo to reduce the amount of special casing.

pseudo: Option<PseudoElement>

The pseudo-element that we’re using.

Implementations

Returns the pseudo-element that this style represents.

Returns true if this is the style for a pseudo-element.

Returns whether this style’s display value is equal to contents.

Gets a reference to the rule node. Panic if no rule node exists.

Returns the visited style, if any.

Returns the visited rules, if applicable.

Gets a reference to the custom properties map (if one exists).

Returns whether we have the same custom properties as another style.

This should effectively be just:

self.custom_properties() == other.custom_properties()

But that’s not really the case because IndexMap equality doesn’t consider ordering, which we have to account for. Also, for the same reason, IndexMap equality comparisons are slower than needed.

See https://github.com/bluss/indexmap/issues/153

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Gets the computed value of a given property.

Writes the value of the given longhand as a string in dest.

Note that the value will usually be the computed value, except for colors, where it’s resolved.

Resolves the currentColor keyword.

Any color value from computed values (except for the ‘color’ property itself) should go through this method.

Usage example: let top_color = style.resolve_color(style.get_border().clone_border_top_color());

Create a TransitionPropertyIterator for this styles transition properties.

Create a new refcounted ComputedValues

Get the initial computed values.

Serializes the computed value of this property as a string.

Methods from Deref<Target = ComputedValuesInner>

Clone the Background struct.

Get a immutable reference to the Background struct.

Gets an immutable reference to the refcounted value that wraps Background.

Get a mutable reference to the Background struct.

Clone the Border struct.

Get a immutable reference to the Border struct.

Gets an immutable reference to the refcounted value that wraps Border.

Get a mutable reference to the Border struct.

Clone the Box struct.

Get a immutable reference to the Box struct.

Gets an immutable reference to the refcounted value that wraps Box.

Get a mutable reference to the Box struct.

Clone the Column struct.

Get a immutable reference to the Column struct.

Gets an immutable reference to the refcounted value that wraps Column.

Get a mutable reference to the Column struct.

Clone the Counters struct.

Get a immutable reference to the Counters struct.

Gets an immutable reference to the refcounted value that wraps Counters.

Get a mutable reference to the Counters struct.

Clone the Effects struct.

Get a immutable reference to the Effects struct.

Gets an immutable reference to the refcounted value that wraps Effects.

Get a mutable reference to the Effects struct.

Clone the Font struct.

Get a immutable reference to the Font struct.

Gets an immutable reference to the refcounted value that wraps Font.

Get a mutable reference to the Font struct.

Clone the InheritedBox struct.

Get a immutable reference to the InheritedBox struct.

Gets an immutable reference to the refcounted value that wraps InheritedBox.

Get a mutable reference to the InheritedBox struct.

Clone the InheritedTable struct.

Get a immutable reference to the InheritedTable struct.

Gets an immutable reference to the refcounted value that wraps InheritedTable.

Get a mutable reference to the InheritedTable struct.

Clone the InheritedText struct.

Get a immutable reference to the InheritedText struct.

Gets an immutable reference to the refcounted value that wraps InheritedText.

Get a mutable reference to the InheritedText struct.

Clone the InheritedUI struct.

Get a immutable reference to the InheritedUI struct.

Gets an immutable reference to the refcounted value that wraps InheritedUI.

Get a mutable reference to the InheritedUI struct.

Clone the List struct.

Get a immutable reference to the List struct.

Gets an immutable reference to the refcounted value that wraps List.

Get a mutable reference to the List struct.

Clone the Margin struct.

Get a immutable reference to the Margin struct.

Gets an immutable reference to the refcounted value that wraps Margin.

Get a mutable reference to the Margin struct.

Clone the Outline struct.

Get a immutable reference to the Outline struct.

Gets an immutable reference to the refcounted value that wraps Outline.

Get a mutable reference to the Outline struct.

Clone the Padding struct.

Get a immutable reference to the Padding struct.

Gets an immutable reference to the refcounted value that wraps Padding.

Get a mutable reference to the Padding struct.

Clone the Position struct.

Get a immutable reference to the Position struct.

Gets an immutable reference to the refcounted value that wraps Position.

Get a mutable reference to the Position struct.

Clone the Table struct.

Get a immutable reference to the Table struct.

Gets an immutable reference to the refcounted value that wraps Table.

Get a mutable reference to the Table struct.

Clone the Text struct.

Get a immutable reference to the Text struct.

Gets an immutable reference to the refcounted value that wraps Text.

Get a mutable reference to the Text struct.

Gets a reference to the rule node. Panic if no rule node exists.

Returns whether the “content” property for the given style is completely ineffective, and would yield an empty ::before or ::after pseudo-element.

Whether the current style or any of its ancestors is multicolumn.

Whether the current style is multicolumn.

Get the logical computed inline size.

Get the logical computed block size.

Get the logical computed min inline size.

Get the logical computed min block size.

Get the logical computed max inline size.

Get the logical computed max block size.

Get the logical computed padding for this writing mode.

Get the logical border width

Gets the logical computed border widths for this style.

Gets the logical computed margin from this style.

Gets the logical position from this style.

Return true if the effects force the transform style to be Flat

Whether given this transform value, the compositor would require a layer.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Convert
Convert
The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more