mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Support letter-spacing in stylo
This commit is contained in:
parent
040075ad08
commit
bce6f7d6f2
2 changed files with 11 additions and 2 deletions
|
@ -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") %>
|
||||
|
@ -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::*;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue