mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Fix list-style serialization (#31314)
In layout2020, 'list-style-position' is disabled behind a pref, so the list_style_position field is an Option. The serialization of the 'list-style' shorthand wasn't correctly handling the case of it being None.
This commit is contained in:
parent
cdc3c369f0
commit
cdafaa57a0
2 changed files with 9 additions and 8 deletions
|
@ -113,14 +113,14 @@
|
|||
#[cfg(feature = "gecko")]
|
||||
let position_is_initial = self.list_style_position == &ListStylePosition::Outside;
|
||||
#[cfg(feature = "servo")]
|
||||
let position_is_initial = self.list_style_position == Some(&ListStylePosition::Outside);
|
||||
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;
|
||||
}
|
||||
if self.list_style_image != &ListStyleImage::None {
|
||||
if have_one_non_initial_value {
|
||||
dest.write_char(' ')?;
|
||||
dest.write_char(' ')?;
|
||||
}
|
||||
self.list_style_image.to_css(dest)?;
|
||||
have_one_non_initial_value = true;
|
||||
|
@ -137,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(())
|
||||
}
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
[cssom-getPropertyValue-common-checks.html]
|
||||
[All properties (except 'all') can serialize their initial value (computed)]
|
||||
expected: FAIL
|
||||
|
||||
[All shorthands (except 'all') can serialize their longhands set to their initial value]
|
||||
expected: FAIL
|
Loading…
Add table
Add a link
Reference in a new issue