mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
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:
commit
a22913569c
1 changed files with 17 additions and 1 deletions
|
@ -1173,7 +1173,7 @@ fn static_assert() {
|
||||||
</%self:impl_trait>
|
</%self:impl_trait>
|
||||||
|
|
||||||
<%self:impl_trait style_struct_name="InheritedText"
|
<%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 " +
|
<% text_align_keyword = Keyword("text-align", "start end left right center justify -moz-center -moz-left " +
|
||||||
"-moz-right match-parent") %>
|
"-moz-right match-parent") %>
|
||||||
|
@ -1209,6 +1209,22 @@ fn static_assert() {
|
||||||
|
|
||||||
<%call expr="impl_coord_copy('line_height', 'mLineHeight')"></%call>
|
<%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>
|
||||||
|
|
||||||
<%self:impl_trait style_struct_name="Text"
|
<%self:impl_trait style_struct_name="Text"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue