aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-08-10 16:17:12 -0500
committerGitHub <noreply@github.com>2016-08-10 16:17:12 -0500
commit0f1a9f109deedfa9c059da1ee7413f0894503fba (patch)
tree362a8a4fc1f0353573c68187ffab3d1dbf00d632 /components
parent7afe0376259e7460461410da03523ebec2f86c8f (diff)
parent7f417728d4044818d115b40c2afc44d314cd2956 (diff)
downloadservo-0f1a9f109deedfa9c059da1ee7413f0894503fba.tar.gz
servo-0f1a9f109deedfa9c059da1ee7413f0894503fba.zip
Auto merge of #12803 - bholley:regen_bindings, r=emilio
stylo: regenerate bindings <!-- 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/12803) <!-- Reviewable:end -->
Diffstat (limited to 'components')
-rw-r--r--components/style/properties/data.py3
-rw-r--r--components/style/properties/gecko.mako.rs10
-rw-r--r--components/style/properties/longhand/box.mako.rs1
3 files changed, 7 insertions, 7 deletions
diff --git a/components/style/properties/data.py b/components/style/properties/data.py
index 7c63356ca22..400b054ba74 100644
--- a/components/style/properties/data.py
+++ b/components/style/properties/data.py
@@ -58,6 +58,9 @@ class Keyword(object):
def needs_cast(self):
return self.gecko_enum_prefix is None
+ def maybe_cast(self, type_str):
+ return "as " + type_str if self.needs_cast() else ""
+
class Longhand(object):
def __init__(self, style_struct, name, animatable=None, derived_from=None, keyword=None,
diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs
index 3037f78cd98..4ebe4a5a12a 100644
--- a/components/style/properties/gecko.mako.rs
+++ b/components/style/properties/gecko.mako.rs
@@ -220,11 +220,7 @@ def set_gecko_property(ffi_name, expr):
// FIXME(bholley): Align binary representations and ditch |match| for cast + static_asserts
let result = match v {
% for value in keyword.values_for('gecko'):
- % if keyword.needs_cast():
- Keyword::${to_rust_ident(value)} => structs::${keyword.gecko_constant(value)} as u8,
- % else:
- Keyword::${to_rust_ident(value)} => structs::${keyword.gecko_constant(value)},
- % endif
+ Keyword::${to_rust_ident(value)} => structs::${keyword.gecko_constant(value)} ${keyword.maybe_cast("u8")},
% endfor
};
${set_gecko_property(gecko_ffi_name, "result")}
@@ -236,11 +232,11 @@ def set_gecko_property(ffi_name, expr):
pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T {
use properties::longhands::${ident}::computed_value::T as Keyword;
// FIXME(bholley): Align binary representations and ditch |match| for cast + static_asserts
- match ${get_gecko_property(gecko_ffi_name)} as u32 {
+ match ${get_gecko_property(gecko_ffi_name)} ${keyword.maybe_cast("u32")} {
% for value in keyword.values_for('gecko'):
structs::${keyword.gecko_constant(value)} => Keyword::${to_rust_ident(value)},
% endfor
- x => panic!("Found unexpected value in style struct for ${ident} property: {}", x),
+ x => panic!("Found unexpected value in style struct for ${ident} property: {:?}", x),
}
}
</%def>
diff --git a/components/style/properties/longhand/box.mako.rs b/components/style/properties/longhand/box.mako.rs
index a00f0c01393..c9639ae0a84 100644
--- a/components/style/properties/longhand/box.mako.rs
+++ b/components/style/properties/longhand/box.mako.rs
@@ -97,6 +97,7 @@ ${helpers.single_keyword("position", "static absolute relative fixed",
values="none left right"
animatable="False"
need_clone="True"
+ gecko_enum_prefix="StyleFloat"
gecko_ffi_name="mFloat">
use values::NoViewportPercentage;
impl NoViewportPercentage for SpecifiedValue {}