1macro_rules! trivial_to_computed_value {
8 ($name:ty) => {
9 impl $crate::values::computed::ToComputedValue for $name {
10 type ComputedValue = $name;
11
12 fn to_computed_value(&self, _: &$crate::values::computed::Context) -> Self {
13 self.clone()
14 }
15
16 fn from_computed_value(other: &Self) -> Self {
17 other.clone()
18 }
19 }
20 };
21}
22
23macro_rules! try_match_ident_ignore_ascii_case {
29 ($input:expr, $( $match_body:tt )*) => {{
30 let ident = $input.expect_ident()?;
31 ::cssparser::match_ignore_ascii_case! { &ident,
32 $( $match_body )*
33 _ => return Err(ParseError::custom(
34 ::selectors::parser::SelectorParseErrorKind::UnexpectedIdent
35 ))
36 }
37 }}
38}
39
40#[cfg(feature = "servo")]
41macro_rules! local_name {
42 ($s:tt) => {
43 $crate::values::GenericAtomIdent(web_atoms::local_name!($s))
44 };
45}
46
47#[cfg(feature = "servo")]
48macro_rules! ns {
49 () => {
50 $crate::values::GenericAtomIdent(web_atoms::ns!())
51 };
52 ($s:tt) => {
53 $crate::values::GenericAtomIdent(web_atoms::ns!($s))
54 };
55}
56
57#[cfg(feature = "gecko")]
58macro_rules! local_name {
59 ($s:tt) => {
60 $crate::values::AtomIdent(atom!($s))
61 };
62}
63
64macro_rules! size_of_test {
66 ($t: ty, $expected_size: expr) => {
67 #[cfg(target_pointer_width = "64")]
68 const_assert_eq!(std::mem::size_of::<$t>(), $expected_size);
69 };
70}