mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
style: Remove the never_matches field from attr selectors
It's an extra branch which in practice we almost never take, plus extra checks during parsing. Differential Revision: https://phabricator.services.mozilla.com/D180529
This commit is contained in:
parent
54a783db17
commit
3da2db1c53
5 changed files with 28 additions and 57 deletions
|
@ -736,25 +736,18 @@ where
|
|||
ref value,
|
||||
operator,
|
||||
case_sensitivity,
|
||||
never_matches,
|
||||
} => {
|
||||
if never_matches {
|
||||
return false;
|
||||
}
|
||||
element.attr_matches(
|
||||
&NamespaceConstraint::Specific(&crate::parser::namespace_empty_string::<E::Impl>()),
|
||||
local_name,
|
||||
&AttrSelectorOperation::WithValue {
|
||||
operator,
|
||||
case_sensitivity: to_unconditional_case_sensitivity(case_sensitivity, element),
|
||||
expected_value: value,
|
||||
value,
|
||||
},
|
||||
)
|
||||
},
|
||||
Component::AttributeOther(ref attr_sel) => {
|
||||
if attr_sel.never_matches {
|
||||
return false;
|
||||
}
|
||||
let empty_string;
|
||||
let namespace = match attr_sel.namespace() {
|
||||
Some(ns) => ns,
|
||||
|
@ -771,14 +764,14 @@ where
|
|||
ParsedAttrSelectorOperation::WithValue {
|
||||
operator,
|
||||
case_sensitivity,
|
||||
ref expected_value,
|
||||
ref value,
|
||||
} => AttrSelectorOperation::WithValue {
|
||||
operator,
|
||||
case_sensitivity: to_unconditional_case_sensitivity(
|
||||
case_sensitivity,
|
||||
element,
|
||||
),
|
||||
expected_value,
|
||||
value,
|
||||
},
|
||||
},
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue