stylo: Implement text-emphasis-position

MozReview-Commit-ID: Lg9kDrZJpXl
This commit is contained in:
Manish Goregaokar 2017-02-06 16:02:56 -08:00 committed by Manish Goregaokar
parent 2410591119
commit 30deaab48a
2 changed files with 23 additions and 2 deletions

View file

@ -2204,7 +2204,7 @@ fn static_assert() {
<%self:impl_trait style_struct_name="InheritedText"
skip_longhands="text-align text-emphasis-style text-shadow line-height letter-spacing word-spacing
-webkit-text-stroke-width">
-webkit-text-stroke-width text-emphasis-position">
<% text_align_keyword = Keyword("text-align", "start end left right center justify -moz-center -moz-left " +
"-moz-right match-parent") %>
@ -2310,6 +2310,26 @@ fn static_assert() {
}
}
pub fn set_text_emphasis_position(&mut self, v: longhands::text_emphasis_position::computed_value::T) {
use properties::longhands::text_emphasis_position::*;
let mut result = match v.0 {
HorizontalWritingModeValue::Over => structs::NS_STYLE_TEXT_EMPHASIS_POSITION_OVER as u8,
HorizontalWritingModeValue::Under => structs::NS_STYLE_TEXT_EMPHASIS_POSITION_UNDER as u8,
};
match v.1 {
VerticalWritingModeValue::Right => {
result |= structs::NS_STYLE_TEXT_EMPHASIS_POSITION_RIGHT as u8;
}
VerticalWritingModeValue::Left => {
result |= structs::NS_STYLE_TEXT_EMPHASIS_POSITION_LEFT as u8;
}
}
self.gecko.mTextEmphasisPosition = result;
}
<%call expr="impl_simple_copy('text_emphasis_position', 'mTextEmphasisPosition')"></%call>
pub fn set_text_emphasis_style(&mut self, v: longhands::text_emphasis_style::computed_value::T) {
use nsstring::nsCString;
use properties::longhands::text_emphasis_style::computed_value::T;

View file

@ -973,7 +973,7 @@ ${helpers.single_keyword("text-align-last",
}
</%helpers:longhand>
<%helpers:longhand name="text-emphasis-position" animatable="False" products="none"
<%helpers:longhand name="text-emphasis-position" animatable="False" products="gecko"
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-emphasis-position">
use std::fmt;
use values::computed::ComputedValueAsSpecified;
@ -1070,6 +1070,7 @@ ${helpers.predefined_type(
}
</%helpers:longhand>
// CSS Ruby Layout Module Level 1
// https://drafts.csswg.org/css-ruby/
${helpers.single_keyword("ruby-align", "start center space-between space-around",