diff options
author | Delan Azabani <dazabani@igalia.com> | 2024-02-27 23:39:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-27 15:39:06 +0000 |
commit | faf754dfa655f0b9a28f62bc47a78fbf78ebcaf4 (patch) | |
tree | 4725e1446680d036797b1fc258733ae6b2c9f354 /components/style/macros.rs | |
parent | b07505417e629bbb081be9683630f2d7a5f50544 (diff) | |
download | servo-faf754dfa655f0b9a28f62bc47a78fbf78ebcaf4.tar.gz servo-faf754dfa655f0b9a28f62bc47a78fbf78ebcaf4.zip |
Move Stylo to its own repo (#31350)
* Remove packages that were moved to external repo
* Add workspace dependencies pointing to 2023-06-14 branch
* Fix servo-tidy.toml errors
* Update commit to include #31346
* Update commit to include servo/stylo#2
* Move css-properties.json lookup to target/doc/stylo
* Remove dependency on vendored mako in favour of pypi dependency
This also removes etc/ci/generate_workflow.py, which has been unused
since at least 9e71bd6a7010d6e5723831696ae0ebe26b47682f.
* Add temporary code to debug Windows test failures
* Fix failures on Windows due to custom target dir
* Update commit to include servo/stylo#3
* Fix license in tests/unit/style/build.rs
* Document how to build with local Stylo in Cargo.toml
Diffstat (limited to 'components/style/macros.rs')
-rw-r--r-- | components/style/macros.rs | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/components/style/macros.rs b/components/style/macros.rs deleted file mode 100644 index 5f3a1ea463b..00000000000 --- a/components/style/macros.rs +++ /dev/null @@ -1,98 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ - -//! Various macro helpers. - -macro_rules! exclusive_value { - (($value:ident, $set:expr) => $ident:path) => { - if $value.intersects($set) { - return Err(()); - } else { - $ident - } - }; -} - -#[cfg(feature = "gecko")] -macro_rules! impl_gecko_keyword_conversions { - ($name:ident, $utype:ty) => { - impl From<$utype> for $name { - fn from(bits: $utype) -> $name { - $name::from_gecko_keyword(bits) - } - } - - impl From<$name> for $utype { - fn from(v: $name) -> $utype { - v.to_gecko_keyword() - } - } - }; -} - -macro_rules! trivial_to_computed_value { - ($name:ty) => { - impl $crate::values::computed::ToComputedValue for $name { - type ComputedValue = $name; - - fn to_computed_value(&self, _: &$crate::values::computed::Context) -> Self { - self.clone() - } - - fn from_computed_value(other: &Self) -> Self { - other.clone() - } - } - }; -} - -/// A macro to parse an identifier, or return an `UnexpectedIdent` error -/// otherwise. -/// -/// FIXME(emilio): The fact that `UnexpectedIdent` is a `SelectorParseError` -/// doesn't make a lot of sense to me. -macro_rules! try_match_ident_ignore_ascii_case { - ($input:expr, $( $match_body:tt )*) => {{ - let location = $input.current_source_location(); - let ident = $input.expect_ident_cloned()?; - match_ignore_ascii_case! { &ident, - $( $match_body )* - _ => return Err(location.new_custom_error( - ::selectors::parser::SelectorParseErrorKind::UnexpectedIdent(ident.clone()) - )) - } - }} -} - -#[cfg(feature = "servo")] -macro_rules! local_name { - ($s:tt) => { - $crate::values::GenericAtomIdent(html5ever::local_name!($s)) - }; -} - -#[cfg(feature = "servo")] -macro_rules! ns { - () => { - $crate::values::GenericAtomIdent(html5ever::ns!()) - }; - ($s:tt) => { - $crate::values::GenericAtomIdent(html5ever::ns!($s)) - }; -} - -#[cfg(feature = "gecko")] -macro_rules! local_name { - ($s:tt) => { - $crate::values::AtomIdent(atom!($s)) - }; -} - -/// Asserts the size of a type at compile time. -macro_rules! size_of_test { - ($t: ty, $expected_size: expr) => { - #[cfg(target_pointer_width = "64")] - const_assert_eq!(std::mem::size_of::<$t>(), $expected_size); - }; -} |