From 1d32422fe85955b6cb9082047af60588c0dd600c Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Mon, 15 Aug 2016 15:16:06 +0530 Subject: [PATCH] Add clip-path --- .../style/properties/longhand/svg.mako.rs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/components/style/properties/longhand/svg.mako.rs b/components/style/properties/longhand/svg.mako.rs index 49dd2bdbdac..3d0c5cc48aa 100644 --- a/components/style/properties/longhand/svg.mako.rs +++ b/components/style/properties/longhand/svg.mako.rs @@ -49,3 +49,31 @@ ${helpers.predefined_type( // https://www.w3.org/TR/css-masking-1/ ${helpers.single_keyword("mask-type", "luminance alpha", products="gecko", animatable=False)} + +<%helpers:longhand name="clip-path" animatable="False" products="gecko"> + use cssparser::ToCss; + use std::fmt; + use values::LocalToCss; + use values::NoViewportPercentage; + use values::specified::basic_shape::{ShapeSource, GeometryBox}; + + pub mod computed_value { + use app_units::Au; + use values::computed::basic_shape::{ShapeSource, GeometryBox}; + + pub type T = ShapeSource; + } + + pub type SpecifiedValue = ShapeSource; + + #[inline] + pub fn get_initial_value() -> computed_value::T { + Default::default() + } + + pub fn parse(context: &ParserContext, input: &mut Parser) -> Result { + ShapeSource::parse(context, input) + } + + impl NoViewportPercentage for SpecifiedValue {} +