mirror of
https://github.com/servo/servo.git
synced 2025-08-19 12:25:33 +01:00
style: Update bindgen to 0.31.3.
Constified enums are default now. I think I want to introduce an option to bindgen to allow setting the default enum behavior, but it doesn't need to block this. The ServoBindings.toml changes are somewhat hacky, but that's because of https://github.com/rust-lang-nursery/rust-bindgen/issues/1125. Also, the fixups now need to account for whitespace, since quote generates stuff like root :: nsString, and we don't rustfmt the bindings if there's no rustfmt installed. Bug: 1412486 Reviewed-by: xidorn MozReview-Commit-ID: EY5eNnCiTIw
This commit is contained in:
parent
b5f8edc4ae
commit
b721215a00
5 changed files with 60 additions and 128 deletions
|
@ -4486,11 +4486,11 @@ fn static_assert() {
|
|||
}
|
||||
|
||||
pub fn clone_image_orientation(&self) -> longhands::image_orientation::computed_value::T {
|
||||
use gecko_bindings::structs::{nsStyleImageOrientation_Bits, nsStyleImageOrientation_Angles};
|
||||
use gecko_bindings::structs::nsStyleImageOrientation_Angles;
|
||||
use properties::longhands::image_orientation::computed_value::{Orientation, T};
|
||||
|
||||
let gecko_orientation = self.gecko.mImageOrientation.mOrientation;
|
||||
if gecko_orientation & nsStyleImageOrientation_Bits::FROM_IMAGE_MASK as u8 != 0 {
|
||||
if gecko_orientation & structs::nsStyleImageOrientation_Bits_FROM_IMAGE_MASK as u8 != 0 {
|
||||
T::FromImage
|
||||
} else {
|
||||
const ANGLE0: u8 = nsStyleImageOrientation_Angles::ANGLE_0 as u8;
|
||||
|
@ -4498,14 +4498,15 @@ fn static_assert() {
|
|||
const ANGLE180: u8 = nsStyleImageOrientation_Angles::ANGLE_180 as u8;
|
||||
const ANGLE270: u8 = nsStyleImageOrientation_Angles::ANGLE_270 as u8;
|
||||
|
||||
let flip = gecko_orientation & nsStyleImageOrientation_Bits::FLIP_MASK as u8 != 0;
|
||||
let orientation = match gecko_orientation & nsStyleImageOrientation_Bits::ORIENTATION_MASK as u8 {
|
||||
ANGLE0 => Orientation::Angle0,
|
||||
ANGLE90 => Orientation::Angle90,
|
||||
ANGLE180 => Orientation::Angle180,
|
||||
ANGLE270 => Orientation::Angle270,
|
||||
_ => unreachable!()
|
||||
};
|
||||
let flip = gecko_orientation & structs::nsStyleImageOrientation_Bits_FLIP_MASK as u8 != 0;
|
||||
let orientation =
|
||||
match gecko_orientation & structs::nsStyleImageOrientation_Bits_ORIENTATION_MASK as u8 {
|
||||
ANGLE0 => Orientation::Angle0,
|
||||
ANGLE90 => Orientation::Angle90,
|
||||
ANGLE180 => Orientation::Angle180,
|
||||
ANGLE270 => Orientation::Angle270,
|
||||
_ => unreachable!()
|
||||
};
|
||||
T::AngleWithFlipped(orientation, flip)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue