Visit Color nodes to decorate with the swatch
(&mut self, color: &Color)
| 138 | |
| 139 | // Visit Color nodes to decorate with the swatch |
| 140 | fn visit_color(&mut self, color: &Color) { |
| 141 | let metadata = color.metadata(); |
| 142 | let modifier = SemanticModifier::from(&metadata); |
| 143 | if let Some(bg) = color.to_chromashift() { |
| 144 | let swatch = SemanticDecoration::BackgroundColor(bg.into()); |
| 145 | self.insert_with_decoration(color.to_span(), SemanticKind::StyleValueColor, modifier, swatch); |
| 146 | } else { |
| 147 | self.insert(color.to_span(), SemanticKind::StyleValueColor, modifier); |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | // Special case: CSSInt doesn't implement QueryableNode (has visit(skip)) |
| 152 | fn visit_css_int(&mut self, int: &CSSInt) { |
nothing calls this directly
no test coverage detected