mirror of
https://github.com/servo/servo.git
synced 2025-08-17 19:35:33 +01:00
stylo: Implement outline-offset
MozReview-Commit-ID: 6mr4ktfeEGT
This commit is contained in:
parent
20796ee94e
commit
3266b5b31f
2 changed files with 16 additions and 2 deletions
|
@ -328,6 +328,20 @@ def set_gecko_property(ffi_name, expr):
|
|||
% endif
|
||||
</%def>
|
||||
|
||||
<%def name="impl_absolute_length(ident, gecko_ffi_name, need_clone=False)">
|
||||
#[allow(non_snake_case)]
|
||||
pub fn set_${ident}(&mut self, v: longhands::${ident}::computed_value::T) {
|
||||
${set_gecko_property(gecko_ffi_name, "v.0")}
|
||||
}
|
||||
<%call expr="impl_simple_copy(ident, gecko_ffi_name)"></%call>
|
||||
% if need_clone:
|
||||
#[allow(non_snake_case)]
|
||||
pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T {
|
||||
Au(self.gecko.${gecko_ffi_name})
|
||||
}
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
<%def name="impl_color(ident, gecko_ffi_name, need_clone=False, complex_color=True)">
|
||||
<%call expr="impl_color_setter(ident, gecko_ffi_name, complex_color)"></%call>
|
||||
<%call expr="impl_color_copy(ident, gecko_ffi_name, complex_color)"></%call>
|
||||
|
@ -501,7 +515,7 @@ impl Debug for ${style_struct.gecko_struct_name} {
|
|||
# Types used with predefined_type()-defined properties that we can auto-generate.
|
||||
predefined_types = {
|
||||
"length::LengthOrAuto": impl_style_coord,
|
||||
"Length": impl_style_coord,
|
||||
"Length": impl_absolute_length,
|
||||
"LengthOrPercentage": impl_style_coord,
|
||||
"LengthOrPercentageOrAuto": impl_style_coord,
|
||||
"LengthOrPercentageOrNone": impl_style_coord,
|
||||
|
|
|
@ -114,5 +114,5 @@ ${helpers.predefined_type("outline-color", "CSSColor", "::cssparser::Color::Curr
|
|||
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-outline-radius)")}
|
||||
% endfor
|
||||
|
||||
${helpers.predefined_type("outline-offset", "Length", "Au(0)", products="servo", animatable=True,
|
||||
${helpers.predefined_type("outline-offset", "Length", "Au(0)", products="servo gecko", animatable=True,
|
||||
spec="https://drafts.csswg.org/css-ui/#propdef-outline-offset")}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue