pub struct ElementData {
pub name: QualName,
pub id: Option<Atom>,
pub attrs: Attributes,
pub is_focussable: bool,
pub style_attribute: Option<Arc<Locked<PropertyDeclarationBlock>>>,
pub special_data: SpecialElementData,
pub background_images: Vec<Option<BackgroundImageData>>,
pub inline_layout_data: Option<Box<TextLayout>>,
pub list_item_data: Option<Box<ListItemLayout>>,
pub template_contents: Option<usize>,
}Fields§
§name: QualNameThe elements tag name, namespace and prefix
id: Option<Atom>The elements id attribute parsed as an atom (if it has one)
attrs: AttributesThe element’s attributes
is_focussable: boolWhether the element is focussable
style_attribute: Option<Arc<Locked<PropertyDeclarationBlock>>>The element’s parsed style attribute (used by stylo)
special_data: SpecialElementDataHeterogeneous data that depends on the element’s type. For example:
- The image data for <img> elements.
- The parley Layout for inline roots.
- The text editor for input/textarea elements
background_images: Vec<Option<BackgroundImageData>>§inline_layout_data: Option<Box<TextLayout>>Parley text layout (elements with inline inner display mode only)
list_item_data: Option<Box<ListItemLayout>>Data associated with display: list-item. Note that this display mode does not exclude inline_layout_data
template_contents: Option<usize>The element’s template contents (<template> elements only)
Implementations§
Source§impl ElementData
impl ElementData
pub fn new(name: QualName, attrs: Vec<Attribute>) -> Self
pub fn attrs(&self) -> &[Attribute]
pub fn attr(&self, name: impl PartialEq<LocalName>) -> Option<&str>
pub fn attr_parsed<T: FromStr>( &self, name: impl PartialEq<LocalName>, ) -> Option<T>
Sourcepub fn has_attr(&self, name: impl PartialEq<LocalName>) -> bool
pub fn has_attr(&self, name: impl PartialEq<LocalName>) -> bool
Detects the presence of the attribute, treating any value as truthy.
pub fn image_data(&self) -> Option<&ImageData>
pub fn image_data_mut(&mut self) -> Option<&mut ImageData>
pub fn raster_image_data(&self) -> Option<&RasterImageData>
pub fn raster_image_data_mut(&mut self) -> Option<&mut RasterImageData>
pub fn canvas_data(&self) -> Option<&CanvasData>
pub fn svg_data(&self) -> Option<&Tree>
pub fn svg_data_mut(&mut self) -> Option<&mut Tree>
pub fn text_input_data(&self) -> Option<&TextInputData>
pub fn text_input_data_mut(&mut self) -> Option<&mut TextInputData>
pub fn checkbox_input_checked(&self) -> Option<bool>
pub fn checkbox_input_checked_mut(&mut self) -> Option<&mut bool>
pub fn file_data(&self) -> Option<&FileData>
pub fn file_data_mut(&mut self) -> Option<&mut FileData>
pub fn flush_is_focussable(&mut self)
pub fn flush_style_attribute( &mut self, guard: &SharedRwLock, url_extra_data: &UrlExtraData, )
pub fn set_style_property( &mut self, name: &str, value: &str, guard: &SharedRwLock, url_extra_data: UrlExtraData, )
pub fn remove_style_property( &mut self, name: &str, guard: &SharedRwLock, url_extra_data: UrlExtraData, )
pub fn take_inline_layout(&mut self) -> Option<Box<TextLayout>>
Trait Implementations§
Source§impl Clone for ElementData
impl Clone for ElementData
Source§fn clone(&self) -> ElementData
fn clone(&self) -> ElementData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ElementData
impl !RefUnwindSafe for ElementData
impl !Send for ElementData
impl !Sync for ElementData
impl Unpin for ElementData
impl !UnwindSafe for ElementData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert