MCPcopy Create free account
hub / github.com/d0iasm/saba / parse_stylesheet

Method parse_stylesheet

core/src/renderer/css/cssom.rs:418–429  ·  view source on GitHub ↗

https://www.w3.org/TR/css-syntax-3/#parse-stylesheet

(&mut self)

Source from the content-addressed store, hash-verified

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)]

Callers 7

create_frameMethod · 0.80
create_layout_viewFunction · 0.80
test_emptyFunction · 0.80
test_one_ruleFunction · 0.80
test_id_selectorFunction · 0.80
test_class_selectorFunction · 0.80
test_multiple_rulesFunction · 0.80

Calls 2

set_rulesMethod · 0.80
consume_list_of_rulesMethod · 0.80

Tested by 5

test_emptyFunction · 0.64
test_one_ruleFunction · 0.64
test_id_selectorFunction · 0.64
test_class_selectorFunction · 0.64
test_multiple_rulesFunction · 0.64