mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +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
|
@ -699,7 +699,6 @@ where
|
|||
},
|
||||
Component::AttributeInNoNamespace {
|
||||
ref local_name,
|
||||
ref local_name_lower,
|
||||
ref value,
|
||||
operator,
|
||||
case_sensitivity,
|
||||
|
@ -711,7 +710,7 @@ where
|
|||
let is_html = element.is_html_element_in_html_document();
|
||||
element.attr_matches(
|
||||
&NamespaceConstraint::Specific(&::parser::namespace_empty_string::<E::Impl>()),
|
||||
select_name(is_html, local_name, local_name_lower),
|
||||
local_name,
|
||||
&AttrSelectorOperation::WithValue {
|
||||
operator: operator,
|
||||
case_sensitivity: case_sensitivity.to_unconditional(is_html),
|
||||
|
@ -724,8 +723,16 @@ where
|
|||
return false;
|
||||
}
|
||||
let is_html = element.is_html_element_in_html_document();
|
||||
let empty_string;
|
||||
let namespace = match attr_sel.namespace() {
|
||||
Some(ns) => ns,
|
||||
None => {
|
||||
empty_string = ::parser::namespace_empty_string::<E::Impl>();
|
||||
NamespaceConstraint::Specific(&empty_string)
|
||||
}
|
||||
};
|
||||
element.attr_matches(
|
||||
&attr_sel.namespace(),
|
||||
&namespace,
|
||||
select_name(is_html, &attr_sel.local_name, &attr_sel.local_name_lower),
|
||||
&match attr_sel.operation {
|
||||
ParsedAttrSelectorOperation::Exists => AttrSelectorOperation::Exists,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue