pub struct PropertyDeclarationBlock {
    declarations: Vec<PropertyDeclaration>,
    declarations_importance: SmallBitVec,
    longhands: LonghandIdSet,
}
Expand description

Overridden declarations are skipped.

Fields

declarations: Vec<PropertyDeclaration>

The group of declarations, along with their importance.

Only deduplicated declarations appear here.

declarations_importance: SmallBitVec

The “important” flag for each declaration in declarations.

longhands: LonghandIdSet

Implementations

Returns the number of declarations in the block.

Create an empty block

Create a block with a single declaration

The declarations in this block

The important flags for declarations in this block

Iterate over (PropertyDeclaration, Importance) pairs

Iterate over PropertyDeclaration for Importance::Normal

Return an iterator of (AnimatableLonghand, AnimationValue).

Returns whether this block contains any declaration with !important.

This is based on the declarations_importance bit-vector, which should be maintained whenever declarations is changed.

Returns whether this block contains any declaration without !important.

This is based on the declarations_importance bit-vector, which should be maintained whenever declarations is changed.

Returns whether this block contains a declaration of a given longhand.

Returns whether this block contains any reset longhand.

Returns a LonghandIdSet representing the properties that are changed in this block.

Get a declaration for a given property.

NOTE: This is linear time in the case of custom properties or in the case the longhand is actually in the declaration block.

Tries to serialize a given shorthand from the declarations in this block.

Find the value of the given property in this block and serialize it

https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-getpropertyvalue

Returns whether the property is definitely new for this declaration block. It returns true when the declaration is a non-custom longhand and it doesn’t exist in the block, and returns false otherwise.

Adds or overrides the declaration for a given property in this block.

See the documentation of push to see what impact source has when the property is already there.

Adds or overrides the declaration for a given property in this block.

Returns whether the declaration has changed.

This is only used for parsing and internal use.

Prepares updating this declaration block with the given SourcePropertyDeclaration and importance, and returns whether there is something to update.

Update this declaration block with the given data.

Returns the first declaration that would be removed by removing property.

Removes a given declaration at a given index.

https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-removeproperty

first_declaration needs to be the result of first_declaration_to_remove.

Take a declaration block known to contain a single property and serialize it.

Convert AnimationValueMap to PropertyDeclarationBlock.

Returns true if the declaration block has a CSSWideKeyword for the given property.

Returns a custom properties map which is the result of cascading custom properties in this declaration block along with context’s custom properties.

Returns a custom properties map which is the result of cascading custom properties in this declaration block along with the given custom properties.

Like the method on ToCss, but without the type parameter to avoid accidentally monomorphizing this large function multiple times for different writers.

https://drafts.csswg.org/cssom/#serialize-a-css-declaration-block

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
Clones this value into a form suitable for writing into a SharedMemoryBuilder. Read more

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