mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
style: Use cbindgen for SVG lengths.
Depends on D63777 Differential Revision: https://phabricator.services.mozilla.com/D63778
This commit is contained in:
parent
18570bf077
commit
76e9cb44f0
4 changed files with 10 additions and 166 deletions
|
@ -31,7 +31,7 @@ impl SVGPaint {
|
|||
}
|
||||
|
||||
/// <length> | <percentage> | <number> | context-value
|
||||
pub type SVGLength = generic::SVGLength<LengthPercentage>;
|
||||
pub type SVGLength = generic::GenericSVGLength<LengthPercentage>;
|
||||
|
||||
impl SVGLength {
|
||||
/// `0px`
|
||||
|
@ -41,7 +41,7 @@ impl SVGLength {
|
|||
}
|
||||
|
||||
/// An non-negative wrapper of SVGLength.
|
||||
pub type SVGWidth = generic::SVGLength<NonNegativeLengthPercentage>;
|
||||
pub type SVGWidth = generic::GenericSVGLength<NonNegativeLengthPercentage>;
|
||||
|
||||
impl SVGWidth {
|
||||
/// `1px`.
|
||||
|
|
|
@ -152,7 +152,8 @@ impl<C: Parse, U: Parse> Parse for SVGPaint<C, U> {
|
|||
ToResolvedValue,
|
||||
ToShmem,
|
||||
)]
|
||||
pub enum SVGLength<L> {
|
||||
#[repr(C, u8)]
|
||||
pub enum GenericSVGLength<L> {
|
||||
/// `<length> | <percentage> | <number>`
|
||||
LengthPercentage(L),
|
||||
/// `context-value`
|
||||
|
@ -160,6 +161,8 @@ pub enum SVGLength<L> {
|
|||
ContextValue,
|
||||
}
|
||||
|
||||
pub use self::GenericSVGLength as SVGLength;
|
||||
|
||||
/// Generic value for stroke-dasharray.
|
||||
#[derive(
|
||||
Clone,
|
||||
|
|
|
@ -21,13 +21,13 @@ use style_traits::{StyleParseErrorKind, ToCss};
|
|||
pub type SVGPaint = generic::GenericSVGPaint<Color, SpecifiedUrl>;
|
||||
|
||||
/// <length> | <percentage> | <number> | context-value
|
||||
pub type SVGLength = generic::SVGLength<LengthPercentage>;
|
||||
pub type SVGLength = generic::GenericSVGLength<LengthPercentage>;
|
||||
|
||||
/// A non-negative version of SVGLength.
|
||||
pub type SVGWidth = generic::SVGLength<NonNegativeLengthPercentage>;
|
||||
pub type SVGWidth = generic::GenericSVGLength<NonNegativeLengthPercentage>;
|
||||
|
||||
/// [ <length> | <percentage> | <number> ]# | context-value
|
||||
pub type SVGStrokeDashArray = generic::SVGStrokeDashArray<NonNegativeLengthPercentage>;
|
||||
pub type SVGStrokeDashArray = generic::GenericSVGStrokeDashArray<NonNegativeLengthPercentage>;
|
||||
|
||||
/// Whether the `context-value` value is enabled.
|
||||
#[cfg(feature = "gecko")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue