pub struct Element {
element_name: QualName,
attributes: Attributes,
specified_values: SpecifiedValues,
important_styles: HashSet<QualName>,
values: ComputedValues,
required_extensions: Option<RequiredExtensions>,
required_features: Option<RequiredFeatures>,
system_language: Option<SystemLanguage>,
pub element_data: ElementData,
}Fields§
§element_name: QualName§attributes: Attributes§specified_values: SpecifiedValues§important_styles: HashSet<QualName>§values: ComputedValues§required_extensions: Option<RequiredExtensions>§required_features: Option<RequiredFeatures>§system_language: Option<SystemLanguage>§element_data: ElementDataImplementations§
Source§impl Element
impl Element
Sourcepub fn new(
session: &Session,
name: &QualName,
attributes: Attributes,
) -> Element
pub fn new( session: &Session, name: &QualName, attributes: Attributes, ) -> Element
Takes an XML element name and consumes a list of attribute/value pairs to create an Element.
This operation does not fail. Unknown element names simply produce a NonRendering
element.
pub fn element_name(&self) -> &QualName
pub fn get_attributes(&self) -> &Attributes
pub fn get_id(&self) -> Option<&str>
pub fn get_class(&self) -> Option<&str>
pub fn inherit_xml_lang(&mut self, parent: Option<Node<NodeData>>)
pub fn get_specified_values(&self) -> &SpecifiedValues
pub fn get_computed_values(&self) -> &ComputedValues
pub fn set_computed_values(&mut self, values: &ComputedValues)
pub fn get_cond(&self, user_language: &UserLanguage, session: &Session) -> bool
fn set_conditional_processing_attributes(&mut self, session: &Session)
Sourcefn set_presentation_attributes(&mut self, session: &Session)
fn set_presentation_attributes(&mut self, session: &Session)
Hands the attrs to the node’s state, to apply the presentation attributes.
pub fn apply_style_declaration( &mut self, declaration: &Declaration, origin: Origin, )
Sourcepub fn set_style_attribute(&mut self, session: &Session)
pub fn set_style_attribute(&mut self, session: &Session)
Applies CSS styles from the “style” attribute
pub fn as_filter_effect(&self) -> Option<&dyn FilterEffect>
Sourcepub fn is_accessed_by_reference(&self) -> bool
pub fn is_accessed_by_reference(&self) -> bool
Returns whether an element of a particular type is only accessed by reference
Sourcepub fn draw(
&self,
node: &Node<NodeData>,
acquired_nodes: &mut AcquiredNodes<'_>,
cascaded: &CascadedValues<'_>,
viewport: &Viewport,
draw_ctx: &mut DrawingCtx,
clipping: bool,
) -> Result<Box<BoundingBox>, Box<InternalRenderingError>>
pub fn draw( &self, node: &Node<NodeData>, acquired_nodes: &mut AcquiredNodes<'_>, cascaded: &CascadedValues<'_>, viewport: &Viewport, draw_ctx: &mut DrawingCtx, clipping: bool, ) -> Result<Box<BoundingBox>, Box<InternalRenderingError>>
The main drawing function for elements.
Sourcepub fn layout(
&self,
node: &Node<NodeData>,
acquired_nodes: &mut AcquiredNodes<'_>,
cascaded: &CascadedValues<'_>,
viewport: &Viewport,
draw_ctx: &mut DrawingCtx,
) -> Result<Option<Layer>, Box<InternalRenderingError>>
pub fn layout( &self, node: &Node<NodeData>, acquired_nodes: &mut AcquiredNodes<'_>, cascaded: &CascadedValues<'_>, viewport: &Viewport, draw_ctx: &mut DrawingCtx, ) -> Result<Option<Layer>, Box<InternalRenderingError>>
The main layout function for elements.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Element
impl RefUnwindSafe for Element
impl !Send for Element
impl !Sync for Element
impl Unpin for Element
impl UnwindSafe for Element
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> 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 more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.