Skip to main content

style_tree_with_ancestors_vars

Function style_tree_with_ancestors_vars 

Source
pub(crate) fn style_tree_with_ancestors_vars<'a>(
    root: &'a Node,
    stylesheet: &StyleSheet,
    rule_index: Option<&RuleIndex>,
    ancestors_stack: &mut Vec<AncestorContext<'a>>,
    sibling_index: Option<usize>,
    sibling_count: Option<usize>,
    parent_vars: &Rc<BTreeMap<String, String>>,
    parent_inherited: &Rc<BTreeMap<String, String>>,
    counters_in: &BTreeMap<String, i64>,
) -> (StyledNode<'a>, BTreeMap<String, i64>, BTreeSet<String>)
Expand description

counter-reset/counter-increment(CSS カウンタ)は文書順(深さ優先)で全カウンタを フラット共有する簡略化実装のため、counters_in/戻り値で状態を兄弟間・親子間に 連鎖させる必要がある(.map() では各要素が独立してしまうため使えない)。