Navigation Menu

Skip to content

Commit

Permalink
Reorganize bits and make the flags usize.
Browse files Browse the repository at this point in the history
These are never stored persistently anywhere, and I'm pretty sure it's slower
for the compiler/CPU to operate on non-word-sized flags.

MozReview-Commit-ID: LQNsJbUsw85
  • Loading branch information
bholley committed Apr 23, 2017
1 parent 60f846b commit e4ed69c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions components/selectors/matching.rs
Expand Up @@ -17,24 +17,24 @@ bitflags! {
/// the selector matching process.
///
/// This is used to implement efficient sharing.
pub flags StyleRelations: u16 {
pub flags StyleRelations: usize {
/// Whether this element is affected by an ID selector.
const AFFECTED_BY_ID_SELECTOR = 1 << 3,
const AFFECTED_BY_ID_SELECTOR = 1 << 0,
/// Whether this element has a style attribute. Computed
/// externally.
const AFFECTED_BY_STYLE_ATTRIBUTE = 1 << 6,
const AFFECTED_BY_STYLE_ATTRIBUTE = 1 << 1,
/// Whether this element is affected by presentational hints. This is
/// computed externally (that is, in Servo).
const AFFECTED_BY_PRESENTATIONAL_HINTS = 1 << 7,
const AFFECTED_BY_PRESENTATIONAL_HINTS = 1 << 2,
/// Whether this element has pseudo-element styles. Computed externally.
const AFFECTED_BY_PSEUDO_ELEMENTS = 1 << 8,
const AFFECTED_BY_PSEUDO_ELEMENTS = 1 << 3,
}
}

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.
pub flags ElementSelectorFlags: u8 {
pub flags 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,
/// :last-of-type, :nth-last-of-type, or :only-of-type.
Expand Down

0 comments on commit e4ed69c

Please sign in to comment.