MCPcopy Create free account
hub / github.com/csskit/csskit / compute_all_expanded_longhands

Function compute_all_expanded_longhands

crates/csskit_spec_generator/src/codegen.rs:39–51  ·  view source on GitHub ↗

Compute expanded (transitive) longhands for all properties

(shorthands: &HashMap<String, HashSet<String>>)

Source from the content-addressed store, hash-verified

37
38/// Compute expanded (transitive) longhands for all properties
39fn compute_all_expanded_longhands(shorthands: &HashMap<String, HashSet<String>>) -> HashMap<String, Vec<String>> {
40 let mut expanded_longhands: HashMap<String, Vec<String>> = HashMap::new();
41 for prop_name in shorthands.keys() {
42 let mut visited = HashSet::new();
43 let mut result = Vec::new();
44 expand_longhands_recursive(prop_name, shorthands, &mut visited, &mut result);
45 if !result.is_empty() {
46 result.sort();
47 expanded_longhands.insert(prop_name.clone(), result);
48 }
49 }
50 expanded_longhands
51}
52
53/// Generate Rust code for a CSS spec module
54pub fn generate_spec_module(

Callers 1

generate_spec_moduleFunction · 0.85

Calls 4

cloneMethod · 0.80
is_emptyMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected