mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Make ShapeRadius generic
This commit is contained in:
parent
b2b3f99427
commit
a36bf9efc4
4 changed files with 72 additions and 98 deletions
|
@ -15,7 +15,8 @@ use values::{Auto, Either, ExtremumLength, None_, Normal};
|
|||
use values::computed::{Angle, LengthOrPercentage, LengthOrPercentageOrAuto};
|
||||
use values::computed::{LengthOrPercentageOrNone, Number, NumberOrPercentage};
|
||||
use values::computed::{MaxLength, MinLength};
|
||||
use values::computed::basic_shape::ShapeRadius;
|
||||
use values::computed::basic_shape::ShapeRadius as ComputedShapeRadius;
|
||||
use values::generics::basic_shape::ShapeRadius;
|
||||
use values::specified::Percentage;
|
||||
use values::specified::grid::{TrackBreadth, TrackKeyword};
|
||||
|
||||
|
@ -205,15 +206,13 @@ impl<L: GeckoStyleCoordConvertible> GeckoStyleCoordConvertible for TrackBreadth<
|
|||
}
|
||||
}
|
||||
|
||||
impl GeckoStyleCoordConvertible for ShapeRadius {
|
||||
impl GeckoStyleCoordConvertible for ComputedShapeRadius {
|
||||
fn to_gecko_style_coord<T: CoordDataMut>(&self, coord: &mut T) {
|
||||
match *self {
|
||||
ShapeRadius::ClosestSide => {
|
||||
coord.set_value(CoordDataValue::Enumerated(StyleShapeRadius::ClosestSide as u32))
|
||||
}
|
||||
ShapeRadius::FarthestSide => {
|
||||
coord.set_value(CoordDataValue::Enumerated(StyleShapeRadius::FarthestSide as u32))
|
||||
}
|
||||
ShapeRadius::ClosestSide =>
|
||||
coord.set_value(CoordDataValue::Enumerated(StyleShapeRadius::ClosestSide as u32)),
|
||||
ShapeRadius::FarthestSide =>
|
||||
coord.set_value(CoordDataValue::Enumerated(StyleShapeRadius::FarthestSide as u32)),
|
||||
ShapeRadius::Length(lop) => lop.to_gecko_style_coord(coord),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue