diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2019-02-24 10:47:53 -0800 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2019-03-13 15:08:12 +0100 |
commit | 197065f6bc425592a6d0b59a4e0e13ebe9c12b52 (patch) | |
tree | 4ff619e3109fa72bd664eb57e1df5a140850306a /components/style/values/generics/border.rs | |
parent | aad4dac5b422ff107484d7dccbc0f33ce8251755 (diff) | |
download | servo-197065f6bc425592a6d0b59a4e0e13ebe9c12b52.tar.gz servo-197065f6bc425592a6d0b59a4e0e13ebe9c12b52.zip |
style: Use rust lengths for border corners.
The test in https://github.com/web-platform-tests/wpt/pull/15423 hasn't been
synced over yet, but it passes with this patch of course.
Differential Revision: https://phabricator.services.mozilla.com/D20960
Diffstat (limited to 'components/style/values/generics/border.rs')
-rw-r--r-- | components/style/values/generics/border.rs | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/components/style/values/generics/border.rs b/components/style/values/generics/border.rs index 148f74e3834..bfc7ac5814a 100644 --- a/components/style/values/generics/border.rs +++ b/components/style/values/generics/border.rs @@ -53,7 +53,10 @@ pub use self::GenericBorderImageSlice as BorderImageSlice; ToComputedValue, ToCss, )] -pub struct BorderCornerRadius<L>(#[css(field_bound)] pub Size2D<L>); +#[repr(C)] +pub struct GenericBorderCornerRadius<L>(#[css(field_bound)] pub Size2D<L>); + +pub use self::GenericBorderCornerRadius as BorderCornerRadius; impl<L> BorderCornerRadius<L> { /// Trivially create a `BorderCornerRadius`. @@ -77,6 +80,7 @@ impl<L> BorderCornerRadius<L> { ToComputedValue, ToCss, )] +#[repr(transparent)] pub struct BorderSpacing<L>(#[css(field_bound)] pub Size2D<L>); impl<L> BorderSpacing<L> { @@ -101,17 +105,20 @@ impl<L> BorderSpacing<L> { ToAnimatedValue, ToComputedValue, )] -pub struct BorderRadius<LengthPercentage> { +#[repr(C)] +pub struct GenericBorderRadius<LengthPercentage> { /// The top left radius. - pub top_left: BorderCornerRadius<LengthPercentage>, + pub top_left: GenericBorderCornerRadius<LengthPercentage>, /// The top right radius. - pub top_right: BorderCornerRadius<LengthPercentage>, + pub top_right: GenericBorderCornerRadius<LengthPercentage>, /// The bottom right radius. - pub bottom_right: BorderCornerRadius<LengthPercentage>, + pub bottom_right: GenericBorderCornerRadius<LengthPercentage>, /// The bottom left radius. - pub bottom_left: BorderCornerRadius<LengthPercentage>, + pub bottom_left: GenericBorderCornerRadius<LengthPercentage>, } +pub use self::GenericBorderRadius as BorderRadius; + impl<L> BorderRadius<L> { /// Returns a new `BorderRadius<L>`. #[inline] |