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

@ -6,7 +6,7 @@
use app_units::Au;
use values::{Either, RGBA};
use values::computed::LengthOrPercentageOrNumber;
use values::computed::{LengthOrPercentageOrNumber, Opacity};
use values::generics::svg as generic;
/// Computed SVG Paint value
@ -51,3 +51,12 @@ impl Default for SVGStrokeDashArray {
generic::SVGStrokeDashArray::Values(vec![])
}
}
/// <opacity-value> | context-fill-opacity | context-stroke-opacity
pub type SVGOpacity = generic::SVGOpacity<Opacity>;
impl Default for SVGOpacity {
fn default() -> Self {
generic::SVGOpacity::Opacity(1.)
}
}