Struct dom::ElementState
source · #[repr(C)]pub struct ElementState(pub(crate) <ElementState as PublicFlags>::Internal);
Expand description
Event-based element states.
Tuple Fields§
§0: <ElementState as PublicFlags>::Internal
Implementations§
source§impl ElementState
impl ElementState
sourcepub const ACTIVE: Self = _
pub const ACTIVE: Self = _
The mouse is down on this element. https://html.spec.whatwg.org/multipage/#selector-active FIXME(#7333): set/unset this when appropriate
sourcepub const FOCUS: Self = _
pub const FOCUS: Self = _
This element has focus. https://html.spec.whatwg.org/multipage/#selector-focus
sourcepub const HOVER: Self = _
pub const HOVER: Self = _
The mouse is hovering over this element. https://html.spec.whatwg.org/multipage/#selector-hover
sourcepub const ENABLED: Self = _
pub const ENABLED: Self = _
Content is enabled (and can be disabled). http://www.whatwg.org/html/#selector-enabled
sourcepub const DISABLED: Self = _
pub const DISABLED: Self = _
Content is disabled. http://www.whatwg.org/html/#selector-disabled
sourcepub const CHECKED: Self = _
pub const CHECKED: Self = _
Content is checked. https://html.spec.whatwg.org/multipage/#selector-checked
sourcepub const INDETERMINATE: Self = _
pub const INDETERMINATE: Self = _
sourcepub const PLACEHOLDER_SHOWN: Self = _
pub const PLACEHOLDER_SHOWN: Self = _
sourcepub const FULLSCREEN: Self = _
pub const FULLSCREEN: Self = _
sourcepub const USER_VALID: Self = _
pub const USER_VALID: Self = _
sourcepub const USER_INVALID: Self = _
pub const USER_INVALID: Self = _
sourcepub const VALIDITY_STATES: Self = _
pub const VALIDITY_STATES: Self = _
All the validity bits at once.
sourcepub const BROKEN: Self = _
pub const BROKEN: Self = _
Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-broken
sourcepub const OPTIONAL_: Self = _
pub const OPTIONAL_: Self = _
https://html.spec.whatwg.org/multipage/#selector-optional We use an underscore to workaround a silly windows.h define.
sourcepub const VISITED_OR_UNVISITED: Self = _
pub const VISITED_OR_UNVISITED: Self = _
sourcepub const DRAGOVER: Self = _
pub const DRAGOVER: Self = _
Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-drag-over
sourcepub const OUTOFRANGE: Self = _
pub const OUTOFRANGE: Self = _
sourcepub const SUB_OPTIMUM: Self = _
pub const SUB_OPTIMUM: Self = _
Non-standard & undocumented.
sourcepub const SUB_SUB_OPTIMUM: Self = _
pub const SUB_SUB_OPTIMUM: Self = _
Non-standard & undocumented.
sourcepub const METER_OPTIMUM_STATES: Self = _
pub const METER_OPTIMUM_STATES: Self = _
All the above
sourcepub const INCREMENT_SCRIPT_LEVEL: Self = _
pub const INCREMENT_SCRIPT_LEVEL: Self = _
Non-standard & undocumented.
sourcepub const FOCUS_WITHIN: Self = _
pub const FOCUS_WITHIN: Self = _
sourcepub const LTR: Self = _
pub const LTR: Self = _
:dir matching; the states are used for dynamic change detection. State that elements that match :dir(ltr) are in.
sourcepub const HAS_DIR_ATTR: Self = _
pub const HAS_DIR_ATTR: Self = _
State that HTML elements that have a “dir” attr are in.
sourcepub const HAS_DIR_ATTR_LTR: Self = _
pub const HAS_DIR_ATTR_LTR: Self = _
State that HTML elements with dir=“ltr” (or something case-insensitively equal to “ltr”) are in.
sourcepub const HAS_DIR_ATTR_RTL: Self = _
pub const HAS_DIR_ATTR_RTL: Self = _
State that HTML elements with dir=“rtl” (or something case-insensitively equal to “rtl”) are in.
sourcepub const HAS_DIR_ATTR_LIKE_AUTO: Self = _
pub const HAS_DIR_ATTR_LIKE_AUTO: Self = _
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.
sourcepub const AUTOFILL_PREVIEW: Self = _
pub const AUTOFILL_PREVIEW: Self = _
Non-standard & undocumented.
sourcepub const MODAL: Self = _
pub const MODAL: Self = _
State for modal elements: https://drafts.csswg.org/selectors-4/#modal-state
sourcepub const TOPMOST_MODAL: Self = _
pub const TOPMOST_MODAL: Self = _
State for the topmost modal element in top layer
sourcepub const DEVTOOLS_HIGHLIGHTED: Self = _
pub const DEVTOOLS_HIGHLIGHTED: Self = _
Initially used for the devtools highlighter, but now somehow only used for the devtools accessibility inspector.
sourcepub const STYLEEDITOR_TRANSITIONING: Self = _
pub const STYLEEDITOR_TRANSITIONING: Self = _
Used for the devtools style editor. Probably should go away.
sourcepub const VALUE_EMPTY: Self = _
pub const VALUE_EMPTY: Self = _
For :-moz-value-empty (to show widgets like the reveal password button or the clear button).
sourcepub const POPOVER_OPEN: Self = _
pub const POPOVER_OPEN: Self = _
https://html.spec.whatwg.org/#selector-popover-open Match element’s popover visibility state of showing
sourcepub const DIR_STATES: Self = _
pub const DIR_STATES: Self = _
Some convenience unions.
pub const DIR_ATTR_STATES: Self = _
pub const DISABLED_STATES: Self = _
pub const REQUIRED_STATES: Self = _
source§impl ElementState
impl ElementState
sourcepub const fn bits(&self) -> u64
pub const fn bits(&self) -> u64
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
sourcepub const fn from_bits(bits: u64) -> Option<Self>
pub const fn from_bits(bits: u64) -> Option<Self>
Convert from a bits value.
This method will return None
if any unknown bits are set.
sourcepub const fn from_bits_truncate(bits: u64) -> Self
pub const fn from_bits_truncate(bits: u64) -> Self
Convert from a bits value, unsetting any unknown bits.
sourcepub const fn from_bits_retain(bits: u64) -> Self
pub const fn from_bits_retain(bits: u64) -> Self
Convert from a bits value exactly.
sourcepub fn from_name(name: &str) -> Option<Self>
pub fn from_name(name: &str) -> Option<Self>
Get a flags value with the bits of a flag with the given name set.
This method will return None
if name
is empty or doesn’t
correspond to any named flag.
sourcepub const fn intersects(&self, other: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
sourcepub fn remove(&mut self, other: Self)
pub fn remove(&mut self, other: Self)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
remove
won’t truncate other
, but the !
operator will.
sourcepub fn toggle(&mut self, other: Self)
pub fn toggle(&mut self, other: Self)
The bitwise exclusive-or (^
) of the bits in two flags values.
sourcepub fn set(&mut self, other: Self, value: bool)
pub fn set(&mut self, other: Self, value: bool)
Call insert
when value
is true
or remove
when value
is false
.
sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
The bitwise and (&
) of the bits in two flags values.
sourcepub const fn union(self, other: Self) -> Self
pub const fn union(self, other: Self) -> Self
The bitwise or (|
) of the bits in two flags values.
sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
sourcepub const fn symmetric_difference(self, other: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
The bitwise exclusive-or (^
) of the bits in two flags values.
sourcepub const fn complement(self) -> Self
pub const fn complement(self) -> Self
The bitwise negation (!
) of the bits in a flags value, truncating the result.
source§impl ElementState
impl ElementState
sourcepub const fn iter(&self) -> Iter<ElementState>
pub const fn iter(&self) -> Iter<ElementState>
Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.
sourcepub const fn iter_names(&self) -> IterNames<ElementState>
pub const fn iter_names(&self) -> IterNames<ElementState>
Yield a set of contained named flags values.
This method is like iter
, except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
Trait Implementations§
source§impl Binary for ElementState
impl Binary for ElementState
source§impl BitAnd for ElementState
impl BitAnd for ElementState
source§impl BitAndAssign for ElementState
impl BitAndAssign for ElementState
source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
The bitwise and (&
) of the bits in two flags values.
source§impl BitOr for ElementState
impl BitOr for ElementState
source§fn bitor(self, other: ElementState) -> Self
fn bitor(self, other: ElementState) -> Self
The bitwise or (|
) of the bits in two flags values.
§type Output = ElementState
type Output = ElementState
|
operator.source§impl BitOrAssign for ElementState
impl BitOrAssign for ElementState
source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
The bitwise or (|
) of the bits in two flags values.
source§impl BitXor for ElementState
impl BitXor for ElementState
source§impl BitXorAssign for ElementState
impl BitXorAssign for ElementState
source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
The bitwise exclusive-or (^
) of the bits in two flags values.
source§impl Clone for ElementState
impl Clone for ElementState
source§fn clone(&self) -> ElementState
fn clone(&self) -> ElementState
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ElementState
impl Debug for ElementState
source§impl Extend<ElementState> for ElementState
impl Extend<ElementState> for ElementState
source§fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
The bitwise or (|
) of the bits in each flags value.
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)source§impl Flags for ElementState
impl Flags for ElementState
source§const FLAGS: &'static [Flag<ElementState>] = _
const FLAGS: &'static [Flag<ElementState>] = _
source§fn from_bits_retain(bits: u64) -> ElementState
fn from_bits_retain(bits: u64) -> ElementState
source§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
source§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
source§fn iter_names(&self) -> IterNames<Self>
fn iter_names(&self) -> IterNames<Self>
source§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
source§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
source§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|
) of the bits in two flags values.source§fn remove(&mut self, other: Self)where
Self: Sized,
fn remove(&mut self, other: Self)where
Self: Sized,
&!
). Read moresource§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^
) of the bits in two flags values.source§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&
) of the bits in two flags values.source§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
&!
). Read moresource§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^
) of the bits in two flags values.source§fn complement(self) -> Self
fn complement(self) -> Self
!
) of the bits in a flags value, truncating the result.source§impl FromIterator<ElementState> for ElementState
impl FromIterator<ElementState> for ElementState
source§fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
The bitwise or (|
) of the bits in each flags value.
source§impl IntoIterator for ElementState
impl IntoIterator for ElementState
source§impl LowerHex for ElementState
impl LowerHex for ElementState
source§impl Not for ElementState
impl Not for ElementState
source§impl Octal for ElementState
impl Octal for ElementState
source§impl PartialEq for ElementState
impl PartialEq for ElementState
source§fn eq(&self, other: &ElementState) -> bool
fn eq(&self, other: &ElementState) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PublicFlags for ElementState
impl PublicFlags for ElementState
source§impl Sub for ElementState
impl Sub for ElementState
source§fn sub(self, other: Self) -> Self
fn sub(self, other: Self) -> Self
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
§type Output = ElementState
type Output = ElementState
-
operator.source§impl SubAssign for ElementState
impl SubAssign for ElementState
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.