Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shrink selectors::Component, implement attr selector (in)case-sensitivity #16915

Merged
merged 12 commits into from May 19, 2017

Don’t visit attribute selectors that never match.

  • Loading branch information
SimonSapin committed May 18, 2017
commit c968842653533fe54761239ea2dae04369664580
@@ -316,7 +316,6 @@ impl<Impl: SelectorImpl> SelectorMethods for Component<Impl> {
}
}

AttributeInNoNamespace { ref local_name, ref local_name_lower, .. } |
AttributeInNoNamespaceExists { ref local_name, ref local_name_lower } => {
if !visitor.visit_attribute_selector(
&NamespaceConstraint::Specific(&namespace_empty_string::<Impl>()),
@@ -326,7 +325,17 @@ impl<Impl: SelectorImpl> SelectorMethods for Component<Impl> {
return false;
}
}
AttributeOther(ref attr_selector) => {
AttributeInNoNamespace { ref local_name, ref local_name_lower, never_matches, .. }
if !never_matches => {
if !visitor.visit_attribute_selector(
&NamespaceConstraint::Specific(&namespace_empty_string::<Impl>()),
local_name,
local_name_lower,
) {
return false;
}
}
AttributeOther(ref attr_selector) if !attr_selector.never_matches => {
if !visitor.visit_attribute_selector(
&attr_selector.namespace(),
&attr_selector.local_name,
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.