Skip to main content

Module cascade

Module cascade 

Source
Expand description

The main cascading algorithm of the style system.

Structsยง

Cascade ๐Ÿ”’
Declaration ๐Ÿ”’
DeclarationIterator ๐Ÿ”’
Declarations ๐Ÿ”’
The set of property declarations from our rules.
KeyframeCustomPropertiesBuilder
Resolves the custom properties for a single @keyframes keyframe, layered on top of the base styleโ€™s already-computed custom properties.
PrioritaryDeclarationPosition ๐Ÿ”’
โ€œPrioritaryโ€ properties are properties that other properties depend on in one way or another.
RevertedSet ๐Ÿ”’
SeenSet ๐Ÿ”’
SeenSubstitutionFunctions ๐Ÿ”’

Enumsยง

CascadeMode
Whether weโ€™re cascading for visited or unvisited styles.
FirstLineReparenting
Whether weโ€™re resolving a style with the purposes of reparenting for ::first-line.

Functionsยง

apply_declarations
NOTE: This function expects the declaration with more priority to appear first.
cascade
Performs the CSS cascade, computing new styles for an element from its parent style.
cascade_rules ๐Ÿ”’
find_non_custom_references ๐Ÿ”’
Only registered (typed) properties emit a non-custom edge, from their own value.
is_base_appearance ๐Ÿ”’
iter_declarations ๐Ÿ”’
substitute_all ๐Ÿ”’
tweak_when_ignoring_colors ๐Ÿ”’

Type Aliasesยง

DeclarationIndex ๐Ÿ”’
We track the index only for prioritary properties. For other properties we can just iterate.
DeclarationsToApplyUnlessOverriden ๐Ÿ”’
For ignored colors mode, we sometimes want to do something equivalent to โ€œrevert-or-initialโ€, where we revert for a given origin, but then apply a given initial value if nothing in other origins did override it.