mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Shrink selectors::Component to 24 bytes.
This saves about 37 KiB of memory across the UA style sheets. Bug: 1475197 Reviewed-by: emilio
This commit is contained in:
parent
b05ace3e4a
commit
62419adaaa
12 changed files with 96 additions and 50 deletions
|
@ -8,7 +8,7 @@ pub enum PseudoElement {
|
|||
% for pseudo in PSEUDOS:
|
||||
/// ${pseudo.value}
|
||||
% if pseudo.is_tree_pseudo_element():
|
||||
${pseudo.capitalized()}(Box<[Atom]>),
|
||||
${pseudo.capitalized()}(ThinBoxedSlice<Atom>),
|
||||
% else:
|
||||
${pseudo.capitalized()},
|
||||
% endif
|
||||
|
@ -209,7 +209,7 @@ impl PseudoElement {
|
|||
% for pseudo in PSEUDOS:
|
||||
% if pseudo.is_tree_pseudo_element():
|
||||
if atom == &atom!("${pseudo.value}") {
|
||||
return Some(PseudoElement::${pseudo.capitalized()}(args));
|
||||
return Some(PseudoElement::${pseudo.capitalized()}(args.into()));
|
||||
}
|
||||
% endif
|
||||
% endfor
|
||||
|
@ -256,7 +256,7 @@ impl PseudoElement {
|
|||
let tree_part = &name[10..];
|
||||
% for pseudo in TREE_PSEUDOS:
|
||||
if tree_part.eq_ignore_ascii_case("${pseudo.value[11:]}") {
|
||||
return Some(${pseudo_element_variant(pseudo, "args")});
|
||||
return Some(${pseudo_element_variant(pseudo, "args.into()")});
|
||||
}
|
||||
% endfor
|
||||
None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue