Recursively expand longhands to get all transitive longhands
( property: &str, direct_longhands: &HashMap<String, HashSet<String>>, visited: &mut HashSet<String>, result: &mut Vec<String>, )
| 20 | |
| 21 | /// Recursively expand longhands to get all transitive longhands |
| 22 | fn expand_longhands_recursive( |
| 23 | property: &str, |
| 24 | direct_longhands: &HashMap<String, HashSet<String>>, |
| 25 | visited: &mut HashSet<String>, |
| 26 | result: &mut Vec<String>, |
| 27 | ) { |
| 28 | if let Some(longhands) = direct_longhands.get(property) { |
| 29 | for longhand in longhands { |
| 30 | if visited.insert(longhand.clone()) { |
| 31 | result.push(longhand.clone()); |
| 32 | expand_longhands_recursive(longhand, direct_longhands, visited, result); |
| 33 | } |
| 34 | } |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | /// Compute expanded (transitive) longhands for all properties |
| 39 | fn compute_all_expanded_longhands(shorthands: &HashMap<String, HashSet<String>>) -> HashMap<String, Vec<String>> { |
no test coverage detected