Create a module for generics and make BorderRadiusSize generic

This commit is contained in:
Ravi Shankar 2017-04-12 21:02:43 +05:30
parent c5c6e8c442
commit 0249270f61
9 changed files with 91 additions and 74 deletions

View file

@ -543,15 +543,14 @@ fn color_to_nscolor_zero_currentcolor(color: Color) -> structs::nscolor {
% if need_clone:
#[allow(non_snake_case)]
pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T {
use properties::longhands::${ident}::computed_value::T;
use euclid::Size2D;
use values::generics::BorderRadiusSize;
let width = GeckoStyleCoordConvertible::from_gecko_style_coord(
&self.gecko.${gecko_ffi_name}.data_at(${x_index}))
.expect("Failed to clone ${ident}");
let height = GeckoStyleCoordConvertible::from_gecko_style_coord(
&self.gecko.${gecko_ffi_name}.data_at(${y_index}))
.expect("Failed to clone ${ident}");
T(Size2D::new(width, height))
BorderRadiusSize::new(width, height)
}
% endif
</%def>