From 9aab775e7cfe00e574962d3b7f23a4953f2778e5 Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Fri, 29 Apr 2016 17:48:04 -0700 Subject: [PATCH] Implement font-size more correctly. This still doesn't take zooming into account. --- ports/geckolib/properties.mako.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/ports/geckolib/properties.mako.rs b/ports/geckolib/properties.mako.rs index 3804f3a25a9..7dd8f34013f 100644 --- a/ports/geckolib/properties.mako.rs +++ b/ports/geckolib/properties.mako.rs @@ -375,8 +375,20 @@ for side in SIDES: <%self:impl_trait style_struct_name="Font" skip_longhands="font-size" skip_additionals="*"> - // FIXME(bholley): This doesn't handle zooming properly. - <% impl_app_units("font_size", "mSize", need_clone=True) %> + // FIXME(bholley): Gecko has two different sizes, one of which (mSize) is the + // actual computed size, and the other of which (mFont.size) is the 'display + // size' which takes font zooming into account. We don't handle font zooming yet. + fn set_font_size(&mut self, v: longhands::font_size::computed_value::T) { + self.gecko.mFont.size = v.0; + self.gecko.mSize = v.0; + } + fn copy_font_size_from(&mut self, other: &Self) { + self.gecko.mFont.size = other.gecko.mFont.size; + self.gecko.mSize = other.gecko.mSize; + } + fn clone_font_size(&self) -> longhands::font_size::computed_value::T { + Au(self.gecko.mSize) + } // This is used for PartialEq, which we don't implement for gecko style structs. fn compute_font_hash(&mut self) {}