From cf5a2acdf17097d67defe3d989aaa3306516bc05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 19 Mar 2019 21:10:30 +0000 Subject: [PATCH] style: Remove ComputedStyle::mBits. Use the Servo flags instead. Differential Revision: https://phabricator.services.mozilla.com/D20729 --- .../style/properties/computed_value_flags.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/components/style/properties/computed_value_flags.rs b/components/style/properties/computed_value_flags.rs index 2f6851d3f43..a86f8a4da3a 100644 --- a/components/style/properties/computed_value_flags.rs +++ b/components/style/properties/computed_value_flags.rs @@ -97,3 +97,22 @@ impl ComputedValueFlags { self & Self::maybe_inherited_flags() } } + +/// Asserts that the relevant servo and Gecko representations match. +#[cfg(feature = "gecko")] +#[inline] +pub fn assert_match() { + use crate::gecko_bindings::structs; + macro_rules! assert_bit { + ($rust:ident, $cpp:ident) => { + debug_assert_eq!(ComputedValueFlags::$rust.bits, structs::$cpp); + } + } + + assert_bit!(HAS_TEXT_DECORATION_LINES, ComputedStyleBit_HasTextDecorationLines); + assert_bit!(IS_IN_PSEUDO_ELEMENT_SUBTREE, ComputedStyleBit_HasPseudoElementData); + assert_bit!(SHOULD_SUPPRESS_LINEBREAK, ComputedStyleBit_SuppressLineBreak); + assert_bit!(IS_TEXT_COMBINED, ComputedStyleBit_IsTextCombined); + assert_bit!(IS_RELEVANT_LINK_VISITED, ComputedStyleBit_RelevantLinkVisited); + assert_bit!(DEPENDS_ON_FONT_METRICS, ComputedStyleBit_DependsOnFontMetrics); +}