Handle None_ => None enum changes

This commit is contained in:
Manish Goregaokar 2016-09-09 16:34:15 +08:00
parent 957893bdc2
commit 3fe13a29f4
No known key found for this signature in database
GPG key ID: 3BBF4D3E2EF79F98
4 changed files with 17 additions and 20 deletions

View file

@ -46,9 +46,6 @@ class Keyword(object):
def gecko_constant(self, value): def gecko_constant(self, value):
if self.gecko_enum_prefix: if self.gecko_enum_prefix:
if value == "none":
return self.gecko_enum_prefix + "::None_"
else:
parts = value.replace("-moz-", "").split("-") parts = value.replace("-moz-", "").split("-")
parts = [p.title() for p in parts] parts = [p.title() for p in parts]
return self.gecko_enum_prefix + "::" + "".join(parts) return self.gecko_enum_prefix + "::" + "".join(parts)

View file

@ -1545,7 +1545,7 @@ fn static_assert() {
// clean up existing struct // clean up existing struct
unsafe { Gecko_DestroyClipPath(clip_path) }; unsafe { Gecko_DestroyClipPath(clip_path) };
clip_path.mType = StyleShapeSourceType::None_; clip_path.mType = StyleShapeSourceType::None;
match v { match v {
ShapeSource::Url(..) => println!("stylo: clip-path: url() not yet implemented"), ShapeSource::Url(..) => println!("stylo: clip-path: url() not yet implemented"),
@ -1646,7 +1646,7 @@ fn static_assert() {
let ref clip_path = self.gecko.mClipPath; let ref clip_path = self.gecko.mClipPath;
match clip_path.mType { match clip_path.mType {
StyleShapeSourceType::None_ => ShapeSource::None, StyleShapeSourceType::None => ShapeSource::None,
StyleShapeSourceType::Box => { StyleShapeSourceType::Box => {
ShapeSource::Box(clip_path.mReferenceBox.into()) ShapeSource::Box(clip_path.mReferenceBox.into())
} }

View file

@ -3956,7 +3956,7 @@ pub enum StyleBoxShadowType { Inset = 0, }
#[repr(i8)] #[repr(i8)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum StyleClear { pub enum StyleClear {
None_ = 0, None = 0,
Left = 1, Left = 1,
Right = 2, Right = 2,
InlineStart = 3, InlineStart = 3,
@ -3983,7 +3983,7 @@ pub enum StyleFillRule { Nonzero = 0, Evenodd = 1, }
#[repr(i8)] #[repr(i8)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum StyleFloat { pub enum StyleFloat {
None_ = 0, None = 0,
Left = 1, Left = 1,
Right = 2, Right = 2,
InlineStart = 3, InlineStart = 3,
@ -4003,11 +4003,11 @@ pub enum StyleShapeOutsideShapeBox {
} }
#[repr(i8)] #[repr(i8)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum StyleShapeSourceType { None_ = 0, URL = 1, Shape = 2, Box = 3, } pub enum StyleShapeSourceType { None = 0, URL = 1, Shape = 2, Box = 3, }
#[repr(i8)] #[repr(i8)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum StyleUserFocus { pub enum StyleUserFocus {
None_ = 0, None = 0,
Ignore = 1, Ignore = 1,
Normal = 2, Normal = 2,
SelectAll = 3, SelectAll = 3,
@ -4019,7 +4019,7 @@ pub enum StyleUserFocus {
#[repr(i8)] #[repr(i8)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum StyleUserSelect { pub enum StyleUserSelect {
None_ = 0, None = 0,
Text = 1, Text = 1,
Element = 2, Element = 2,
Elements = 3, Elements = 3,
@ -4033,7 +4033,7 @@ pub enum StyleUserSelect {
#[repr(i8)] #[repr(i8)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum StyleDisplay { pub enum StyleDisplay {
None_ = 0, None = 0,
Block = 1, Block = 1,
Inline = 2, Inline = 2,
InlineBlock = 3, InlineBlock = 3,

View file

@ -3935,7 +3935,7 @@ pub enum StyleBoxShadowType { Inset = 0, }
#[repr(i8)] #[repr(i8)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum StyleClear { pub enum StyleClear {
None_ = 0, None = 0,
Left = 1, Left = 1,
Right = 2, Right = 2,
InlineStart = 3, InlineStart = 3,
@ -3962,7 +3962,7 @@ pub enum StyleFillRule { Nonzero = 0, Evenodd = 1, }
#[repr(i8)] #[repr(i8)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum StyleFloat { pub enum StyleFloat {
None_ = 0, None = 0,
Left = 1, Left = 1,
Right = 2, Right = 2,
InlineStart = 3, InlineStart = 3,
@ -3982,11 +3982,11 @@ pub enum StyleShapeOutsideShapeBox {
} }
#[repr(i8)] #[repr(i8)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum StyleShapeSourceType { None_ = 0, URL = 1, Shape = 2, Box = 3, } pub enum StyleShapeSourceType { None = 0, URL = 1, Shape = 2, Box = 3, }
#[repr(i8)] #[repr(i8)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum StyleUserFocus { pub enum StyleUserFocus {
None_ = 0, None = 0,
Ignore = 1, Ignore = 1,
Normal = 2, Normal = 2,
SelectAll = 3, SelectAll = 3,
@ -3998,7 +3998,7 @@ pub enum StyleUserFocus {
#[repr(i8)] #[repr(i8)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum StyleUserSelect { pub enum StyleUserSelect {
None_ = 0, None = 0,
Text = 1, Text = 1,
Element = 2, Element = 2,
Elements = 3, Elements = 3,
@ -4012,7 +4012,7 @@ pub enum StyleUserSelect {
#[repr(i8)] #[repr(i8)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum StyleDisplay { pub enum StyleDisplay {
None_ = 0, None = 0,
Block = 1, Block = 1,
Inline = 2, Inline = 2,
InlineBlock = 3, InlineBlock = 3,