https://www.w3.org/TR/css-syntax-3/#parse-stylesheet
(&mut self)
| 416 | |
| 417 | /// https://www.w3.org/TR/css-syntax-3/#parse-stylesheet |
| 418 | pub fn parse_stylesheet(&mut self) -> StyleSheet { |
| 419 | // 1. Create a new stylesheet. |
| 420 | let mut sheet = StyleSheet::new(); |
| 421 | |
| 422 | // 2. Consume a list of rules from the stream of tokens, with the top-level flag set. Let |
| 423 | // the return value be rules. |
| 424 | // 3. Assign rules to the stylesheet’s value. |
| 425 | sheet.set_rules(self.consume_list_of_rules()); |
| 426 | |
| 427 | // 4. Return the stylesheet. |
| 428 | sheet |
| 429 | } |
| 430 | } |
| 431 | |
| 432 | #[cfg(test)] |