mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
stylo: Implement text-emphasis-position
MozReview-Commit-ID: Lg9kDrZJpXl
This commit is contained in:
parent
2410591119
commit
30deaab48a
2 changed files with 23 additions and 2 deletions
|
@ -2204,7 +2204,7 @@ fn static_assert() {
|
||||||
|
|
||||||
<%self:impl_trait style_struct_name="InheritedText"
|
<%self:impl_trait style_struct_name="InheritedText"
|
||||||
skip_longhands="text-align text-emphasis-style text-shadow line-height letter-spacing word-spacing
|
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 " +
|
<% text_align_keyword = Keyword("text-align", "start end left right center justify -moz-center -moz-left " +
|
||||||
"-moz-right match-parent") %>
|
"-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) {
|
pub fn set_text_emphasis_style(&mut self, v: longhands::text_emphasis_style::computed_value::T) {
|
||||||
use nsstring::nsCString;
|
use nsstring::nsCString;
|
||||||
use properties::longhands::text_emphasis_style::computed_value::T;
|
use properties::longhands::text_emphasis_style::computed_value::T;
|
||||||
|
|
|
@ -973,7 +973,7 @@ ${helpers.single_keyword("text-align-last",
|
||||||
}
|
}
|
||||||
</%helpers:longhand>
|
</%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">
|
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-emphasis-position">
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use values::computed::ComputedValueAsSpecified;
|
use values::computed::ComputedValueAsSpecified;
|
||||||
|
@ -1070,6 +1070,7 @@ ${helpers.predefined_type(
|
||||||
}
|
}
|
||||||
</%helpers:longhand>
|
</%helpers:longhand>
|
||||||
|
|
||||||
|
|
||||||
// CSS Ruby Layout Module Level 1
|
// CSS Ruby Layout Module Level 1
|
||||||
// https://drafts.csswg.org/css-ruby/
|
// https://drafts.csswg.org/css-ruby/
|
||||||
${helpers.single_keyword("ruby-align", "start center space-between space-around",
|
${helpers.single_keyword("ruby-align", "start center space-between space-around",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue