style: Make text-orientation:sideways-right an alias.

Gecko does not preserve this specified value; it converts it to sideways
at parse time.
This commit is contained in:
Cameron McCormack 2017-04-16 18:26:27 +10:00
parent 35c88367cb
commit 221aa87650

View file

@ -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", spec="https://drafts.csswg.org/css-writing-modes/#propdef-direction",
needs_conversion=True)} needs_conversion=True)}
<%helpers:single_keyword_computed ${helpers.single_keyword("text-orientation",
name="text-orientation" "mixed upright sideways",
values="mixed upright sideways" extra_gecko_aliases="sideways-right=sideways",
extra_specified="sideways-right" products="gecko",
products="gecko" need_clone=True,
need_clone="True" animation_type="none",
animation_type="none" spec="https://drafts.csswg.org/css-writing-modes/#propdef-text-orientation")}
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>
// CSS Color Module Level 4 // CSS Color Module Level 4
// https://drafts.csswg.org/css-color/ // https://drafts.csswg.org/css-color/