diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /servo/components/style/properties/shorthands/list.mako.rs | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.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(()) } |