stylo: Update clip-path glue.

This commit is contained in:
cku 2017-03-17 00:19:09 +08:00
parent 8835e1d887
commit e8d8b9984f
3 changed files with 47 additions and 47 deletions

View file

@ -859,9 +859,9 @@ impl ToCss for FillRule {
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
#[allow(missing_docs)]
pub enum GeometryBox {
Fill,
Stroke,
View,
FillBox,
StrokeBox,
ViewBox,
ShapeBox(ShapeBox),
}
@ -871,9 +871,9 @@ impl Parse for GeometryBox {
Ok(GeometryBox::ShapeBox(shape_box))
} else {
match_ignore_ascii_case! { &try!(input.expect_ident()),
"fill-box" => Ok(GeometryBox::Fill),
"stroke-box" => Ok(GeometryBox::Stroke),
"view-box" => Ok(GeometryBox::View),
"fill-box" => Ok(GeometryBox::FillBox),
"stroke-box" => Ok(GeometryBox::StrokeBox),
"view-box" => Ok(GeometryBox::ViewBox),
_ => Err(())
}
}
@ -883,9 +883,9 @@ impl Parse for GeometryBox {
impl ToCss for GeometryBox {
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
match *self {
GeometryBox::Fill => dest.write_str("fill-box"),
GeometryBox::Stroke => dest.write_str("stroke-box"),
GeometryBox::View => dest.write_str("view-box"),
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),
}
}
@ -898,20 +898,20 @@ impl ComputedValueAsSpecified for GeometryBox {}
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
#[allow(missing_docs)]
pub enum ShapeBox {
Margin,
MarginBox,
// https://drafts.csswg.org/css-backgrounds-3/#box
Border,
Padding,
Content,
BorderBox,
PaddingBox,
ContentBox,
}
impl Parse for ShapeBox {
fn parse(_context: &ParserContext, input: &mut Parser) -> Result<Self, ()> {
match_ignore_ascii_case! { &try!(input.expect_ident()),
"margin-box" => Ok(ShapeBox::Margin),
"border-box" => Ok(ShapeBox::Border),
"padding-box" => Ok(ShapeBox::Padding),
"content-box" => Ok(ShapeBox::Content),
"margin-box" => Ok(ShapeBox::MarginBox),
"border-box" => Ok(ShapeBox::BorderBox),
"padding-box" => Ok(ShapeBox::PaddingBox),
"content-box" => Ok(ShapeBox::ContentBox),
_ => Err(())
}
}
@ -920,10 +920,10 @@ impl Parse for ShapeBox {
impl ToCss for ShapeBox {
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
match *self {
ShapeBox::Margin => dest.write_str("margin-box"),
ShapeBox::Border => dest.write_str("border-box"),
ShapeBox::Padding => dest.write_str("padding-box"),
ShapeBox::Content => dest.write_str("content-box"),
ShapeBox::MarginBox => dest.write_str("margin-box"),
ShapeBox::BorderBox => dest.write_str("border-box"),
ShapeBox::PaddingBox => dest.write_str("padding-box"),
ShapeBox::ContentBox => dest.write_str("content-box"),
}
}
}