Auto merge of #10628 - KiChjang:extra-gecko-values, r=bholley

Add missing gecko keyword values to styles

Not sure if I caught them all.
Part of #10408.

r? @bholley

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10628)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-04-17 01:28:31 +05:30
commit cc32c66e28
2 changed files with 13 additions and 10 deletions

View file

@ -55,8 +55,8 @@ class Keyword(object):
self.name = name self.name = name
self.values = values self.values = values
self.gecko_constant_prefix = gecko_constant_prefix or "NS_STYLE_" + self.name.upper().replace("-", "_") self.gecko_constant_prefix = gecko_constant_prefix or "NS_STYLE_" + self.name.upper().replace("-", "_")
self.extra_gecko_values = extra_gecko_values or [] self.extra_gecko_values = (extra_gecko_values or "").split()
self.extra_servo_values = extra_servo_values or [] self.extra_servo_values = (extra_servo_values or "").split()
def gecko_values(self): def gecko_values(self):
return self.values + self.extra_gecko_values return self.values + self.extra_gecko_values
def servo_values(self): def servo_values(self):
@ -178,7 +178,7 @@ pub mod longhands {
<%def name="raw_longhand(name, **kwargs)"> <%def name="raw_longhand(name, **kwargs)">
<% <%
products = kwargs.pop("products", "gecko,servo") products = kwargs.pop("products", "gecko servo").split()
if not CONFIG["product"] in products: if not CONFIG["product"] in products:
return "" return ""
@ -350,7 +350,7 @@ pub mod longhands {
</%call> </%call>
</%def> </%def>
<%def name="predefined_type(name, type, initial_value, parse_method='parse', products='gecko,servo')"> <%def name="predefined_type(name, type, initial_value, parse_method='parse', products='gecko servo')">
<%self:longhand name="${name}" products="${products}"> <%self:longhand name="${name}" products="${products}">
#[allow(unused_imports)] #[allow(unused_imports)]
use app_units::Au; use app_units::Au;
@ -587,7 +587,7 @@ pub mod longhands {
</%self:longhand> </%self:longhand>
${single_keyword("position", "static absolute relative fixed")} ${single_keyword("position", "static absolute relative fixed", extra_gecko_values="sticky")}
<%self:single_keyword_computed name="float" values="none left right" gecko_ffi_name="mFloats"> <%self:single_keyword_computed name="float" values="none left right" gecko_ffi_name="mFloats">
impl ToComputedValue for SpecifiedValue { impl ToComputedValue for SpecifiedValue {
@ -965,7 +965,8 @@ pub mod longhands {
${switch_to_style_struct("InheritedBox")} ${switch_to_style_struct("InheritedBox")}
// TODO: collapse. Well, do tables first. // TODO: collapse. Well, do tables first.
${single_keyword("visibility", "visible hidden", gecko_ffi_name="mVisible")} ${single_keyword("visibility", "visible hidden", extra_gecko_values="collapse",
gecko_ffi_name="mVisible")}
// CSS 2.1, Section 12 - Generated content, automatic numbering, and lists // CSS 2.1, Section 12 - Generated content, automatic numbering, and lists
@ -2234,7 +2235,8 @@ pub mod longhands {
gecko_constant_prefix="NS_STYLE_WORDWRAP")} gecko_constant_prefix="NS_STYLE_WORDWRAP")}
// TODO(pcwalton): Support `word-break: keep-all` once we have better CJK support. // TODO(pcwalton): Support `word-break: keep-all` once we have better CJK support.
${single_keyword("word-break", "normal break-all", gecko_constant_prefix="NS_STYLE_WORDBREAK")} ${single_keyword("word-break", "normal break-all", extra_gecko_values="keep-all",
gecko_constant_prefix="NS_STYLE_WORDBREAK")}
// TODO(pcwalton): Support `text-justify: distribute`. // TODO(pcwalton): Support `text-justify: distribute`.
${single_keyword("text-justify", "auto none inter-word", products="servo")} ${single_keyword("text-justify", "auto none inter-word", products="servo")}
@ -2461,7 +2463,8 @@ pub mod longhands {
</%self:single_keyword_computed> </%self:single_keyword_computed>
// TODO(pcwalton): `full-width` // TODO(pcwalton): `full-width`
${single_keyword("text-transform", "none capitalize uppercase lowercase")} ${single_keyword("text-transform", "none capitalize uppercase lowercase",
extra_gecko_values="full-width")}
${single_keyword("text-rendering", "auto optimizespeed optimizelegibility geometricprecision")} ${single_keyword("text-rendering", "auto optimizespeed optimizelegibility geometricprecision")}
@ -2486,7 +2489,7 @@ pub mod longhands {
${single_keyword("empty-cells", "show hide", gecko_constant_prefix="NS_STYLE_TABLE_EMPTY_CELLS")} ${single_keyword("empty-cells", "show hide", gecko_constant_prefix="NS_STYLE_TABLE_EMPTY_CELLS")}
${single_keyword("caption-side", "top bottom")} ${single_keyword("caption-side", "top bottom", extra_gecko_values="right left top-outside bottom-outside")}
<%self:longhand name="border-spacing"> <%self:longhand name="border-spacing">
use app_units::Au; use app_units::Au;

View file

@ -181,7 +181,7 @@ impl Debug for ${style_struct.gecko_ffi_name} {
# Enum class instead of NS_STYLE_... # Enum class instead of NS_STYLE_...
force_stub += ["box-sizing"] force_stub += ["box-sizing"]
# Inconsistent constant naming in gecko # Inconsistent constant naming in gecko
force_stub += ["unicode-bidi"] force_stub += ["unicode-bidi", "text-transform"]
# Need to figure out why servo has sideways-left computed value and gecko doesn't # Need to figure out why servo has sideways-left computed value and gecko doesn't
force_stub += ["text-orientation"] force_stub += ["text-orientation"]
# Automatic mapping generates NS_STYLE_TEXT_DECORATION_STYLE__MOZ_NONE instead of # Automatic mapping generates NS_STYLE_TEXT_DECORATION_STYLE__MOZ_NONE instead of