layout_2020::dom

Trait 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: PseudoElement) -> BoxSlot<'dom>;
    fn unset_pseudo_element_box(self, which: PseudoElement);
    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: PseudoElement) -> BoxSlot<'dom>

Source

fn unset_pseudo_element_box(self, which: PseudoElement)

Source

fn unset_all_boxes(self)

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

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