mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Support unit variants when deriving ToCss
This commit is contained in:
parent
7d09ce0495
commit
45e8b0e8c7
14 changed files with 71 additions and 242 deletions
|
@ -19,7 +19,7 @@ pub type ClippingShape<BasicShape> = ShapeSource<BasicShape, GeometryBox>;
|
|||
/// https://drafts.fxtf.org/css-masking-1/#typedef-geometry-box
|
||||
#[allow(missing_docs)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, ToCss)]
|
||||
pub enum GeometryBox {
|
||||
FillBox,
|
||||
StrokeBox,
|
||||
|
@ -142,17 +142,6 @@ impl<B: ToCss, T: ToCss> ToCss for ShapeSource<B, T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl ToCss for GeometryBox {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
match *self {
|
||||
GeometryBox::FillBox => dest.write_str("fill-box"),
|
||||
GeometryBox::StrokeBox => dest.write_str("stroke-box"),
|
||||
GeometryBox::ViewBox => dest.write_str("view-box"),
|
||||
GeometryBox::ShapeBox(s) => s.to_css(dest),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<L> ToCss for InsetRect<L>
|
||||
where L: ToCss + PartialEq
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue