From 37c2d4d30a55a61c6f06cea4366e85a25fdbcead Mon Sep 17 00:00:00 2001 From: Ben Freist Date: Wed, 7 Dec 2022 09:58:22 +0000 Subject: [PATCH] style: [refactor] Migrate NS_STYLE_LIST_STYLE_* defines Differential Revision: https://phabricator.services.mozilla.com/D163792 --- components/style/values/specified/list.rs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/components/style/values/specified/list.rs b/components/style/values/specified/list.rs index ff21eb5115e..693471e4782 100644 --- a/components/style/values/specified/list.rs +++ b/components/style/values/specified/list.rs @@ -50,20 +50,21 @@ impl ListStyleType { /// attribute is considered here. pub fn from_gecko_keyword(value: u32) -> Self { use crate::gecko_bindings::structs; + let v8 = value as u8; - if value == structs::NS_STYLE_LIST_STYLE_NONE { + if v8 == structs::ListStyle_None { return ListStyleType::None; } - ListStyleType::CounterStyle(CounterStyle::Name(CustomIdent(match value { - structs::NS_STYLE_LIST_STYLE_DISC => atom!("disc"), - structs::NS_STYLE_LIST_STYLE_CIRCLE => atom!("circle"), - structs::NS_STYLE_LIST_STYLE_SQUARE => atom!("square"), - structs::NS_STYLE_LIST_STYLE_DECIMAL => atom!("decimal"), - structs::NS_STYLE_LIST_STYLE_LOWER_ROMAN => atom!("lower-roman"), - structs::NS_STYLE_LIST_STYLE_UPPER_ROMAN => atom!("upper-roman"), - structs::NS_STYLE_LIST_STYLE_LOWER_ALPHA => atom!("lower-alpha"), - structs::NS_STYLE_LIST_STYLE_UPPER_ALPHA => atom!("upper-alpha"), + ListStyleType::CounterStyle(CounterStyle::Name(CustomIdent(match v8 { + structs::ListStyle_Disc => atom!("disc"), + structs::ListStyle_Circle => atom!("circle"), + structs::ListStyle_Square => atom!("square"), + structs::ListStyle_Decimal => atom!("decimal"), + structs::ListStyle_LowerRoman => atom!("lower-roman"), + structs::ListStyle_UpperRoman => atom!("upper-roman"), + structs::ListStyle_LowerAlpha => atom!("lower-alpha"), + structs::ListStyle_UpperAlpha => atom!("upper-alpha"), _ => unreachable!("Unknown counter style keyword value"), }))) }