From 28d8565f385c29df84f5162a507c9498b750b44f Mon Sep 17 00:00:00 2001 From: Martin McNickle Date: Fri, 14 Feb 2020 15:48:10 +0000 Subject: [PATCH] style: Use the cbindgen output for GridAutoFlow directly in gecko. Depends on D62787 Differential Revision: https://phabricator.services.mozilla.com/D62910 --- components/style/values/specified/position.rs | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/components/style/values/specified/position.rs b/components/style/values/specified/position.rs index ff8cfade968..a3463315ef7 100644 --- a/components/style/values/specified/position.rs +++ b/components/style/values/specified/position.rs @@ -7,7 +7,6 @@ //! //! [position]: https://drafts.csswg.org/css-backgrounds-3/#position -use crate::gecko_bindings::structs; use crate::parser::{Parse, ParserContext}; use crate::selector_map::PrecomputedHashMap; use crate::str::HTML_SPACE_CHARACTERS; @@ -362,13 +361,14 @@ bitflags! { ToShmem )] #[value_info(other_values = "row,column,dense")] + #[repr(C)] pub struct GridAutoFlow: u8 { /// 'row' - mutually exclusive with 'column' - const ROW = structs::NS_STYLE_GRID_AUTO_FLOW_ROW as u8; + const ROW = 1 << 0; /// 'column' - mutually exclusive with 'row' - const COLUMN = structs::NS_STYLE_GRID_AUTO_FLOW_COLUMN as u8; + const COLUMN = 1 << 1; /// 'dense' - const DENSE = structs::NS_STYLE_GRID_AUTO_FLOW_DENSE as u8; + const DENSE = 1 << 2; } } @@ -439,20 +439,6 @@ impl ToCss for GridAutoFlow { } } -#[cfg(feature = "gecko")] -impl From for GridAutoFlow { - fn from(bits: u8) -> GridAutoFlow { - GridAutoFlow::from_bits(bits).unwrap() - } -} - -#[cfg(feature = "gecko")] -impl From for u8 { - fn from(v: GridAutoFlow) -> u8 { - v.bits - } -} - #[derive( Clone, Debug,