Struct style::element_state::ElementState
[−]
pub struct ElementState { /* fields omitted */ }
Event-based element states.
NB: Is important for this to remain in sync with Gecko's dom/events/EventStates.h.
Please keep in that order in order for this to be easily auditable.
TODO(emilio): We really really want to use the NS_EVENT_STATE bindings for this.
Methods
impl ElementState
pub const IN_ACTIVE_STATE: ElementState
IN_ACTIVE_STATE: ElementState = ElementState{bits: 1 << 0,}
The mouse is down on this element. https://html.spec.whatwg.org/multipage/#selector-active FIXME(#7333): set/unset this when appropriate
pub const IN_FOCUS_STATE: ElementState
IN_FOCUS_STATE: ElementState = ElementState{bits: 1 << 1,}
This element has focus. https://html.spec.whatwg.org/multipage/#selector-focus
pub const IN_HOVER_STATE: ElementState
IN_HOVER_STATE: ElementState = ElementState{bits: 1 << 2,}
The mouse is hovering over this element. https://html.spec.whatwg.org/multipage/#selector-hover
pub const IN_ENABLED_STATE: ElementState
IN_ENABLED_STATE: ElementState = ElementState{bits: 1 << 3,}
Content is enabled (and can be disabled). http://www.whatwg.org/html/#selector-enabled
pub const IN_DISABLED_STATE: ElementState
IN_DISABLED_STATE: ElementState = ElementState{bits: 1 << 4,}
Content is disabled. http://www.whatwg.org/html/#selector-disabled
pub const IN_CHECKED_STATE: ElementState
IN_CHECKED_STATE: ElementState = ElementState{bits: 1 << 5,}
Content is checked. https://html.spec.whatwg.org/multipage/#selector-checked
pub const IN_INDETERMINATE_STATE: ElementState
IN_INDETERMINATE_STATE: ElementState = ElementState{bits: 1 << 6,}
https://html.spec.whatwg.org/multipage/#selector-indeterminate
pub const IN_PLACEHOLDER_SHOWN_STATE: ElementState
IN_PLACEHOLDER_SHOWN_STATE: ElementState = ElementState{bits: 1 << 7,}
https://html.spec.whatwg.org/multipage/#selector-placeholder-shown
pub const IN_TARGET_STATE: ElementState
IN_TARGET_STATE: ElementState = ElementState{bits: 1 << 8,}
pub const IN_FULLSCREEN_STATE: ElementState
IN_FULLSCREEN_STATE: ElementState = ElementState{bits: 1 << 9,}
https://fullscreen.spec.whatwg.org/#%3Afullscreen-pseudo-class
pub const IN_VALID_STATE: ElementState
IN_VALID_STATE: ElementState = ElementState{bits: 1 << 10,}
pub const IN_INVALID_STATE: ElementState
IN_INVALID_STATE: ElementState = ElementState{bits: 1 << 11,}
pub const IN_MOZ_UI_VALID_STATE: ElementState
IN_MOZ_UI_VALID_STATE: ElementState = ElementState{bits: 1 << 12,}
Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-ui-valid
pub const IN_MOZ_UI_INVALID_STATE: ElementState
IN_MOZ_UI_INVALID_STATE: ElementState = ElementState{bits: 1 << 13,}
Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-ui-invalid
pub const IN_BROKEN_STATE: ElementState
IN_BROKEN_STATE: ElementState = ElementState{bits: 1 << 14,}
Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-broken
pub const IN_USER_DISABLED_STATE: ElementState
IN_USER_DISABLED_STATE: ElementState = ElementState{bits: 1 << 15,}
Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-user-disabled
pub const IN_SUPPRESSED_STATE: ElementState
IN_SUPPRESSED_STATE: ElementState = ElementState{bits: 1 << 16,}
Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-suppressed
pub const IN_LOADING_STATE: ElementState
IN_LOADING_STATE: ElementState = ElementState{bits: 1 << 17,}
Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-loading
pub const IN_HANDLER_BLOCKED_STATE: ElementState
IN_HANDLER_BLOCKED_STATE: ElementState = ElementState{bits: 1 << 18,}
Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-handler-blocked
pub const IN_HANDLER_DISABLED_STATE: ElementState
IN_HANDLER_DISABLED_STATE: ElementState = ElementState{bits: 1 << 19,}
Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-handler-disabled
pub const IN_HANDLER_CRASHED_STATE: ElementState
IN_HANDLER_CRASHED_STATE: ElementState = ElementState{bits: 1 << 20,}
Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-handler-crashed
pub const IN_REQUIRED_STATE: ElementState
IN_REQUIRED_STATE: ElementState = ElementState{bits: 1 << 21,}
pub const IN_OPTIONAL_STATE: ElementState
IN_OPTIONAL_STATE: ElementState = ElementState{bits: 1 << 22,}
pub const IN_READ_WRITE_STATE: ElementState
IN_READ_WRITE_STATE: ElementState = ElementState{bits: 1 << 22,}
pub const IN_UNRESOLVED_STATE: ElementState
IN_UNRESOLVED_STATE: ElementState = ElementState{bits: 1 << 23,}
Non-standard: Older custom-elements spec.
pub const IN_VISITED_STATE: ElementState
IN_VISITED_STATE: ElementState = ElementState{bits: 1 << 24,}
pub const IN_UNVISITED_STATE: ElementState
IN_UNVISITED_STATE: ElementState = ElementState{bits: 1 << 25,}
pub const IN_VISITED_OR_UNVISITED_STATE: ElementState
IN_VISITED_OR_UNVISITED_STATE: ElementState = ElementState{bits: <ElementState>::IN_VISITED_STATE.bits | <ElementState>::IN_UNVISITED_STATE.bits,}
pub const IN_DRAGOVER_STATE: ElementState
IN_DRAGOVER_STATE: ElementState = ElementState{bits: 1 << 26,}
Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-drag-over
pub const IN_INRANGE_STATE: ElementState
IN_INRANGE_STATE: ElementState = ElementState{bits: 1 << 27,}
pub const IN_OUTOFRANGE_STATE: ElementState
IN_OUTOFRANGE_STATE: ElementState = ElementState{bits: 1 << 28,}
https://html.spec.whatwg.org/multipage/#selector-out-of-range
pub const IN_MOZ_READONLY_STATE: ElementState
IN_MOZ_READONLY_STATE: ElementState = ElementState{bits: 1 << 29,}
pub const IN_MOZ_READWRITE_STATE: ElementState
IN_MOZ_READWRITE_STATE: ElementState = ElementState{bits: 1 << 30,}
pub const IN_DEFAULT_STATE: ElementState
IN_DEFAULT_STATE: ElementState = ElementState{bits: 1 << 31,}
pub const IN_MOZ_SUBMITINVALID_STATE: ElementState
IN_MOZ_SUBMITINVALID_STATE: ElementState = ElementState{bits: 1 << 32,}
Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-submit-invalid
pub const IN_OPTIMUM_STATE: ElementState
IN_OPTIMUM_STATE: ElementState = ElementState{bits: 1 << 33,}
Non-standard & undocumented.
pub const IN_SUB_OPTIMUM_STATE: ElementState
IN_SUB_OPTIMUM_STATE: ElementState = ElementState{bits: 1 << 34,}
Non-standard & undocumented.
pub const IN_SUB_SUB_OPTIMUM_STATE: ElementState
IN_SUB_SUB_OPTIMUM_STATE: ElementState = ElementState{bits: 1 << 35,}
Non-standard & undocumented.
pub const IN_DEVTOOLS_HIGHLIGHTED_STATE: ElementState
IN_DEVTOOLS_HIGHLIGHTED_STATE: ElementState = ElementState{bits: 1 << 36,}
Non-standard & undocumented.
pub const IN_STYLEEDITOR_TRANSITIONING_STATE: ElementState
IN_STYLEEDITOR_TRANSITIONING_STATE: ElementState = ElementState{bits: 1 << 37,}
Non-standard & undocumented.
pub const IN_INCREMENT_SCRIPT_LEVEL_STATE: ElementState
IN_INCREMENT_SCRIPT_LEVEL_STATE: ElementState = ElementState{bits: 1 << 38,}
Non-standard & undocumented.
pub const IN_FOCUSRING_STATE: ElementState
IN_FOCUSRING_STATE: ElementState = ElementState{bits: 1 << 39,}
Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-focusring
pub const IN_HANDLER_CLICK_TO_PLAY_STATE: ElementState
IN_HANDLER_CLICK_TO_PLAY_STATE: ElementState = ElementState{bits: 1 << 40,}
Non-standard & undocumented.
pub const IN_HANDLER_VULNERABLE_UPDATABLE_STATE: ElementState
IN_HANDLER_VULNERABLE_UPDATABLE_STATE: ElementState = ElementState{bits: 1 << 41,}
Non-standard & undocumented.
pub const IN_HANDLER_VULNERABLE_NO_UPDATE_STATE: ElementState
IN_HANDLER_VULNERABLE_NO_UPDATE_STATE: ElementState = ElementState{bits: 1 << 42,}
Non-standard & undocumented.
pub const IN_FOCUS_WITHIN_STATE: ElementState
IN_FOCUS_WITHIN_STATE: ElementState = ElementState{bits: 1 << 43,}
https://drafts.csswg.org/selectors-4/#the-focus-within-pseudo
pub const IN_LTR_STATE: ElementState
IN_LTR_STATE: ElementState = ElementState{bits: 1 << 44,}
:dir matching; the states are used for dynamic change detection. State that elements that match :dir(ltr) are in.
pub const IN_RTL_STATE: ElementState
IN_RTL_STATE: ElementState = ElementState{bits: 1 << 45,}
State that elements that match :dir(rtl) are in.
pub const IN_HAS_DIR_ATTR_STATE: ElementState
IN_HAS_DIR_ATTR_STATE: ElementState = ElementState{bits: 1 << 46,}
State that HTML elements that have a "dir" attr are in.
pub const IN_HAS_DIR_ATTR_LTR_STATE: ElementState
IN_HAS_DIR_ATTR_LTR_STATE: ElementState = ElementState{bits: 1 << 47,}
State that HTML elements with dir="ltr" (or something case-insensitively equal to "ltr") are in.
pub const IN_HAS_DIR_ATTR_RTL_STATE: ElementState
IN_HAS_DIR_ATTR_RTL_STATE: ElementState = ElementState{bits: 1 << 48,}
State that HTML elements with dir="rtl" (or something case-insensitively equal to "rtl") are in.
pub const IN_HAS_DIR_ATTR_LIKE_AUTO_STATE: ElementState
IN_HAS_DIR_ATTR_LIKE_AUTO_STATE: ElementState = ElementState{bits: 1 << 49,}
State that HTML elements without a valid-valued "dir" attr or any HTML elements (including ) with dir="auto" (or something case-insensitively equal to "auto") are in.
pub const IN_AUTOFILL_STATE: ElementState
IN_AUTOFILL_STATE: ElementState = ElementState{bits: 1 << 50,}
Non-standard & undocumented.
pub const IN_AUTOFILL_PREVIEW_STATE: ElementState
IN_AUTOFILL_PREVIEW_STATE: ElementState = ElementState{bits: 1 << 51,}
Non-standard & undocumented.
pub fn empty() -> ElementState
Returns an empty set of flags.
pub fn all() -> ElementState
Returns the set containing all flags.
pub fn bits(&self) -> u64
Returns the raw value of the flags currently stored.
pub fn from_bits(bits: u64) -> Option<ElementState>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
pub fn from_bits_truncate(bits: u64) -> ElementState
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
pub fn is_empty(&self) -> bool
Returns true
if no flags are currently stored.
pub fn is_all(&self) -> bool
Returns true
if all flags are currently set.
pub fn intersects(&self, other: ElementState) -> bool
Returns true
if there are flags common to both self
and other
.
pub fn contains(&self, other: ElementState) -> bool
Returns true
all of the flags in other
are contained within self
.
pub fn insert(&mut self, other: ElementState)
Inserts the specified flags in-place.
pub fn remove(&mut self, other: ElementState)
Removes the specified flags in-place.
pub fn toggle(&mut self, other: ElementState)
Toggles the specified flags in-place.
pub fn set(&mut self, other: ElementState, value: bool)
Inserts or removes the specified flags depending on the passed value.
Trait Implementations
impl Copy for ElementState
impl PartialEq for ElementState
fn eq(&self, __arg_0: &ElementState) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &ElementState) -> bool
This method tests for !=
.
impl Eq for ElementState
impl Clone for ElementState
fn clone(&self) -> ElementState
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialOrd for ElementState
fn partial_cmp(&self, __arg_0: &ElementState) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &ElementState) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &ElementState) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &ElementState) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &ElementState) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for ElementState
fn cmp(&self, __arg_0: &ElementState) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl Hash for ElementState
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl MallocSizeOf for ElementState
[src]
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
[src]
Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself. Read more
impl Debug for ElementState
impl Binary for ElementState
impl Octal for ElementState
impl LowerHex for ElementState
impl UpperHex for ElementState
impl BitOr for ElementState
type Output = ElementState
The resulting type after applying the |
operator.
fn bitor(self, other: ElementState) -> ElementState
Returns the union of the two sets of flags.
impl BitOrAssign for ElementState
fn bitor_assign(&mut self, other: ElementState)
Adds the set of flags.
impl BitXor for ElementState
type Output = ElementState
The resulting type after applying the ^
operator.
fn bitxor(self, other: ElementState) -> ElementState
Returns the left flags, but with all the right flags toggled.
impl BitXorAssign for ElementState
fn bitxor_assign(&mut self, other: ElementState)
Toggles the set of flags.
impl BitAnd for ElementState
type Output = ElementState
The resulting type after applying the &
operator.
fn bitand(self, other: ElementState) -> ElementState
Returns the intersection between the two sets of flags.
impl BitAndAssign for ElementState
fn bitand_assign(&mut self, other: ElementState)
Disables all flags disabled in the set.
impl Sub for ElementState
type Output = ElementState
The resulting type after applying the -
operator.
fn sub(self, other: ElementState) -> ElementState
Returns the set difference of the two sets of flags.
impl SubAssign for ElementState
fn sub_assign(&mut self, other: ElementState)
Disables all flags enabled in the set.
impl Not for ElementState
type Output = ElementState
The resulting type after applying the !
operator.
fn not(self) -> ElementState
Returns the complement of this set of flags.
impl Extend<ElementState> for ElementState
fn extend<T: IntoIterator<Item = ElementState>>(&mut self, iterator: T)
Extends a collection with the contents of an iterator. Read more
impl FromIterator<ElementState> for ElementState
fn from_iter<T: IntoIterator<Item = ElementState>>(iterator: T) -> ElementState
Creates a value from an iterator. Read more