mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Support color in geckolib.
This commit is contained in:
parent
66a3769446
commit
d4e36556db
1 changed files with 16 additions and 0 deletions
|
@ -588,6 +588,22 @@ fn static_assert() {
|
||||||
|
|
||||||
</%self:impl_trait>
|
</%self:impl_trait>
|
||||||
|
|
||||||
|
<%self:impl_trait style_struct_name="Color"
|
||||||
|
skip_longhands="*">
|
||||||
|
|
||||||
|
fn set_color(&mut self, v: longhands::color::computed_value::T) {
|
||||||
|
let result = convert_rgba_to_nscolor(&v);
|
||||||
|
${set_gecko_property("mColor", "result")}
|
||||||
|
}
|
||||||
|
|
||||||
|
<%call expr="impl_simple_copy('color', 'mColor')"></%call>
|
||||||
|
|
||||||
|
fn clone_color(&self) -> longhands::color::computed_value::T {
|
||||||
|
let color = ${get_gecko_property("mColor")} as u32;
|
||||||
|
convert_nscolor_to_rgba(color)
|
||||||
|
}
|
||||||
|
</%self:impl_trait>
|
||||||
|
|
||||||
<%def name="define_ffi_struct_accessor(style_struct)">
|
<%def name="define_ffi_struct_accessor(style_struct)">
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
#[allow(non_snake_case, unused_variables)]
|
#[allow(non_snake_case, unused_variables)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue