Add context-{fill,stroke}-opacity support to {fill,stroke}-opacity.

This commit is contained in:
Xidorn Quan 2017-08-02 09:27:49 +10:00
parent 7827ca6bb5
commit ef4352d2a5
8 changed files with 149 additions and 7 deletions

View file

@ -138,3 +138,16 @@ impl<LengthType> ToCss for SVGStrokeDashArray<LengthType> where LengthType: ToCs
}
}
}
/// An SVG opacity value accepts `context-{fill,stroke}-opacity` in
/// addition to opacity value.
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
#[derive(Clone, Copy, Debug, PartialEq, HasViewportPercentage, ToComputedValue, ToCss)]
pub enum SVGOpacity<OpacityType> {
/// `<opacity-value>`
Opacity(OpacityType),
/// `context-fill-opacity`
ContextFillOpacity,
/// `context-stroke-opacity`
ContextStrokeOpacity,
}