diff options
author | Oriol Brufau <obrufau@igalia.com> | 2023-05-17 00:12:28 +0200 |
---|---|---|
committer | Oriol Brufau <obrufau@igalia.com> | 2023-05-17 02:12:21 +0200 |
commit | b5dcb5c9610643cb534b1abdae885a792291659d (patch) | |
tree | 13851bb6f724510169617e40c99adc110e26c3c0 | |
parent | e23a8bf0ad5fcfc23395b74dccb571fe360ee0bb (diff) | |
download | servo-b5dcb5c9610643cb534b1abdae885a792291659d.tar.gz servo-b5dcb5c9610643cb534b1abdae885a792291659d.zip |
Further changes required by Servo
-rw-r--r-- | components/selectors/parser.rs | 14 | ||||
-rw-r--r-- | components/style/bloom.rs | 2 | ||||
-rw-r--r-- | components/style/dom.rs | 1 |
3 files changed, 14 insertions, 3 deletions
diff --git a/components/selectors/parser.rs b/components/selectors/parser.rs index 73c1239035c..3c728116e97 100644 --- a/components/selectors/parser.rs +++ b/components/selectors/parser.rs @@ -488,12 +488,18 @@ where Component::Class(ref class) if quirks_mode != QuirksMode::Quirks => { class.precomputed_hash() }, - Component::AttributeInNoNamespace { ref local_name, .. } if Impl::should_collect_attr_hash(local_name) => { + Component::AttributeInNoNamespace { ref local_name, .. } + if Impl::should_collect_attr_hash(local_name) => + { // AttributeInNoNamespace is only used when local_name == // local_name_lower. local_name.precomputed_hash() }, - Component::AttributeInNoNamespaceExists { ref local_name, ref local_name_lower, .. } => { + Component::AttributeInNoNamespaceExists { + ref local_name, + ref local_name_lower, + .. + } => { // Only insert the local-name into the filter if it's all // lowercase. Otherwise we would need to test both hashes, and // our data structures aren't really set up for that. @@ -503,7 +509,9 @@ where local_name.precomputed_hash() }, Component::AttributeOther(ref selector) => { - if selector.local_name != selector.local_name_lower || !Impl::should_collect_attr_hash(&selector.local_name) { + if selector.local_name != selector.local_name_lower || + !Impl::should_collect_attr_hash(&selector.local_name) + { continue; } selector.local_name.precomputed_hash() diff --git a/components/style/bloom.rs b/components/style/bloom.rs index d75abaa4f93..1840c780506 100644 --- a/components/style/bloom.rs +++ b/components/style/bloom.rs @@ -107,6 +107,7 @@ impl<E: TElement> PushedElement<E> { /// We do this for attributes that are very common but not commonly used in /// selectors. #[inline] +#[cfg(feature = "gecko")] pub fn is_attr_name_excluded_from_filter(atom: &crate::Atom) -> bool { *atom == atom!("class") || *atom == atom!("id") || *atom == atom!("style") } @@ -125,6 +126,7 @@ where element.each_class(|class| f(class.get_hash())); + #[cfg(feature = "gecko")] if static_prefs::pref!("layout.css.bloom-filter-attribute-names.enabled") { element.each_attr_name(|name| { if !is_attr_name_excluded_from_filter(name) { diff --git a/components/style/dom.rs b/components/style/dom.rs index f16e45ce681..3d088956289 100644 --- a/components/style/dom.rs +++ b/components/style/dom.rs @@ -520,6 +520,7 @@ pub trait TElement: } /// Internal iterator for the attribute names of this element. + #[cfg(feature = "gecko")] fn each_attr_name<F>(&self, callback: F) where F: FnMut(&AtomIdent); |