diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-03-31 06:01:06 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-31 06:01:06 -0500 |
commit | 955d3a8b8746b5060d421253263cf9bb05808866 (patch) | |
tree | bc59fb0e33cac56d3dcffc57bf2574ae68e4b82c | |
parent | a70e4ac5b25251ca1c05e8eced12f2aefea4410d (diff) | |
parent | 59115431fb11e7527cec6dbdb23eb9354a7c4402 (diff) | |
download | servo-955d3a8b8746b5060d421253263cf9bb05808866.tar.gz servo-955d3a8b8746b5060d421253263cf9bb05808866.zip |
Auto merge of #16201 - Manishearth:text-emph-pos, r=emilio
stylo: Handle text-emphasis-position pres attrs
Somehow slipped through the cracks.
try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=e1d349e847b528be3d61ad2ebf374a791800cfbb
<!-- 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/16201)
<!-- Reviewable:end -->
-rw-r--r-- | components/style/properties/longhand/inherited_text.mako.rs | 22 | ||||
-rw-r--r-- | ports/geckolib/glue.rs | 1 |
2 files changed, 23 insertions, 0 deletions
diff --git a/components/style/properties/longhand/inherited_text.mako.rs b/components/style/properties/longhand/inherited_text.mako.rs index 1ff10a50662..b24cdbbcacf 100644 --- a/components/style/properties/longhand/inherited_text.mako.rs +++ b/components/style/properties/longhand/inherited_text.mako.rs @@ -1076,6 +1076,28 @@ ${helpers.single_keyword("text-align-last", vertical.to_css(dest) } } + + % if product == "gecko": + impl SpecifiedValue { + pub fn from_gecko_keyword(kw: u32) -> Self { + use gecko_bindings::structs; + + let vert = if kw & structs::NS_STYLE_TEXT_EMPHASIS_POSITION_RIGHT != 0 { + VerticalWritingModeValue::Right + } else { + debug_assert!(kw & structs::NS_STYLE_TEXT_EMPHASIS_POSITION_LEFT != 0); + VerticalWritingModeValue::Left + }; + let horiz = if kw & structs::NS_STYLE_TEXT_EMPHASIS_POSITION_OVER != 0 { + HorizontalWritingModeValue::Over + } else { + debug_assert!(kw & structs::NS_STYLE_TEXT_EMPHASIS_POSITION_UNDER != 0); + HorizontalWritingModeValue::Under + }; + SpecifiedValue(horiz, vert) + } + } + % endif </%helpers:longhand> ${helpers.predefined_type("text-emphasis-color", "CSSColor", diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 1ce2e02b216..455aaaf41d2 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -1148,6 +1148,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetKeywordValue(declarations: Float => longhands::float::SpecifiedValue::from_gecko_keyword(value), VerticalAlign => longhands::vertical_align::SpecifiedValue::from_gecko_keyword(value), TextAlign => longhands::text_align::SpecifiedValue::from_gecko_keyword(value), + TextEmphasisPosition => longhands::text_emphasis_position::SpecifiedValue::from_gecko_keyword(value), Clear => longhands::clear::SpecifiedValue::from_gecko_keyword(value), FontSize => { // We rely on Gecko passing in font-size values (0...7) here. |