Struct style::properties::declaration_block::PropertyDeclarationBlock
[−]
[src]
pub struct PropertyDeclarationBlock { /* fields omitted */ }
Overridden declarations are skipped.
Methods
impl PropertyDeclarationBlock
[src]
pub fn len(&self) -> usize
[src]
Returns the number of declarations in the block.
pub fn new() -> Self
[src]
Create an empty block
pub fn with_one(
declaration: PropertyDeclaration,
importance: Importance
) -> Self
[src]
declaration: PropertyDeclaration,
importance: Importance
) -> Self
Create a block with a single declaration
pub fn declarations(&self) -> &[PropertyDeclaration]
[src]
The declarations in this block
pub fn declarations_importance(&self) -> &SmallBitVec
[src]
The important
flags for declarations in this block
ⓘImportant traits for DeclarationImportanceIterator<'a>pub fn declaration_importance_iter(&self) -> DeclarationImportanceIterator
[src]
Iterate over (PropertyDeclaration, Importance)
pairs
ⓘImportant traits for NormalDeclarationIterator<'a>pub fn normal_declaration_iter(&self) -> NormalDeclarationIterator
[src]
Iterate over PropertyDeclaration
for Importance::Normal
ⓘImportant traits for AnimationValueIterator<'a, 'cx, 'cx_a>pub fn to_animation_value_iter<'a, 'cx, 'cx_a: 'cx>(
&'a self,
context: &'cx mut Context<'cx_a>,
default_values: &'a ComputedValues,
extra_custom_properties: Option<&'a Arc<CustomPropertiesMap>>
) -> AnimationValueIterator<'a, 'cx, 'cx_a>
[src]
&'a self,
context: &'cx mut Context<'cx_a>,
default_values: &'a ComputedValues,
extra_custom_properties: Option<&'a Arc<CustomPropertiesMap>>
) -> AnimationValueIterator<'a, 'cx, 'cx_a>
Return an iterator of (AnimatableLonghand, AnimationValue).
pub fn any_important(&self) -> bool
[src]
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.
pub fn any_normal(&self) -> bool
[src]
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.
pub fn contains(&self, id: LonghandId) -> bool
[src]
Returns whether this block contains a declaration of a given longhand.
pub fn get(
&self,
property: PropertyDeclarationId
) -> Option<(&PropertyDeclaration, Importance)>
[src]
&self,
property: PropertyDeclarationId
) -> Option<(&PropertyDeclaration, Importance)>
Get a declaration for a given property.
NOTE: This is linear time.
pub fn property_value_to_css<W>(
&self,
property: &PropertyId,
dest: &mut W
) -> Result where
W: Write,
[src]
&self,
property: &PropertyId,
dest: &mut W
) -> Result where
W: Write,
Find the value of the given property in this block and serialize it
https://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-getpropertyvalue
pub fn property_priority(&self, property: &PropertyId) -> Importance
[src]
pub fn extend(
&mut self,
drain: SourcePropertyDeclarationDrain,
importance: Importance,
source: DeclarationSource
) -> bool
[src]
&mut self,
drain: SourcePropertyDeclarationDrain,
importance: Importance,
source: DeclarationSource
) -> bool
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.
pub fn push(
&mut self,
declaration: PropertyDeclaration,
importance: Importance,
source: DeclarationSource
) -> bool
[src]
&mut self,
declaration: PropertyDeclaration,
importance: Importance,
source: DeclarationSource
) -> bool
Adds or overrides the declaration for a given property in this block.
Depending on the value of source
, this has a different behavior in the
presence of another declaration with the same ID in the declaration
block.
For
DeclarationSource::Parsing
, this will not override a declaration with more importance, and will ensure that, if inserted, it's inserted at the end of the declaration block.For
DeclarationSource::CssOm
, this will override importance and will preserve the original position on the block.
pub fn set_importance(
&mut self,
property: &PropertyId,
new_importance: Importance
) -> bool
[src]
&mut self,
property: &PropertyId,
new_importance: Importance
) -> bool
Set the declaration importance for a given property, if found.
Returns whether any declaration was updated.
pub fn remove_property(&mut self, property: &PropertyId) -> bool
[src]
https://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-removeproperty
Returns whether any declaration was actually removed.
pub fn single_value_to_css<W>(
&self,
property: &PropertyId,
dest: &mut W,
computed_values: Option<&ComputedValues>,
custom_properties_block: Option<&PropertyDeclarationBlock>
) -> Result where
W: Write,
[src]
&self,
property: &PropertyId,
dest: &mut W,
computed_values: Option<&ComputedValues>,
custom_properties_block: Option<&PropertyDeclarationBlock>
) -> Result where
W: Write,
Take a declaration block known to contain a single property and serialize it.
pub fn cascade_custom_properties_with_context(
&self,
context: &Context
) -> Option<Arc<CustomPropertiesMap>>
[src]
&self,
context: &Context
) -> Option<Arc<CustomPropertiesMap>>
Returns a custom properties map which is the result of cascading custom properties in this declaration block along with context's custom properties.
pub fn cascade_custom_properties(
&self,
inherited_custom_properties: Option<&Arc<CustomPropertiesMap>>
) -> Option<Arc<CustomPropertiesMap>>
[src]
&self,
inherited_custom_properties: Option<&Arc<CustomPropertiesMap>>
) -> Option<Arc<CustomPropertiesMap>>
Returns a custom properties map which is the result of cascading custom properties in this declaration block along with the given custom properties.
Trait Implementations
impl Clone for PropertyDeclarationBlock
[src]
fn clone(&self) -> PropertyDeclarationBlock
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for PropertyDeclarationBlock
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more