mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +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
|
@ -94,3 +94,13 @@ impl<ColorType: Parse> Parse for SVGPaint<ColorType> {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// An SVG length value supports `context-value` in addition to length.
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, HasViewportPercentage, ToComputedValue, ToCss)]
|
||||
pub enum SVGLength<LengthType> {
|
||||
/// `<length> | <percentage> | <number>`
|
||||
Length(LengthType),
|
||||
/// `context-value`
|
||||
ContextValue,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue