From 878b9a4db3969eddb8709d2743ab2845088c67af Mon Sep 17 00:00:00 2001 From: Jeff Hajewski Date: Thu, 1 Jun 2017 13:39:44 -0700 Subject: [PATCH] Use enum class for white-space --- .../style/gecko/generated/structs_debug.rs | 18 +++++++++++------- .../style/gecko/generated/structs_release.rs | 18 +++++++++++------- .../properties/longhand/inherited_text.mako.rs | 2 +- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/components/style/gecko/generated/structs_debug.rs b/components/style/gecko/generated/structs_debug.rs index 8c743d31ac9..a35c6a7d301 100644 --- a/components/style/gecko/generated/structs_debug.rs +++ b/components/style/gecko/generated/structs_debug.rs @@ -715,12 +715,6 @@ pub mod root { pub const NS_STYLE_VISIBILITY_VISIBLE: ::std::os::raw::c_uint = 1; pub const NS_STYLE_VISIBILITY_COLLAPSE: ::std::os::raw::c_uint = 2; pub const NS_STYLE_TABSIZE_INITIAL: ::std::os::raw::c_uint = 8; - pub const NS_STYLE_WHITESPACE_NORMAL: ::std::os::raw::c_uint = 0; - pub const NS_STYLE_WHITESPACE_PRE: ::std::os::raw::c_uint = 1; - pub const NS_STYLE_WHITESPACE_NOWRAP: ::std::os::raw::c_uint = 2; - pub const NS_STYLE_WHITESPACE_PRE_WRAP: ::std::os::raw::c_uint = 3; - pub const NS_STYLE_WHITESPACE_PRE_LINE: ::std::os::raw::c_uint = 4; - pub const NS_STYLE_WHITESPACE_PRE_SPACE: ::std::os::raw::c_uint = 5; pub const NS_STYLE_WORDBREAK_NORMAL: ::std::os::raw::c_uint = 0; pub const NS_STYLE_WORDBREAK_BREAK_ALL: ::std::os::raw::c_uint = 1; pub const NS_STYLE_WORDBREAK_KEEP_ALL: ::std::os::raw::c_uint = 2; @@ -6200,6 +6194,16 @@ pub mod root { #[repr(u8)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum StyleGridTrackBreadth { MaxContent = 1, MinContent = 2, } + #[repr(u8)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum StyleWhiteSpace { + Normal = 0, + Pre = 1, + Nowrap = 2, + PreWrap = 3, + PreLine = 4, + PreSpace = 5, + } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct WritingMode { @@ -30352,7 +30356,7 @@ pub mod root { pub _bitfield_1: u8, pub mTextJustify: root::mozilla::StyleTextJustify, pub mTextTransform: u8, - pub mWhiteSpace: u8, + pub mWhiteSpace: root::mozilla::StyleWhiteSpace, pub mWordBreak: u8, pub mOverflowWrap: u8, pub mHyphens: root::mozilla::StyleHyphens, diff --git a/components/style/gecko/generated/structs_release.rs b/components/style/gecko/generated/structs_release.rs index 42ae3d89bc6..2312d3214e0 100644 --- a/components/style/gecko/generated/structs_release.rs +++ b/components/style/gecko/generated/structs_release.rs @@ -715,12 +715,6 @@ pub mod root { pub const NS_STYLE_VISIBILITY_VISIBLE: ::std::os::raw::c_uint = 1; pub const NS_STYLE_VISIBILITY_COLLAPSE: ::std::os::raw::c_uint = 2; pub const NS_STYLE_TABSIZE_INITIAL: ::std::os::raw::c_uint = 8; - pub const NS_STYLE_WHITESPACE_NORMAL: ::std::os::raw::c_uint = 0; - pub const NS_STYLE_WHITESPACE_PRE: ::std::os::raw::c_uint = 1; - pub const NS_STYLE_WHITESPACE_NOWRAP: ::std::os::raw::c_uint = 2; - pub const NS_STYLE_WHITESPACE_PRE_WRAP: ::std::os::raw::c_uint = 3; - pub const NS_STYLE_WHITESPACE_PRE_LINE: ::std::os::raw::c_uint = 4; - pub const NS_STYLE_WHITESPACE_PRE_SPACE: ::std::os::raw::c_uint = 5; pub const NS_STYLE_WORDBREAK_NORMAL: ::std::os::raw::c_uint = 0; pub const NS_STYLE_WORDBREAK_BREAK_ALL: ::std::os::raw::c_uint = 1; pub const NS_STYLE_WORDBREAK_KEEP_ALL: ::std::os::raw::c_uint = 2; @@ -6068,6 +6062,16 @@ pub mod root { #[repr(u8)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum StyleGridTrackBreadth { MaxContent = 1, MinContent = 2, } + #[repr(u8)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum StyleWhiteSpace { + Normal = 0, + Pre = 1, + Nowrap = 2, + PreWrap = 3, + PreLine = 4, + PreSpace = 5, + } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct WritingMode { @@ -29833,7 +29837,7 @@ pub mod root { pub _bitfield_1: u8, pub mTextJustify: root::mozilla::StyleTextJustify, pub mTextTransform: u8, - pub mWhiteSpace: u8, + pub mWhiteSpace: root::mozilla::StyleWhiteSpace, pub mWordBreak: u8, pub mOverflowWrap: u8, pub mHyphens: root::mozilla::StyleHyphens, diff --git a/components/style/properties/longhand/inherited_text.mako.rs b/components/style/properties/longhand/inherited_text.mako.rs index 6b106016634..7b58342a397 100644 --- a/components/style/properties/longhand/inherited_text.mako.rs +++ b/components/style/properties/longhand/inherited_text.mako.rs @@ -635,7 +635,7 @@ ${helpers.single_keyword("text-align-last", <%helpers:single_keyword_computed name="white-space" values="normal pre nowrap pre-wrap pre-line" extra_gecko_values="-moz-pre-space" - gecko_constant_prefix="NS_STYLE_WHITESPACE" + gecko_enum_prefix="StyleWhiteSpace" needs_conversion="True" animation_value_type="none" spec="https://drafts.csswg.org/css-text/#propdef-white-space">