summaryrefslogtreecommitdiffstats
path: root/servo/components/style/properties/shorthands/box.mako.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /servo/components/style/properties/shorthands/box.mako.rs
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-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/box.mako.rs')
-rw-r--r--servo/components/style/properties/shorthands/box.mako.rs37
1 files changed, 13 insertions, 24 deletions
diff --git a/servo/components/style/properties/shorthands/box.mako.rs b/servo/components/style/properties/shorthands/box.mako.rs
index f644687dc0..078a511ae9 100644
--- a/servo/components/style/properties/shorthands/box.mako.rs
+++ b/servo/components/style/properties/shorthands/box.mako.rs
@@ -8,7 +8,7 @@ ${helpers.two_properties_shorthand(
"overflow",
"overflow-x",
"overflow-y",
- engines="gecko servo-2013 servo-2020",
+ engines="gecko servo",
flags="SHORTHAND_IN_GETCS",
spec="https://drafts.csswg.org/css-overflow/#propdef-overflow",
)}
@@ -159,13 +159,7 @@ ${helpers.two_properties_shorthand(
context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<Longhands, ParseError<'i>> {
- let offset_position =
- if static_prefs::pref!("layout.css.motion-path-offset-position.enabled") {
- input.try_parse(|i| OffsetPosition::parse(context, i)).ok()
- } else {
- None
- };
-
+ let offset_position = input.try_parse(|i| OffsetPosition::parse(context, i)).ok();
let offset_path = input.try_parse(|i| OffsetPath::parse(context, i)).ok();
// Must have one of [offset-position, offset-path].
@@ -212,24 +206,19 @@ ${helpers.two_properties_shorthand(
impl<'a> ToCss for LonghandsToSerialize<'a> {
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result where W: fmt::Write {
- if let Some(offset_position) = self.offset_position {
- // The basic concept is: we must serialize offset-position or offset-path group.
- // offset-path group means "offset-path offset-distance offset-rotate".
- let must_serialize_path = *self.offset_path != OffsetPath::None
- || (!self.offset_distance.is_zero() || !self.offset_rotate.is_auto());
- let position_is_default = matches!(offset_position, OffsetPosition::Normal);
- if !position_is_default || !must_serialize_path {
- offset_position.to_css(dest)?;
- }
+ // The basic concept is: we must serialize offset-position or offset-path group.
+ // offset-path group means "offset-path offset-distance offset-rotate".
+ let must_serialize_path = *self.offset_path != OffsetPath::None
+ || (!self.offset_distance.is_zero() || !self.offset_rotate.is_auto());
+ let position_is_default = matches!(self.offset_position, OffsetPosition::Normal);
+ if !position_is_default || !must_serialize_path {
+ self.offset_position.to_css(dest)?;
+ }
- if must_serialize_path {
- if !position_is_default {
- dest.write_char(' ')?;
- }
- self.offset_path.to_css(dest)?;
+ if must_serialize_path {
+ if !position_is_default {
+ dest.write_char(' ')?;
}
- } else {
- // If the pref is off, we always show offset-path.
self.offset_path.to_css(dest)?;
}