Skip to content

Commit e5739ec

Browse files
committed
Bug 1980539 - Restrict -moz-symbolic-icon to Gecko. r=emilio,firefox-style-system-reviewers
This is a fixup for D252791, which added -moz-symbolic-icon as an image, but Servo won't be using it. Differential Revision: https://phabricator.services.mozilla.com/D259494
1 parent e9ddac6 commit e5739ec

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

style/values/computed/image.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ impl ToComputedValue for specified::Image {
217217
Self::Gradient(g) => Image::Gradient(g.to_computed_value(context)),
218218
#[cfg(feature = "gecko")]
219219
Self::Element(e) => Image::Element(e.to_computed_value(context)),
220+
#[cfg(feature = "gecko")]
220221
Self::MozSymbolicIcon(e) => Image::MozSymbolicIcon(e.to_computed_value(context)),
221222
#[cfg(feature = "servo")]
222223
Self::PaintWorklet(w) => Image::PaintWorklet(w.to_computed_value(context)),
@@ -233,6 +234,7 @@ impl ToComputedValue for specified::Image {
233234
Image::Gradient(g) => Self::Gradient(ToComputedValue::from_computed_value(g)),
234235
#[cfg(feature = "gecko")]
235236
Image::Element(e) => Self::Element(ToComputedValue::from_computed_value(e)),
237+
#[cfg(feature = "gecko")]
236238
Image::MozSymbolicIcon(e) => Self::MozSymbolicIcon(ToComputedValue::from_computed_value(e)),
237239
#[cfg(feature = "servo")]
238240
Image::PaintWorklet(w) => Self::PaintWorklet(ToComputedValue::from_computed_value(w)),

style/values/generics/image.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ pub enum GenericImage<G, ImageUrl, Color, Percentage, Resolution> {
4141
/// A `-moz-symbolic-icon(<icon-id>)`
4242
/// NOTE(emilio): #[css(skip)] only really affects SpecifiedValueInfo, which we want because
4343
/// this is chrome-only.
44+
#[cfg(feature = "gecko")]
4445
#[css(function, skip)]
4546
MozSymbolicIcon(Atom),
4647

@@ -434,6 +435,7 @@ where
434435
serialize_atom_identifier(selector, dest)?;
435436
dest.write_char(')')
436437
},
438+
#[cfg(feature = "gecko")]
437439
Image::MozSymbolicIcon(ref id) => {
438440
dest.write_str("-moz-symbolic-icon(")?;
439441
serialize_atom_identifier(id, dest)?;

style/values/specified/image.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ impl Image {
253253
})?)),
254254
#[cfg(feature = "gecko")]
255255
"-moz-element" => Self::Element(Self::parse_element(input)?),
256+
#[cfg(feature = "gecko")]
256257
"-moz-symbolic-icon" if context.chrome_rules_enabled() => Self::MozSymbolicIcon(input.expect_ident()?.as_ref().into()),
257258
_ => return Err(input.new_custom_error(StyleParseErrorKind::UnexpectedFunction(function))),
258259
}))

0 commit comments

Comments
 (0)