Bug 1852201 - Downgrade bitflags in the dom and style crates. r=emilio

This undoes bug 1835681, adjusting for changes that happened since then,
because the crates don't build with the real bitflags 2, and there are
some challenges to make them work with the real bitflags 2.

Differential Revision: https://phabricator.services.mozilla.com/D187748
This commit is contained in:
Mike Hommey 2023-09-10 22:27:26 +00:00
Родитель 95606652ac
Коммит 5384d789bb
40 изменённых файлов: 48 добавлений и 65 удалений

8
Cargo.lock сгенерированный
Просмотреть файл

@ -1411,7 +1411,7 @@ dependencies = [
name = "dom"
version = "0.1.0"
dependencies = [
"bitflags 2.999.999",
"bitflags 1.3.2",
]
[[package]]
@ -4811,7 +4811,7 @@ dependencies = [
name = "selectors"
version = "0.22.0"
dependencies = [
"bitflags 2.999.999",
"bitflags 1.3.2",
"cssparser",
"derive_more 0.99.999",
"fxhash",
@ -5178,7 +5178,7 @@ dependencies = [
"arrayvec",
"atomic_refcell",
"bindgen 0.66.1",
"bitflags 2.999.999",
"bitflags 1.3.2",
"byteorder",
"cssparser",
"derive_more 0.99.999",
@ -5245,7 +5245,7 @@ name = "style_traits"
version = "0.0.1"
dependencies = [
"app_units",
"bitflags 2.999.999",
"bitflags 1.3.2",
"cssparser",
"euclid",
"lazy_static",

Просмотреть файл

@ -11,4 +11,4 @@ license = "MPL-2.0"
path = "lib.rs"
[dependencies]
bitflags = "2"
bitflags = "1.0"

Просмотреть файл

@ -9,7 +9,6 @@ use bitflags::bitflags;
bitflags! {
/// Event-based element states.
#[repr(C)]
#[derive(Clone, Copy, Eq, PartialEq)]
pub struct ElementState: u64 {
/// The mouse is down on this element.
/// <https://html.spec.whatwg.org/multipage/#selector-active>
@ -148,7 +147,6 @@ bitflags! {
bitflags! {
/// Event-based document states.
#[repr(C)]
#[derive(Clone, Copy, Eq, PartialEq)]
pub struct DocumentState: u64 {
/// Window activation status
const WINDOW_INACTIVE = 1 << 0;

Просмотреть файл

@ -18,7 +18,7 @@ path = "lib.rs"
bench = []
[dependencies]
bitflags = "2"
bitflags = "1.0"
cssparser = "0.32"
derive_more = { version = "0.99", default-features = false, features = ["add", "add_assign"] }
fxhash = "0.2"

Просмотреть файл

@ -168,7 +168,7 @@ fn split_from_end<T>(s: &[T], at: usize) -> (&[T], &[T]) {
bitflags! {
/// Flags that indicate at which point of parsing a selector are we.
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, ToShmem)]
#[derive(Default, ToShmem)]
pub (crate) struct SelectorFlags : u8 {
const HAS_PSEUDO = 1 << 0;
const HAS_SLOTTED = 1 << 1;

Просмотреть файл

@ -28,7 +28,6 @@ pub static RECOMMENDED_SELECTOR_BLOOM_FILTER_SIZE: usize = 4096;
bitflags! {
/// Set of flags that are set on either the element or its parent (depending
/// on the flag) if the element could potentially match a selector.
#[derive(Clone, Copy)]
pub struct ElementSelectorFlags: usize {
/// When a child is added or removed from the parent, all the children
/// must be restyled, because they may match :nth-last-child,

Просмотреть файл

@ -77,7 +77,6 @@ fn to_ascii_lowercase(s: &str) -> Cow<str> {
bitflags! {
/// Flags that indicate at which point of parsing a selector are we.
#[derive(Copy, Clone)]
struct SelectorParsingState: u8 {
/// Whether we should avoid adding default namespaces to selectors that
/// aren't type or universal selectors.
@ -1576,7 +1575,6 @@ pub struct RelativeSelector<Impl: SelectorImpl> {
bitflags! {
/// Composition of combinators in a given selector, not traversing selectors of pseudoclasses.
#[derive(Clone, Debug, Eq, PartialEq)]
struct CombinatorComposition: u8 {
const DESCENDANTS = 1 << 0;
const SIBLINGS = 1 << 1;

Просмотреть файл

@ -62,7 +62,7 @@ pub trait SelectorVisitor: Sized {
bitflags! {
/// The kinds of components the visitor is visiting the selector list of, if any
#[derive(Clone, Copy, Default)]
#[derive(Default)]
pub struct SelectorListKind: u8 {
/// The visitor is inside :not(..)
const NEGATION = 1 << 0;

Просмотреть файл

@ -30,7 +30,7 @@ gecko_refcount_logging = []
app_units = "0.7"
arrayvec = "0.7"
atomic_refcell = "0.1"
bitflags = "2"
bitflags = "1.0"
byteorder = "1.0"
cssparser = "0.32"
derive_more = { version = "0.99", default-features = false, features = ["add", "add_assign", "deref", "deref_mut", "from"] }

Просмотреть файл

@ -165,7 +165,7 @@ impl ColorSpace {
bitflags! {
/// Flags used when serializing colors.
#[derive(Clone, Copy, Default, MallocSizeOf, PartialEq, ToShmem)]
#[derive(Default, MallocSizeOf, ToShmem)]
#[repr(C)]
pub struct ColorFlags : u8 {
/// Marks that this color is in the legacy color format. This flag is

Просмотреть файл

@ -97,7 +97,7 @@ pub enum FontFaceSourceFormatKeyword {
bitflags! {
/// Flags for the @font-face tech() function, indicating font technologies
/// required by the resource.
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToShmem)]
#[derive(ToShmem)]
#[repr(C)]
pub struct FontFaceSourceTechFlags: u16 {
/// Font requires OpenType feature support.

Просмотреть файл

@ -26,7 +26,6 @@ pub use crate::gecko::snapshot::SnapshotMap;
bitflags! {
// See NonTSPseudoClass::is_enabled_in()
#[derive(Copy, Clone)]
struct NonTSPseudoClassFlag: u8 {
const PSEUDO_CLASS_ENABLED_IN_UA_SHEETS = 1 << 0;
const PSEUDO_CLASS_ENABLED_IN_CHROME = 1 << 1;

Просмотреть файл

@ -106,7 +106,7 @@ impl ElementSnapshot for GeckoElementSnapshot {
fn state(&self) -> Option<ElementState> {
if self.has_any(Flags::State) {
Some(ElementState::from_bits_retain(self.mState))
Some(ElementState::from_bits_truncate(self.mState))
} else {
None
}

Просмотреть файл

@ -709,7 +709,7 @@ impl<'le> GeckoElement<'le> {
#[inline]
fn document_state(&self) -> DocumentState {
DocumentState::from_bits_retain(self.as_node().owner_doc().0.mDocumentState.bits)
DocumentState::from_bits_truncate(self.as_node().owner_doc().0.mDocumentState.bits)
}
#[inline]
@ -1170,7 +1170,7 @@ impl<'le> TElement for GeckoElement<'le> {
#[inline]
fn state(&self) -> ElementState {
ElementState::from_bits_retain(self.state_internal())
ElementState::from_bits_truncate(self.state_internal())
}
#[inline]

Просмотреть файл

@ -20,7 +20,7 @@ pub fn assert_flags_match() {
impl From<OriginFlags> for OriginSet {
fn from(flags: OriginFlags) -> Self {
Self::from_bits_retain(flags.0)
Self::from_bits_truncate(flags.0)
}
}

Просмотреть файл

@ -9,7 +9,6 @@ use crate::traversal_flags::TraversalFlags;
bitflags! {
/// The kind of restyle we need to do for a given element.
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct RestyleHint: u16 {
/// Do a selector match of the element.
const RESTYLE_SELF = 1 << 0;

Просмотреть файл

@ -25,7 +25,7 @@ pub enum InlineBaseDirection {
// TODO: improve the readability of the WritingMode serialization, refer to the Debug:fmt()
bitflags!(
#[derive(Clone, Copy, Eq, MallocSizeOf, PartialEq, Serialize)]
#[derive(MallocSizeOf, Serialize)]
#[repr(C)]
pub struct WritingMode: u8 {
/// A vertical writing mode; writing-mode is vertical-rl,

Просмотреть файл

@ -12,7 +12,6 @@ bitflags! {
/// If we ever want to add some flags that shouldn't inherit for them,
/// we might want to add a function to handle this.
#[repr(C)]
#[derive(Clone, Copy, Eq, PartialEq)]
pub struct ComputedValueFlags: u32 {
/// Whether the style or any of the ancestors has a text-decoration-line
/// property that should get propagated to descendants.

Просмотреть файл

@ -1169,7 +1169,6 @@ impl CSSWideKeyword {
bitflags! {
/// A set of flags for properties.
#[derive(Clone, Copy)]
pub struct PropertyFlags: u16 {
/// This longhand property applies to ::first-letter.
const APPLIES_TO_FIRST_LETTER = 1 << 1;
@ -1406,7 +1405,7 @@ impl LonghandId {
0,
% endfor
];
PropertyFlags::from_bits_retain(FLAGS[self as usize])
PropertyFlags::from_bits_truncate(FLAGS[self as usize])
}
/// Returns true if the property is one that is ignored when document
@ -1581,7 +1580,7 @@ impl ShorthandId {
0,
% endfor
];
PropertyFlags::from_bits_retain(FLAGS[self as usize])
PropertyFlags::from_bits_truncate(FLAGS[self as usize])
}
/// Returns whether this property is a legacy shorthand.

Просмотреть файл

@ -104,7 +104,7 @@ macro_rules! keyword_evaluator {
bitflags! {
/// Different flags or toggles that change how a expression is parsed or
/// evaluated.
#[derive(Clone, Copy, ToShmem)]
#[derive(ToShmem)]
pub struct FeatureFlags : u8 {
/// The feature should only be parsed in chrome and ua sheets.
const CHROME_AND_UA_ONLY = 1 << 0;

Просмотреть файл

@ -40,7 +40,7 @@ impl Default for PrecomputedHasher {
///
/// We can avoid selector-matching those global rules for all elements without
/// these pseudo-class states.
const RARE_PSEUDO_CLASS_STATES: ElementState = ElementState::from_bits_retain(
const RARE_PSEUDO_CLASS_STATES: ElementState = ElementState::from_bits_truncate(
ElementState::FULLSCREEN.bits() |
ElementState::VISITED_OR_UNVISITED.bits() |
ElementState::URLTARGET.bits() |

Просмотреть файл

@ -58,7 +58,7 @@ impl Origin {
bitflags! {
/// A set of origins. This is equivalent to Gecko's OriginFlags.
#[derive(Clone, Copy, PartialEq, MallocSizeOf)]
#[derive(MallocSizeOf)]
pub struct OriginSet: u8 {
/// <https://drafts.csswg.org/css-cascade/#cascade-origin-user-agent>
const ORIGIN_USER_AGENT = Origin::UserAgent as u8;
@ -85,7 +85,7 @@ impl OriginSet {
impl From<Origin> for OriginSet {
fn from(origin: Origin) -> Self {
Self::from_bits_retain(origin as u8)
Self::from_bits_truncate(origin as u8)
}
}

Просмотреть файл

@ -83,7 +83,6 @@ bitflags! {
/// page-rule applies.
///
/// https://drafts.csswg.org/css-page-3/#page-selectors
#[derive(Clone, Copy)]
#[repr(C)]
pub struct PagePseudoClassFlags : u8 {
/// No pseudo-classes

Просмотреть файл

@ -11,7 +11,6 @@ use std::cell::RefCell;
bitflags! {
/// A thread state flag, used for multiple assertions.
#[derive(Clone, Copy, Eq, PartialEq)]
pub struct ThreadState: u32 {
/// Whether we're in a script thread.
const SCRIPT = 0x01;

Просмотреть файл

@ -10,7 +10,6 @@
bitflags! {
/// Flags that control the traversal process.
#[derive(Clone, Copy, Eq, PartialEq)]
pub struct TraversalFlags: u32 {
/// Traverse only elements for animation restyles.
const AnimationOnly = 1 << 0;

Просмотреть файл

@ -217,7 +217,6 @@ bitflags! {
/// This is used as a hint for the parser to fast-reject invalid
/// expressions. Numbers are always allowed because they multiply other
/// units.
#[derive(Clone, Copy, PartialEq, Eq)]
pub struct CalcUnits: u8 {
/// <length>
const LENGTH = 1 << 0;

Просмотреть файл

@ -25,7 +25,7 @@ pub enum GenericColor<Percentage> {
bitflags! {
/// Flags used to modify the calculation of a color mix result.
#[derive(Clone, Copy, Default, MallocSizeOf, PartialEq, ToShmem)]
#[derive(MallocSizeOf, ToShmem)]
#[repr(C)]
pub struct ColorMixFlags : u8 {
/// Normalize the weights of the mix.

Просмотреть файл

@ -161,7 +161,7 @@ pub use self::GenericImageSetItem as ImageSetItem;
bitflags! {
/// State flags stored on each variant of a Gradient.
#[derive(Clone, Copy, Default, MallocSizeOf, PartialEq, ToComputedValue, ToResolvedValue, ToShmem)]
#[derive(MallocSizeOf, ToComputedValue, ToResolvedValue, ToShmem)]
#[repr(C)]
pub struct GradientFlags: u8 {
/// Set if this is a repeating gradient.

Просмотреть файл

@ -13,7 +13,7 @@ use style_traits::{CssWriter, KeywordsCollectFn, ParseError, SpecifiedValueInfo,
bitflags! {
/// Constants shared by multiple CSS Box Alignment properties
#[derive(Clone, Copy, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToResolvedValue, ToShmem)]
#[derive(MallocSizeOf, ToComputedValue, ToResolvedValue, ToShmem)]
#[repr(C)]
pub struct AlignFlags: u8 {
// Enumeration stored in the lower 5 bits:

Просмотреть файл

@ -165,7 +165,6 @@ bitflags! {
/// we use the bitflags to choose the supported basic shapes for each property at the parse
/// time.
/// https://github.com/w3c/csswg-drafts/issues/7390
#[derive(Clone, Copy)]
#[repr(C)]
pub struct AllowedBasicShapes: u8 {
/// inset().

Просмотреть файл

@ -1022,7 +1022,7 @@ impl WillChange {
bitflags! {
/// The change bits that we care about.
#[derive(Clone, Copy, Default, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
#[derive(Default, MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
#[repr(C)]
pub struct WillChangeBits: u16 {
/// Whether a property which can create a stacking context **on any
@ -1133,7 +1133,7 @@ impl Parse for WillChange {
bitflags! {
/// Values for the `touch-action` property.
#[derive(Clone, Copy, Eq, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToResolvedValue, ToShmem)]
#[derive(MallocSizeOf, Parse, SpecifiedValueInfo, ToComputedValue, ToCss, ToResolvedValue, ToShmem)]
#[css(bitflags(single = "none,auto,manipulation", mixed = "pan-x,pan-y,pinch-zoom"))]
#[repr(C)]
pub struct TouchAction: u8 {
@ -1161,7 +1161,7 @@ impl TouchAction {
}
bitflags! {
#[derive(Clone, Copy, Eq, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToResolvedValue, ToShmem)]
#[derive(MallocSizeOf, Parse, SpecifiedValueInfo, ToComputedValue, ToCss, ToResolvedValue, ToShmem)]
#[css(bitflags(single = "none,strict,content", mixed="size,layout,style,paint,inline-size", overlapping_bits))]
#[repr(C)]
/// Constants for contain: https://drafts.csswg.org/css-contain/#contain-property
@ -1855,7 +1855,7 @@ impl Overflow {
}
bitflags! {
#[derive(Clone, Copy, Eq, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToResolvedValue, ToShmem)]
#[derive(MallocSizeOf, Parse, SpecifiedValueInfo, ToComputedValue, ToCss, ToResolvedValue, ToShmem)]
#[repr(C)]
#[css(bitflags(single = "auto", mixed = "stable,both-edges", validate_mixed="Self::has_stable"))]
/// Values for scrollbar-gutter:

Просмотреть файл

@ -1031,7 +1031,7 @@ impl Parse for CaretColor {
bitflags! {
/// Various flags to represent the color-scheme property in an efficient
/// way.
#[derive(Clone, Copy, Default, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
#[derive(Default, MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
#[repr(C)]
#[value_info(other_values = "light,dark,only")]
pub struct ColorSchemeFlags: u8 {

Просмотреть файл

@ -1012,7 +1012,6 @@ impl Parse for FontSize {
}
bitflags! {
#[derive(Clone, Copy)]
/// Flags of variant alternates in bit
struct VariantAlternatesParsingFlags: u8 {
/// None of variant alternates enabled
@ -1239,8 +1238,8 @@ macro_rules! impl_variant_east_asian {
)+
} => {
bitflags! {
#[derive(Clone, Copy, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToResolvedValue, ToShmem)]
/// Vairants for east asian variant
#[derive(MallocSizeOf, ToComputedValue, ToResolvedValue, ToShmem)]
/// Variants for east asian variant
pub struct FontVariantEastAsian: u16 {
/// None of the features
const NORMAL = 0;
@ -1410,7 +1409,7 @@ macro_rules! impl_variant_ligatures {
)+
} => {
bitflags! {
#[derive(Clone, Copy, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToResolvedValue, ToShmem)]
#[derive(MallocSizeOf, ToComputedValue, ToResolvedValue, ToShmem)]
/// Variants of ligatures
pub struct FontVariantLigatures: u16 {
/// Specifies that common default features are enabled
@ -1588,8 +1587,8 @@ macro_rules! impl_variant_numeric {
)+
} => {
bitflags! {
#[derive(Clone, Copy, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToResolvedValue, ToShmem)]
/// Variants of numeric values
#[derive(MallocSizeOf, ToComputedValue, ToResolvedValue, ToShmem)]
/// Vairants of numeric values
pub struct FontVariantNumeric: u8 {
/// None of other variants are enabled.
const NORMAL = 0;

Просмотреть файл

@ -208,7 +208,6 @@ pub type MozImageRect = generic::GenericMozImageRect<NumberOrPercentage, Specifi
pub enum MozImageRect {}
bitflags! {
#[derive(Clone, Copy)]
struct ParseImageFlags: u8 {
const FORBID_NONE = 1 << 0;
const FORBID_IMAGE_SET = 1 << 1;

Просмотреть файл

@ -372,7 +372,7 @@ impl Side for VerticalPositionKeyword {
bitflags! {
/// Controls how the auto-placement algorithm works specifying exactly how auto-placed items
/// get flowed into the grid.
#[derive(Clone, Copy, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
#[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
#[value_info(other_values = "row,column,dense")]
#[repr(C)]
pub struct GridAutoFlow: u8 {

Просмотреть файл

@ -249,7 +249,7 @@ impl ToCss for SVGPaintOrder {
bitflags! {
/// The context properties we understand.
#[derive(Clone, Copy, Eq, Default, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
#[derive(Default, MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
#[repr(C)]
pub struct ContextPropertyBits: u8 {
/// `fill`

Просмотреть файл

@ -232,7 +232,7 @@ impl ToComputedValue for TextOverflow {
}
bitflags! {
#[derive(Clone, Copy, Eq, MallocSizeOf, PartialEq, Parse, Serialize, SpecifiedValueInfo, ToCss, ToComputedValue, ToResolvedValue, ToShmem)]
#[derive(MallocSizeOf, Parse, Serialize, SpecifiedValueInfo, ToCss, ToComputedValue, ToResolvedValue, ToShmem)]
#[css(bitflags(single = "none", mixed = "underline,overline,line-through,blink"))]
#[repr(C)]
/// Specified keyword values for the text-decoration-line property.
@ -415,7 +415,7 @@ pub enum TextTransformCase {
}
bitflags! {
#[derive(Clone, Copy, Eq, MallocSizeOf, PartialEq, Parse, Serialize, SpecifiedValueInfo, ToCss, ToComputedValue, ToResolvedValue, ToShmem)]
#[derive(MallocSizeOf, Parse, Serialize, SpecifiedValueInfo, ToCss, ToComputedValue, ToResolvedValue, ToShmem)]
#[css(bitflags(mixed = "full-width,full-size-kana"))]
#[repr(C)]
/// Specified keyword values for non-case transforms in the text-transform property. (Non-exclusive.)
@ -755,7 +755,7 @@ impl Parse for TextEmphasisStyle {
}
bitflags! {
#[derive(Clone, Copy, Eq, MallocSizeOf, PartialEq, Parse, Serialize, SpecifiedValueInfo, ToCss, ToComputedValue, ToResolvedValue, ToShmem)]
#[derive(MallocSizeOf, Parse, Serialize, SpecifiedValueInfo, ToCss, ToComputedValue, ToResolvedValue, ToShmem)]
#[repr(C)]
#[css(bitflags(mixed="over,under,left,right", validate_mixed="Self::validate_and_simplify"))]
/// Values for text-emphasis-position:
@ -967,7 +967,7 @@ impl TextDecorationLength {
}
bitflags! {
#[derive(Clone, Copy, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
#[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
#[value_info(other_values = "auto,from-font,under,left,right")]
#[repr(C)]
/// Specified keyword values for the text-underline-position property.

Просмотреть файл

@ -15,7 +15,7 @@ gecko = []
[dependencies]
app_units = "0.7"
bitflags = "2"
bitflags = "1.0"
cssparser = "0.32"
euclid = "0.22"
lazy_static = "1"

Просмотреть файл

@ -242,7 +242,6 @@ pub enum PropertySyntaxParseError {
bitflags! {
/// The mode to use when parsing values.
#[derive(Clone, Copy, Eq, PartialEq)]
#[repr(C)]
pub struct ParsingMode: u8 {
/// In CSS; lengths must have units, except for zero values, where the unit can be omitted.

Просмотреть файл

@ -296,7 +296,7 @@ pub extern "C" fn Servo_TraverseSubtree(
snapshots: *const ServoElementSnapshotTable,
raw_flags: ServoTraversalFlags,
) -> bool {
let traversal_flags = TraversalFlags::from_bits_retain(raw_flags);
let traversal_flags = TraversalFlags::from_bits_truncate(raw_flags);
debug_assert!(!snapshots.is_null());
let element = GeckoElement(root);
@ -5163,7 +5163,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetKeywordValue(
Clear => get_from_computed::<Clear>(value),
VerticalAlign => VerticalAlign::Keyword(VerticalAlignKeyword::from_u32(value).unwrap()),
TextAlign => get_from_computed::<TextAlign>(value),
TextEmphasisPosition => TextEmphasisPosition::from_bits_retain(value as u8),
TextEmphasisPosition => TextEmphasisPosition::from_bits_truncate(value as u8),
FontSize => {
// We rely on Gecko passing in font-size values (0...7) here.
longhands::font_size::SpecifiedValue::from_html_size(value as u8)
@ -6724,7 +6724,7 @@ pub extern "C" fn Servo_StyleSet_HasStateDependency(
) -> bool {
let element = GeckoElement(element);
let state = ElementState::from_bits_retain(state);
let state = ElementState::from_bits_truncate(state);
let data = raw_data.borrow();
data.stylist
@ -6739,7 +6739,7 @@ pub extern "C" fn Servo_StyleSet_HasNthOfStateDependency(
) -> bool {
let element = GeckoElement(element);
let state = ElementState::from_bits_retain(state);
let state = ElementState::from_bits_truncate(state);
let data = raw_data.borrow();
data.stylist
@ -6751,7 +6751,7 @@ pub extern "C" fn Servo_StyleSet_HasDocumentStateDependency(
raw_data: &PerDocumentStyleData,
state: u64,
) -> bool {
let state = DocumentState::from_bits_retain(state);
let state = DocumentState::from_bits_truncate(state);
let data = raw_data.borrow();
data.stylist.has_document_state_dependency(state)
@ -7406,7 +7406,7 @@ pub unsafe extern "C" fn Servo_InvalidateStyleForDocStateChanges(
let root = GeckoElement(root);
let mut processor = DocumentStateInvalidationProcessor::new(
iter,
DocumentState::from_bits_retain(states_changed),
DocumentState::from_bits_truncate(states_changed),
&mut selector_caches,
root.as_node().owner_doc().quirks_mode(),
);