mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
Create a module for generics and make BorderRadiusSize generic
This commit is contained in:
parent
c5c6e8c442
commit
0249270f61
9 changed files with 91 additions and 74 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue