mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Add SVGLength which accepts context-value, and use it for stroke-{width,dashoffset}.
This commit is contained in:
parent
3991e7d344
commit
aa80859a71
8 changed files with 182 additions and 49 deletions
|
@ -4,7 +4,9 @@
|
|||
|
||||
//! Computed types for SVG properties.
|
||||
|
||||
use values::RGBA;
|
||||
use app_units::Au;
|
||||
use values::{Either, RGBA};
|
||||
use values::computed::LengthOrPercentageOrNumber;
|
||||
use values::generics::svg as generic;
|
||||
|
||||
/// Computed SVG Paint value
|
||||
|
@ -31,3 +33,12 @@ impl SVGPaint {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <length> | <percentage> | <number> | context-value
|
||||
pub type SVGLength = generic::SVGLength<LengthOrPercentageOrNumber>;
|
||||
|
||||
impl From<Au> for SVGLength {
|
||||
fn from(length: Au) -> Self {
|
||||
generic::SVGLength::Length(Either::Second(length.into()))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue