pub struct LayoutDom<'dom, T> {
value: &'dom T,
}
Expand description
An unrooted reference to a DOM object for use in layout. Layout*Helpers
traits must be implemented on this.
Fields§
§value: &'dom T
Implementations§
source§impl<'dom, T> LayoutDom<'dom, T>where
T: Castable,
impl<'dom, T> LayoutDom<'dom, T>where
T: Castable,
sourcepub fn upcast<U>(&self) -> LayoutDom<'dom, U>where
U: Castable,
T: DerivedFrom<U>,
pub fn upcast<U>(&self) -> LayoutDom<'dom, U>where
U: Castable,
T: DerivedFrom<U>,
Cast a DOM object root upwards to one of the interfaces it derives from.
sourcepub fn downcast<U>(&self) -> Option<LayoutDom<'dom, U>>where
U: DerivedFrom<T>,
pub fn downcast<U>(&self) -> Option<LayoutDom<'dom, U>>where
U: DerivedFrom<T>,
Cast a DOM object downwards to one of the interfaces it might implement.
sourcepub fn is<U>(&self) -> boolwhere
U: DerivedFrom<T>,
pub fn is<U>(&self) -> boolwhere
U: DerivedFrom<T>,
Returns whether this inner object is a U.
source§impl<T> LayoutDom<'_, T>where
T: DomObject,
impl<T> LayoutDom<'_, T>where
T: DomObject,
sourcepub unsafe fn get_jsobject(&self) -> *mut JSObject
pub unsafe fn get_jsobject(&self) -> *mut JSObject
Get the reflector.
source§impl LayoutDom<'_, Node>
impl LayoutDom<'_, Node>
sourcepub unsafe fn from_trusted_node_address(inner: TrustedNodeAddress) -> Self
pub unsafe fn from_trusted_node_address(inner: TrustedNodeAddress) -> Self
Create a new JS-owned value wrapped from an address known to be a
Node
pointer.
source§impl<'dom, T> LayoutDom<'dom, T>where
T: 'dom + DomObject,
impl<'dom, T> LayoutDom<'dom, T>where
T: 'dom + DomObject,
sourcepub fn unsafe_get(self) -> &'dom T
pub fn unsafe_get(self) -> &'dom T
Returns a reference to the interior of this JS object. The fact that this is unsafe is what necessitates the layout wrappers.
sourcepub unsafe fn to_layout_slice(
slice: &'dom [Dom<T>],
) -> &'dom [LayoutDom<'dom, T>]
pub unsafe fn to_layout_slice( slice: &'dom [Dom<T>], ) -> &'dom [LayoutDom<'dom, T>]
Transforms a slice of Dom<T>
into a slice of LayoutDom<T>
.
source§impl<'dom> LayoutDom<'dom, HTMLImageElement>
impl<'dom> LayoutDom<'dom, HTMLImageElement>
fn current_request(self) -> &'dom ImageRequest
source§impl<'dom> LayoutDom<'dom, HTMLInputElement>
impl<'dom> LayoutDom<'dom, HTMLInputElement>
fn get_raw_textinput_value(self) -> DOMString
fn placeholder(self) -> &'dom str
fn input_type(self) -> InputType
fn textinput_sorted_selection_offsets_range(self) -> Range<UTF8Bytes>
source§impl<'dom> LayoutDom<'dom, HTMLTextAreaElement>
impl<'dom> LayoutDom<'dom, HTMLTextAreaElement>
fn textinput_content(self) -> DOMString
fn textinput_sorted_selection_offsets_range(self) -> Range<UTF8Bytes>
fn placeholder(self) -> &'dom str
source§impl LayoutDom<'_, HTMLVideoElement>
impl LayoutDom<'_, HTMLVideoElement>
fn width_attr(self) -> Option<LengthOrPercentageOrAuto>
fn height_attr(self) -> Option<LengthOrPercentageOrAuto>
Trait Implementations§
source§impl<'dom> AttrHelpersForLayout<'dom> for LayoutDom<'dom, Attr>
impl<'dom> AttrHelpersForLayout<'dom> for LayoutDom<'dom, Attr>
source§impl HTMLBodyElementLayoutHelpers for LayoutDom<'_, HTMLBodyElement>
impl HTMLBodyElementLayoutHelpers for LayoutDom<'_, HTMLBodyElement>
fn get_background_color(self) -> Option<AbsoluteColor>
fn get_color(self) -> Option<AbsoluteColor>
fn get_background(self) -> Option<ServoUrl>
source§impl HTMLFontElementLayoutHelpers for LayoutDom<'_, HTMLFontElement>
impl HTMLFontElementLayoutHelpers for LayoutDom<'_, HTMLFontElement>
source§impl HTMLHRLayoutHelpers for LayoutDom<'_, HTMLHRElement>
impl HTMLHRLayoutHelpers for LayoutDom<'_, HTMLHRElement>
fn get_color(self) -> Option<AbsoluteColor>
fn get_width(self) -> LengthOrPercentageOrAuto
source§impl HTMLIFrameElementLayoutMethods for LayoutDom<'_, HTMLIFrameElement>
impl HTMLIFrameElementLayoutMethods for LayoutDom<'_, HTMLIFrameElement>
fn pipeline_id(self) -> Option<PipelineId>
fn browsing_context_id(self) -> Option<BrowsingContextId>
fn get_width(self) -> LengthOrPercentageOrAuto
fn get_height(self) -> LengthOrPercentageOrAuto
source§impl<'dom> HTMLTableCellElementLayoutHelpers<'dom> for LayoutDom<'dom, HTMLTableCellElement>
impl<'dom> HTMLTableCellElementLayoutHelpers<'dom> for LayoutDom<'dom, HTMLTableCellElement>
fn get_background_color(self) -> Option<AbsoluteColor>
fn get_colspan(self) -> Option<u32>
fn get_rowspan(self) -> Option<u32>
fn get_table(self) -> Option<LayoutDom<'dom, HTMLTableElement>>
fn get_width(self) -> LengthOrPercentageOrAuto
fn get_height(self) -> LengthOrPercentageOrAuto
source§impl<'dom> HTMLTableColElementLayoutHelpers<'dom> for LayoutDom<'dom, HTMLTableColElement>
impl<'dom> HTMLTableColElementLayoutHelpers<'dom> for LayoutDom<'dom, HTMLTableColElement>
source§impl HTMLTableElementLayoutHelpers for LayoutDom<'_, HTMLTableElement>
impl HTMLTableElementLayoutHelpers for LayoutDom<'_, HTMLTableElement>
fn get_background_color(self) -> Option<AbsoluteColor>
fn get_border(self) -> Option<u32>
fn get_cellpadding(self) -> Option<u32>
fn get_cellspacing(self) -> Option<u32>
fn get_width(self) -> LengthOrPercentageOrAuto
fn get_height(self) -> LengthOrPercentageOrAuto
source§impl HTMLTableRowElementLayoutHelpers for LayoutDom<'_, HTMLTableRowElement>
impl HTMLTableRowElementLayoutHelpers for LayoutDom<'_, HTMLTableRowElement>
fn get_background_color(self) -> Option<AbsoluteColor>
fn get_height(self) -> LengthOrPercentageOrAuto
source§impl HTMLTableSectionElementLayoutHelpers for LayoutDom<'_, HTMLTableSectionElement>
impl HTMLTableSectionElementLayoutHelpers for LayoutDom<'_, HTMLTableSectionElement>
fn get_background_color(self) -> Option<AbsoluteColor>
fn get_height(self) -> LengthOrPercentageOrAuto
source§impl LayoutCanvasRenderingContext2DHelpers for LayoutDom<'_, CanvasRenderingContext2D>
impl LayoutCanvasRenderingContext2DHelpers for LayoutDom<'_, CanvasRenderingContext2D>
fn get_ipc_renderer(self) -> IpcSender<CanvasMsg>
fn get_canvas_id(self) -> CanvasId
source§impl LayoutCanvasRenderingContextHelpers for LayoutDom<'_, GPUCanvasContext>
impl LayoutCanvasRenderingContextHelpers for LayoutDom<'_, GPUCanvasContext>
fn canvas_data_source(self) -> HTMLCanvasDataSource
source§impl LayoutCanvasRenderingContextHelpers for LayoutDom<'_, WebGL2RenderingContext>
impl LayoutCanvasRenderingContextHelpers for LayoutDom<'_, WebGL2RenderingContext>
fn canvas_data_source(self) -> HTMLCanvasDataSource
source§impl LayoutCanvasRenderingContextHelpers for LayoutDom<'_, WebGLRenderingContext>
impl LayoutCanvasRenderingContextHelpers for LayoutDom<'_, WebGLRenderingContext>
fn canvas_data_source(self) -> HTMLCanvasDataSource
source§impl<'dom> LayoutCharacterDataHelpers<'dom> for LayoutDom<'dom, CharacterData>
impl<'dom> LayoutCharacterDataHelpers<'dom> for LayoutDom<'dom, CharacterData>
fn data_for_layout(self) -> &'dom str
source§impl<'dom> LayoutDocumentHelpers<'dom> for LayoutDom<'dom, Document>
impl<'dom> LayoutDocumentHelpers<'dom> for LayoutDom<'dom, Document>
fn is_html_document_for_layout(&self) -> bool
fn needs_paint_from_layout(self)
fn will_paint(self)
fn quirks_mode(self) -> QuirksMode
fn shadow_roots(self) -> Vec<LayoutDom<'dom, ShadowRoot>>
fn shadow_roots_styles_changed(self) -> bool
fn flush_shadow_roots_stylesheets(self)
source§impl<'dom> LayoutElementHelpers<'dom> for LayoutDom<'dom, Element>
impl<'dom> LayoutElementHelpers<'dom> for LayoutDom<'dom, Element>
fn attrs(self) -> &'dom [LayoutDom<'dom, Attr>]
fn has_class_for_layout( self, name: &AtomIdent, case_sensitivity: CaseSensitivity, ) -> bool
fn get_classes_for_layout(self) -> Option<&'dom [Atom]>
fn synthesize_presentational_hints_for_legacy_attributes<V>(self, hints: &mut V)where
V: Push<ApplicableDeclarationBlock>,
fn get_span(self) -> Option<u32>
fn get_colspan(self) -> Option<u32>
fn get_rowspan(self) -> Option<u32>
fn is_html_element(&self) -> bool
fn id_attribute(self) -> *const Option<Atom>
fn style_attribute(self) -> *const Option<Arc<Locked<PropertyDeclarationBlock>>>
fn local_name(self) -> &'dom LocalName
fn namespace(self) -> &'dom Namespace
fn get_lang_for_layout(self) -> String
fn get_state_for_layout(self) -> ElementState
fn insert_selector_flags(self, flags: ElementSelectorFlags)
fn get_selector_flags(self) -> ElementSelectorFlags
source§fn get_shadow_root_for_layout(self) -> Option<LayoutDom<'dom, ShadowRoot>>
fn get_shadow_root_for_layout(self) -> Option<LayoutDom<'dom, ShadowRoot>>
The shadow root this element is a host of.
fn get_attr_for_layout( self, namespace: &Namespace, name: &LocalName, ) -> Option<&'dom AttrValue>
fn get_attr_val_for_layout( self, namespace: &Namespace, name: &LocalName, ) -> Option<&'dom str>
fn get_attr_vals_for_layout(self, name: &LocalName) -> Vec<&'dom AttrValue>
source§impl LayoutHTMLCanvasElementHelpers for LayoutDom<'_, HTMLCanvasElement>
impl LayoutHTMLCanvasElementHelpers for LayoutDom<'_, HTMLCanvasElement>
fn data(self) -> HTMLCanvasData
fn get_canvas_id_for_layout(self) -> CanvasId
source§impl LayoutHTMLImageElementHelpers for LayoutDom<'_, HTMLImageElement>
impl LayoutHTMLImageElementHelpers for LayoutDom<'_, HTMLImageElement>
fn image_url(self) -> Option<ServoUrl>
fn image_data(self) -> (Option<Arc<Image>>, Option<ImageMetadata>)
fn image_density(self) -> Option<f64>
fn get_width(self) -> LengthOrPercentageOrAuto
fn get_height(self) -> LengthOrPercentageOrAuto
source§impl<'dom> LayoutHTMLInputElementHelpers<'dom> for LayoutDom<'dom, HTMLInputElement>
impl<'dom> LayoutHTMLInputElementHelpers<'dom> for LayoutDom<'dom, HTMLInputElement>
fn value_for_layout(self) -> Cow<'dom, str>
fn size_for_layout(self) -> u32
fn selection_for_layout(self) -> Option<Range<usize>>
source§impl LayoutHTMLVideoElementHelpers for LayoutDom<'_, HTMLVideoElement>
impl LayoutHTMLVideoElementHelpers for LayoutDom<'_, HTMLVideoElement>
fn data(self) -> HTMLMediaData
fn get_width(self) -> LengthOrPercentageOrAuto
fn get_height(self) -> LengthOrPercentageOrAuto
source§impl<'dom> LayoutNodeHelpers<'dom> for LayoutDom<'dom, Node>
impl<'dom> LayoutNodeHelpers<'dom> for LayoutDom<'dom, Node>
fn type_id_for_layout(self) -> NodeTypeId
fn is_element_for_layout(&self) -> bool
fn composed_parent_node_ref(self) -> Option<LayoutDom<'dom, Node>>
fn first_child_ref(self) -> Option<LayoutDom<'dom, Node>>
fn last_child_ref(self) -> Option<LayoutDom<'dom, Node>>
fn prev_sibling_ref(self) -> Option<LayoutDom<'dom, Node>>
fn next_sibling_ref(self) -> Option<LayoutDom<'dom, Node>>
fn owner_doc_for_layout(self) -> LayoutDom<'dom, Document>
fn containing_shadow_root_for_layout( self, ) -> Option<LayoutDom<'dom, ShadowRoot>>
unsafe fn get_flag(self, flag: NodeFlags) -> bool
unsafe fn set_flag(self, flag: NodeFlags, value: bool)
fn style_data(self) -> Option<&'dom StyleData>
fn layout_data(self) -> Option<&'dom GenericLayoutData>
source§unsafe fn initialize_style_data(self)
unsafe fn initialize_style_data(self)
Initialize the style data of this node. Read more
source§unsafe fn initialize_layout_data(self, new_data: Box<GenericLayoutData>)
unsafe fn initialize_layout_data(self, new_data: Box<GenericLayoutData>)
Initialize the opaque layout data of this node. Read more
source§unsafe fn clear_style_and_layout_data(self)
unsafe fn clear_style_and_layout_data(self)
Clear the style and opaque layout data of this node. Read more
fn text_content(self) -> Cow<'dom, str>
fn selection(self) -> Option<Range<usize>>
fn image_url(self) -> Option<ServoUrl>
fn image_data(self) -> Option<(Option<StdArc<Image>>, Option<ImageMetadata>)>
fn image_density(self) -> Option<f64>
fn canvas_data(self) -> Option<HTMLCanvasData>
fn media_data(self) -> Option<HTMLMediaData>
fn svg_data(self) -> Option<SVGSVGData>
fn iframe_browsing_context_id(self) -> Option<BrowsingContextId>
fn iframe_pipeline_id(self) -> Option<PipelineId>
fn opaque(self) -> OpaqueNode
source§impl LayoutSVGSVGElementHelpers for LayoutDom<'_, SVGSVGElement>
impl LayoutSVGSVGElementHelpers for LayoutDom<'_, SVGSVGElement>
fn data(self) -> SVGSVGData
source§impl<'dom> LayoutShadowRootHelpers<'dom> for LayoutDom<'dom, ShadowRoot>
impl<'dom> LayoutShadowRootHelpers<'dom> for LayoutDom<'dom, ShadowRoot>
fn get_host_for_layout(self) -> LayoutDom<'dom, Element>
fn get_style_data_for_layout(self) -> &'dom CascadeData
unsafe fn flush_stylesheets<E: TElement>( self, stylist: &mut Stylist, guard: &SharedRwLockReadGuard<'_>, )
source§impl<T> PartialEq for LayoutDom<'_, T>
impl<T> PartialEq for LayoutDom<'_, T>
impl<T> Copy for LayoutDom<'_, T>
impl<T> Eq for LayoutDom<'_, T>
Auto Trait Implementations§
impl<'dom, T> Freeze for LayoutDom<'dom, T>
impl<'dom, T> RefUnwindSafe for LayoutDom<'dom, T>where
T: RefUnwindSafe,
impl<'dom, T> Send for LayoutDom<'dom, T>where
T: Sync,
impl<'dom, T> Sync for LayoutDom<'dom, T>where
T: Sync,
impl<'dom, T> Unpin for LayoutDom<'dom, T>
impl<'dom, T> UnwindSafe for LayoutDom<'dom, T>where
T: RefUnwindSafe,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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