Skip to content

Commit

Permalink
Support letter-spacing in stylo
Browse files Browse the repository at this point in the history
  • Loading branch information
KiChjang committed Sep 28, 2016
1 parent 040075a commit bce6f7d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion components/style/properties/gecko.mako.rs
Expand Up @@ -1444,7 +1444,7 @@ fn static_assert() {


<%self:impl_trait style_struct_name="InheritedText"
skip_longhands="text-align text-shadow line-height word-spacing">
skip_longhands="text-align text-shadow line-height letter-spacing word-spacing">

<% text_align_keyword = Keyword("text-align", "start end left right center justify -moz-center -moz-left " +
"-moz-right match-parent") %>
Expand Down Expand Up @@ -1523,6 +1523,15 @@ fn static_assert() {

<%call expr="impl_coord_copy('line_height', 'mLineHeight')"></%call>

pub fn set_letter_spacing(&mut self, v: longhands::letter_spacing::computed_value::T) {
match v.0 {
Some(au) => self.gecko.mLetterSpacing.set_value(CoordDataValue::Coord(au.0)),
None => self.gecko.mLetterSpacing.set_value(CoordDataValue::Normal)
}
}

<%call expr="impl_coord_copy('letter_spacing', 'mLetterSpacing')"></%call>

pub fn set_word_spacing(&mut self, v: longhands::word_spacing::computed_value::T) {
use values::computed::LengthOrPercentage::*;

Expand Down
Expand Up @@ -208,7 +208,7 @@
</%helpers:longhand>

// FIXME: This prop should be animatable.
<%helpers:longhand name="letter-spacing" products="servo" animatable="False">
<%helpers:longhand name="letter-spacing" animatable="False">
use cssparser::ToCss;
use std::fmt;
use values::LocalToCss;
Expand Down

0 comments on commit bce6f7d

Please sign in to comment.