Skip to content

Commit

Permalink
style: Make text-orientation:sideways-right an alias.
Browse files Browse the repository at this point in the history
Gecko does not preserve this specified value; it converts it to sideways
at parse time.
  • Loading branch information
heycam committed Apr 17, 2017
1 parent 35c8836 commit 221aa87
Showing 1 changed file with 7 additions and 36 deletions.
43 changes: 7 additions & 36 deletions components/style/properties/longhand/inherited_box.mako.rs
Expand Up @@ -31,42 +31,13 @@ ${helpers.single_keyword("direction", "ltr rtl", need_clone=True, animation_type
spec="https://drafts.csswg.org/css-writing-modes/#propdef-direction",
needs_conversion=True)}

<%helpers:single_keyword_computed
name="text-orientation"
values="mixed upright sideways"
extra_specified="sideways-right"
products="gecko"
need_clone="True"
animation_type="none"
spec="https://drafts.csswg.org/css-writing-modes/#propdef-text-orientation"
>
use values::HasViewportPercentage;
no_viewport_percentage!(SpecifiedValue);

impl ToComputedValue for SpecifiedValue {
type ComputedValue = computed_value::T;

#[inline]
fn to_computed_value(&self, _: &Context) -> computed_value::T {
match *self {
% for value in "mixed upright sideways".split():
SpecifiedValue::${value} => computed_value::T::${value},
% endfor
// https://drafts.csswg.org/css-writing-modes-3/#valdef-text-orientation-sideways-right
SpecifiedValue::sideways_right => computed_value::T::sideways,
}
}

#[inline]
fn from_computed_value(computed: &computed_value::T) -> SpecifiedValue {
match *computed {
% for value in "mixed upright sideways".split():
computed_value::T::${value} => SpecifiedValue::${value},
% endfor
}
}
}
</%helpers:single_keyword_computed>
${helpers.single_keyword("text-orientation",
"mixed upright sideways",
extra_gecko_aliases="sideways-right=sideways",
products="gecko",
need_clone=True,
animation_type="none",
spec="https://drafts.csswg.org/css-writing-modes/#propdef-text-orientation")}

// CSS Color Module Level 4
// https://drafts.csswg.org/css-color/
Expand Down

0 comments on commit 221aa87

Please sign in to comment.