style: Remove ComputedStyle::mBits.

Use the Servo flags instead.

Differential Revision: https://phabricator.services.mozilla.com/D20729
This commit is contained in:
Emilio Cobos Álvarez 2019-03-19 21:10:30 +00:00
parent ed4a23eccf
commit cf5a2acdf1

View file

@ -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);
}