mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Implement font-size.
This commit is contained in:
parent
2b415bfe97
commit
6e09ff3234
1 changed files with 18 additions and 0 deletions
|
@ -172,6 +172,18 @@ def set_gecko_property(ffi_name, expr):
|
|||
% endif
|
||||
</%def>
|
||||
|
||||
<%def name="impl_app_units(ident, gecko_ffi_name, need_clone)">
|
||||
fn set_${ident}(&mut self, v: longhands::${ident}::computed_value::T) {
|
||||
self.gecko.${gecko_ffi_name} = v.0;
|
||||
}
|
||||
<%call expr="impl_simple_copy(ident, gecko_ffi_name)"></%call>
|
||||
%if need_clone:
|
||||
fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T {
|
||||
Au(self.gecko.${gecko_ffi_name})
|
||||
}
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
<%def name="impl_style_struct(style_struct)">
|
||||
impl ${style_struct.gecko_struct_name} {
|
||||
#[allow(dead_code, unused_variables)]
|
||||
|
@ -348,6 +360,12 @@ fn static_assert() {
|
|||
}
|
||||
</%self:impl_trait>
|
||||
|
||||
<%self:impl_trait style_struct_name="Font" skip_longhands="font-size">
|
||||
|
||||
// FIXME(bholley): This doesn't handle zooming properly.
|
||||
<% impl_app_units("font_size", "mSize", need_clone=True) %>
|
||||
</%self:impl_trait>
|
||||
|
||||
<%self:impl_trait style_struct_name="Box" skip_longhands="display overflow-y">
|
||||
|
||||
// We manually-implement the |display| property until we get general
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue