Auto merge of #17262 - Manishearth:bindings, r=Manishearth

Update bindings for StyleImageLayerRepeat

https://bugzilla.mozilla.org/show_bug.cgi?id=1371354

<!-- 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/17262)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-06-09 15:56:10 -07:00 committed by GitHub
commit ff17af064b
3 changed files with 32 additions and 29 deletions

View file

@ -2928,25 +2928,22 @@ fn static_assert() {
<%self:simple_image_array_property name="repeat" shorthand="${shorthand}" field_name="mRepeat">
use properties::longhands::${shorthand}_repeat::single_value::computed_value::RepeatKeyword;
use gecko_bindings::structs::nsStyleImageLayers_Repeat;
use gecko_bindings::structs::NS_STYLE_IMAGELAYER_REPEAT_REPEAT;
use gecko_bindings::structs::NS_STYLE_IMAGELAYER_REPEAT_NO_REPEAT;
use gecko_bindings::structs::NS_STYLE_IMAGELAYER_REPEAT_SPACE;
use gecko_bindings::structs::NS_STYLE_IMAGELAYER_REPEAT_ROUND;
use gecko_bindings::structs::StyleImageLayerRepeat;
fn to_ns(repeat: RepeatKeyword) -> u32 {
fn to_ns(repeat: RepeatKeyword) -> StyleImageLayerRepeat {
match repeat {
RepeatKeyword::Repeat => NS_STYLE_IMAGELAYER_REPEAT_REPEAT,
RepeatKeyword::Space => NS_STYLE_IMAGELAYER_REPEAT_SPACE,
RepeatKeyword::Round => NS_STYLE_IMAGELAYER_REPEAT_ROUND,
RepeatKeyword::NoRepeat => NS_STYLE_IMAGELAYER_REPEAT_NO_REPEAT,
RepeatKeyword::Repeat => StyleImageLayerRepeat::Repeat,
RepeatKeyword::Space => StyleImageLayerRepeat::Space,
RepeatKeyword::Round => StyleImageLayerRepeat::Round,
RepeatKeyword::NoRepeat => StyleImageLayerRepeat::NoRepeat,
}
}
let repeat_x = to_ns(servo.0);
let repeat_y = to_ns(servo.1);
nsStyleImageLayers_Repeat {
mXRepeat: repeat_x as u8,
mYRepeat: repeat_y as u8,
mXRepeat: repeat_x,
mYRepeat: repeat_y,
}
</%self:simple_image_array_property>