mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Parse -moz-image-rect()
and -moz-element()
only in Gecko
This commit is contained in:
parent
709e06928a
commit
062c1872f0
5 changed files with 59 additions and 17 deletions
|
@ -53,17 +53,24 @@ impl<I> ImageLayer<I> {
|
|||
pub enum GenericImage<Gradient, MozImageRect, ImageUrl> {
|
||||
/// A `<url()>` image.
|
||||
Url(ImageUrl),
|
||||
|
||||
/// A `<gradient>` image. Gradients are rather large, and not nearly as
|
||||
/// common as urls, so we box them here to keep the size of this enum sane.
|
||||
Gradient(Box<Gradient>),
|
||||
|
||||
/// A `-moz-image-rect` image. Also fairly large and rare.
|
||||
// not cfg’ed out on non-Gecko to avoid `error[E0392]: parameter `MozImageRect` is never used`
|
||||
// Instead we make MozImageRect an empty enum
|
||||
Rect(Box<MozImageRect>),
|
||||
|
||||
/// A `-moz-element(# <element-id>)`
|
||||
#[cfg(feature = "gecko")]
|
||||
#[css(function = "-moz-element")]
|
||||
Element(Atom),
|
||||
|
||||
/// A paint worklet image.
|
||||
/// <https://drafts.css-houdini.org/css-paint-api/>
|
||||
#[cfg(feature = "servo")]
|
||||
#[cfg(feature = "servo-layout-2013")]
|
||||
PaintWorklet(PaintWorklet),
|
||||
}
|
||||
|
||||
|
@ -323,8 +330,9 @@ where
|
|||
Image::Url(ref url) => url.to_css(dest),
|
||||
Image::Gradient(ref gradient) => gradient.to_css(dest),
|
||||
Image::Rect(ref rect) => rect.to_css(dest),
|
||||
#[cfg(feature = "servo")]
|
||||
#[cfg(feature = "servo-layout-2013")]
|
||||
Image::PaintWorklet(ref paint_worklet) => paint_worklet.to_css(dest),
|
||||
#[cfg(feature = "gecko")]
|
||||
Image::Element(ref selector) => {
|
||||
dest.write_str("-moz-element(#")?;
|
||||
serialize_atom_identifier(selector, dest)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue