servo: Merge #13751 - Add support for 'font-kerning' in geckolib (from joewalker:font-kerning); r=Manishearth
authorJoe Walker <jwalker@mozilla.com>
Fri, 14 Oct 2016 08:56:54 -0500
changeset 386563 b1a91e2daf1e2b591e45b0931083619c89571bb1
parent 386562 350d67df366c4180e0da0b36a46de916f1c331a1
child 386564 66c2c2c16ad9269341522579dc8bfd145a92b2a8
push id7198
push userjlorenzo@mozilla.com
push dateTue, 18 Apr 2017 12:07:49 +0000
treeherdermozilla-beta@d57aa49c3948 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersManishearth
servo: Merge #13751 - Add support for 'font-kerning' in geckolib (from joewalker:font-kerning); r=Manishearth Add support for 'font-kerning' in geckolib These changes fix #13667 $ ./mach build -d It looks like you passed an unrecognized argument into mach. $ ./mach test-tidy It looks like you are trying to run an unknown mach command: test-tidy I'm clearly doing something wrong here, but I'm not sure what - [x] These changes do not require tests because "[For stylo it's okay to not have tests since many of the reftests fail due to unrelated reasons](https://github.com/servo/servo/pull/13570#issuecomment-251354116)" :) Source-Repo: https://github.com/servo/servo Source-Revision: b94f074b52584f467c61ee5d1851b1b4557ccfcb
servo/components/style/properties/gecko.mako.rs
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -444,17 +444,17 @@ impl Debug for ${style_struct.gecko_stru
 
     #
     # Make a list of types we can't auto-generate.
     #
     force_stub = [];
     # These are currently being shuffled to a different style struct on the gecko side.
     force_stub += ["backface-visibility", "transform-box", "transform-style"]
     # These live in an nsFont member in Gecko. Should be straightforward to do manually.
-    force_stub += ["font-kerning", "font-variant"]
+    force_stub += ["font-variant"]
     # These have unusual representations in gecko.
     force_stub += ["list-style-type"]
     # In a nsTArray, have to be done manually, but probably not too much work
     # (the "filling them", not the "making them work")
     force_stub += ["animation-name", "animation-duration",
                   "animation-timing-function", "animation-iteration-count",
                   "animation-direction", "animation-play-state",
                   "animation-fill-mode", "animation-delay"]
@@ -734,17 +734,17 @@ fn static_assert() {
     % endfor
 
     pub fn outline_has_nonzero_width(&self) -> bool {
         self.gecko.mActualOutlineWidth != 0
     }
 </%self:impl_trait>
 
 <%self:impl_trait style_struct_name="Font"
-    skip_longhands="font-family font-stretch font-style font-size font-weight"
+    skip_longhands="font-family font-kerning font-stretch font-style font-size font-weight"
     skip_additionals="*">
 
     pub fn set_font_family(&mut self, v: longhands::font_family::computed_value::T) {
         use properties::longhands::font_family::computed_value::FontFamily;
         use gecko_bindings::structs::FontFamilyType;
 
         let list = &mut self.gecko.mFont.fontlist;
         unsafe { Gecko_FontFamilyList_Clear(list); }
@@ -785,16 +785,21 @@ fn static_assert() {
     pub fn copy_font_size_from(&mut self, other: &Self) {
         self.gecko.mFont.size = other.gecko.mFont.size;
         self.gecko.mSize = other.gecko.mSize;
     }
     pub fn clone_font_size(&self) -> longhands::font_size::computed_value::T {
         Au(self.gecko.mSize)
     }
 
+    <% kerning_keyword = Keyword("font-kerning", "auto normal none",
+                                 gecko_constant_prefix='NS_FONT_KERNING') %>
+
+    ${impl_keyword('font_kerning', 'mFont.kerning', kerning_keyword, need_clone=False)}
+
     <% stretch_keyword = Keyword("font-stretch",
                                  "normal ultra-condensed extra-condensed condensed " +
                                  "semi-condensed semi-expanded expanded " +
                                  "extra-expanded ultra-expanded",
                                  gecko_constant_prefix='NS_FONT_STRETCH') %>
 
     ${impl_keyword('font_stretch', 'mFont.stretch', stretch_keyword, need_clone=False, cast_type='i16')}