Auto merge of #12795 - Wafflespeanut:word_spacing, r=Manishearth

Support 'word-spacing' for geckolib

**These changes haven't been tested yet!**

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors

- [ ] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12795)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-08-11 22:02:01 -05:00 committed by GitHub
commit a22913569c

View file

@ -1173,7 +1173,7 @@ fn static_assert() {
</%self:impl_trait>
<%self:impl_trait style_struct_name="InheritedText"
skip_longhands="text-align line-height">
skip_longhands="text-align line-height word-spacing">
<% text_align_keyword = Keyword("text-align", "start end left right center justify -moz-center -moz-left " +
"-moz-right match-parent") %>
@ -1209,6 +1209,22 @@ fn static_assert() {
<%call expr="impl_coord_copy('line_height', 'mLineHeight')"></%call>
pub fn set_word_spacing(&mut self, v: longhands::word_spacing::computed_value::T) {
use values::computed::LengthOrPercentage::*;
match v.0 {
Some(lop) => match lop {
Length(au) => self.gecko.mWordSpacing.set_value(CoordDataValue::Coord(au.0)),
Percentage(f) => self.gecko.mWordSpacing.set_value(CoordDataValue::Percent(f)),
Calc(l_p) => self.gecko.mWordSpacing.set_value(CoordDataValue::Calc(l_p.into())),
},
// https://drafts.csswg.org/css-text-3/#valdef-word-spacing-normal
None => self.gecko.mWordSpacing.set_value(CoordDataValue::Coord(0)),
}
}
<%call expr="impl_coord_copy('word_spacing', 'mWordSpacing')"></%call>
</%self:impl_trait>
<%self:impl_trait style_struct_name="Text"