Trait layout_2020::dom::NodeExt

source ·
pub(crate) trait NodeExt<'dom>: 'dom + LayoutNode<'dom> {
    // Required methods
    fn as_image(self) -> Option<(Option<Arc<Image>>, PhysicalSize<f64>)>;
    fn as_canvas(self) -> Option<(CanvasInfo, PhysicalSize<f64>)>;
    fn as_iframe(self) -> Option<(PipelineId, BrowsingContextId)>;
    fn as_video(self) -> Option<(Option<ImageKey>, Option<PhysicalSize<f64>>)>;
    fn as_typeless_object_with_data_attribute(self) -> Option<String>;
    fn style(self, context: &LayoutContext<'_>) -> ServoArc<ComputedValues>;
    fn layout_data_mut(self) -> AtomicRefMut<'dom, InnerDOMLayoutData>;
    fn layout_data(self) -> Option<AtomicRef<'dom, InnerDOMLayoutData>>;
    fn element_box_slot(&self) -> BoxSlot<'dom>;
    fn pseudo_element_box_slot(
        &self,
        which: WhichPseudoElement,
    ) -> BoxSlot<'dom>;
    fn unset_pseudo_element_box(self, which: WhichPseudoElement);
    fn unset_all_boxes(self);
}

Required Methods§

source

fn as_image(self) -> Option<(Option<Arc<Image>>, PhysicalSize<f64>)>

Returns the image if it’s loaded, and its size in image pixels adjusted for image_density.

source

fn as_canvas(self) -> Option<(CanvasInfo, PhysicalSize<f64>)>

source

fn as_iframe(self) -> Option<(PipelineId, BrowsingContextId)>

source

fn as_video(self) -> Option<(Option<ImageKey>, Option<PhysicalSize<f64>>)>

source

fn as_typeless_object_with_data_attribute(self) -> Option<String>

source

fn style(self, context: &LayoutContext<'_>) -> ServoArc<ComputedValues>

source

fn layout_data_mut(self) -> AtomicRefMut<'dom, InnerDOMLayoutData>

source

fn layout_data(self) -> Option<AtomicRef<'dom, InnerDOMLayoutData>>

source

fn element_box_slot(&self) -> BoxSlot<'dom>

source

fn pseudo_element_box_slot(&self, which: WhichPseudoElement) -> BoxSlot<'dom>

source

fn unset_pseudo_element_box(self, which: WhichPseudoElement)

source

fn unset_all_boxes(self)

Remove boxes for the element itself, and its :before and :after if any.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'dom, LayoutNodeType> NodeExt<'dom> for LayoutNodeType
where LayoutNodeType: 'dom + LayoutNode<'dom>,