aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/style/lib.rs')
-rw-r--r--components/style/lib.rs20
1 files changed, 19 insertions, 1 deletions
diff --git a/components/style/lib.rs b/components/style/lib.rs
index 0cde26b37f0..192ee3f242f 100644
--- a/components/style/lib.rs
+++ b/components/style/lib.rs
@@ -91,6 +91,7 @@ extern crate unicode_segmentation;
mod macros;
pub mod animation;
+pub mod applicable_declarations;
#[allow(missing_docs)] // TODO.
#[cfg(feature = "servo")] pub mod attr;
pub mod bezier;
@@ -116,7 +117,6 @@ pub mod matching;
pub mod media_queries;
pub mod parallel;
pub mod parser;
-pub mod restyle_hints;
pub mod rule_tree;
pub mod scoped_tls;
pub mod selector_map;
@@ -216,3 +216,21 @@ pub fn serialize_comma_separated_list<W, T>(dest: &mut W,
Ok(())
}
+
+#[cfg(feature = "gecko")] use gecko_string_cache::WeakAtom;
+#[cfg(feature = "servo")] use servo_atoms::Atom as WeakAtom;
+
+/// Extension methods for selectors::attr::CaseSensitivity
+pub trait CaseSensitivityExt {
+ /// Return whether two atoms compare equal according to this case sensitivity.
+ fn eq_atom(self, a: &WeakAtom, b: &WeakAtom) -> bool;
+}
+
+impl CaseSensitivityExt for selectors::attr::CaseSensitivity {
+ fn eq_atom(self, a: &WeakAtom, b: &WeakAtom) -> bool {
+ match self {
+ selectors::attr::CaseSensitivity::CaseSensitive => a == b,
+ selectors::attr::CaseSensitivity::AsciiCaseInsensitive => a.eq_ignore_ascii_case(b),
+ }
+ }
+}