diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
commit | def92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch) | |
tree | 2ef34b9ad8bb9a9220e05d60352558b15f513894 /servo/components/style/properties/shorthands/list.mako.rs | |
parent | Adding debian version 125.0.3-1. (diff) | |
download | firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'servo/components/style/properties/shorthands/list.mako.rs')
-rw-r--r-- | servo/components/style/properties/shorthands/list.mako.rs | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/servo/components/style/properties/shorthands/list.mako.rs b/servo/components/style/properties/shorthands/list.mako.rs index 2e234e3d8f..183c5ab5da 100644 --- a/servo/components/style/properties/shorthands/list.mako.rs +++ b/servo/components/style/properties/shorthands/list.mako.rs @@ -5,7 +5,7 @@ <%namespace name="helpers" file="/helpers.mako.rs" /> <%helpers:shorthand name="list-style" - engines="gecko servo-2013 servo-2020" + engines="gecko servo" sub_properties="list-style-position list-style-image list-style-type" spec="https://drafts.csswg.org/css-lists/#propdef-list-style"> use crate::properties::longhands::{list_style_image, list_style_position, list_style_type}; @@ -110,7 +110,11 @@ use longhands::list_style_type::SpecifiedValue as ListStyleType; use longhands::list_style_image::SpecifiedValue as ListStyleImage; let mut have_one_non_initial_value = false; - if self.list_style_position != &ListStylePosition::Outside { + #[cfg(feature = "gecko")] + let position_is_initial = self.list_style_position == &ListStylePosition::Outside; + #[cfg(feature = "servo")] + let position_is_initial = matches!(self.list_style_position, None | Some(&ListStylePosition::Outside)); + if !position_is_initial { self.list_style_position.to_css(dest)?; have_one_non_initial_value = true; } @@ -121,7 +125,11 @@ self.list_style_image.to_css(dest)?; have_one_non_initial_value = true; } - if self.list_style_type != &ListStyleType::disc() { + #[cfg(feature = "gecko")] + let type_is_initial = self.list_style_type == &ListStyleType::disc(); + #[cfg(feature = "servo")] + let type_is_initial = self.list_style_type == &ListStyleType::Disc; + if !type_is_initial { if have_one_non_initial_value { dest.write_char(' ')?; } @@ -129,7 +137,14 @@ have_one_non_initial_value = true; } if !have_one_non_initial_value { + #[cfg(feature = "gecko")] self.list_style_position.to_css(dest)?; + #[cfg(feature = "servo")] + if let Some(position) = self.list_style_position { + position.to_css(dest)?; + } else { + self.list_style_type.to_css(dest)?; + } } Ok(()) } |