style: Make text-orientation:sideways-right an alias. draft
authorCameron McCormack <cam@mcc.id.au>
Sun, 16 Apr 2017 18:26:27 +1000
changeset 563361 84f52a983b3806eacc71745b87a55c3c201a4b94
parent 563360 aa68bf9a47751f15b5bc5ba2cffab8059e91cf6d
child 563362 f521cc2130f4510bdc3f5fa3c6750668233d6297
push id54263
push userbmo:cam@mcc.id.au
push dateSun, 16 Apr 2017 12:18:03 +0000
milestone55.0a1
style: Make text-orientation:sideways-right an alias. Gecko does not preserve this specified value; it converts it to sideways at parse time.
servo/components/style/properties/longhand/inherited_box.mako.rs
--- a/servo/components/style/properties/longhand/inherited_box.mako.rs
+++ b/servo/components/style/properties/longhand/inherited_box.mako.rs
@@ -26,52 +26,23 @@
                          need_clone=True,
                          animation_type="none",
                          spec="https://drafts.csswg.org/css-writing-modes/#propdef-writing-mode")}
 
 ${helpers.single_keyword("direction", "ltr rtl", need_clone=True, animation_type="none",
                          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/
 ${helpers.single_keyword("color-adjust",
                          "economy exact", products="gecko",
                          animation_type="none",
                          spec="https://drafts.csswg.org/css-color/#propdef-color-adjust")}