Skip to content

Commit

Permalink
Auto merge of #12795 - Wafflespeanut:word_spacing, r=Manishearth
Browse files Browse the repository at this point in the history
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 -->
  • Loading branch information
bors-servo committed Aug 12, 2016
2 parents 5b915c4 + 69c422f commit a229135
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion components/style/properties/gecko.mako.rs
Expand Up @@ -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") %>
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit a229135

Please sign in to comment.