Struct style::servo::selector_parser::ServoElementSnapshot
[−]
[src]
pub struct ServoElementSnapshot {
pub state: Option<ElementState>,
pub attrs: Option<Vec<(AttrIdentifier, AttrValue)>>,
pub is_html_element_in_html_document: bool,
pub class_changed: bool,
pub id_changed: bool,
pub other_attributes_changed: bool,
}Servo's version of an element snapshot.
Fields
state: Option<ElementState>
The stored state of the element.
attrs: Option<Vec<(AttrIdentifier, AttrValue)>>
The set of stored attributes and its values.
is_html_element_in_html_document: bool
Whether this element is an HTML element in an HTML document.
class_changed: bool
Whether the class attribute changed or not.
id_changed: bool
Whether the id attribute changed or not.
other_attributes_changed: bool
Whether other attributes other than id or class changed or not.
Methods
impl ServoElementSnapshot[src]
pub fn new(is_html_element_in_html_document: bool) -> Self[src]
Create an empty element snapshot.
pub fn id_changed(&self) -> bool[src]
Returns whether the id attribute changed or not.
pub fn class_changed(&self) -> bool[src]
Returns whether the class attribute changed or not.
pub fn other_attr_changed(&self) -> bool[src]
Returns whether other attributes other than id or class changed or not.
impl ServoElementSnapshot[src]
pub fn attr_matches(
&self,
ns: &NamespaceConstraint<&Namespace>,
local_name: &LocalName,
operation: &AttrSelectorOperation<&String>
) -> bool[src]
&self,
ns: &NamespaceConstraint<&Namespace>,
local_name: &LocalName,
operation: &AttrSelectorOperation<&String>
) -> bool
selectors::Element::attr_matches
Trait Implementations
impl Debug for ServoElementSnapshot[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl MallocSizeOf for ServoElementSnapshot[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 ElementSnapshot for ServoElementSnapshot[src]
fn state(&self) -> Option<ElementState>[src]
The state of the snapshot, if any.
fn has_attrs(&self) -> bool[src]
If this snapshot contains attribute information.
fn id_attr(&self) -> Option<Atom>[src]
The ID attribute per this snapshot. Should only be called if has_attrs() returns true. Read more
fn has_class(&self, name: &Atom, case_sensitivity: CaseSensitivity) -> bool[src]
Whether this snapshot contains the class name. Should only be called if has_attrs() returns true. Read more
fn each_class<F>(&self, callback: F) where
F: FnMut(&Atom), [src]
F: FnMut(&Atom),
A callback that should be called for each class of the snapshot. Should only be called if has_attrs() returns true. Read more
fn lang_attr(&self) -> Option<SelectorAttrValue>[src]
The xml:lang="" or lang="" attribute value per this snapshot.