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 unsafe fn unsafe_get(self) -> &'dom T
pub unsafe 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
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
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>
source§impl HTMLFontElementLayoutHelpers for LayoutDom<'_, HTMLFontElement>
impl HTMLFontElementLayoutHelpers for LayoutDom<'_, HTMLFontElement>
source§impl HTMLHRLayoutHelpers for LayoutDom<'_, HTMLHRElement>
impl HTMLHRLayoutHelpers for LayoutDom<'_, HTMLHRElement>
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 HTMLTableCellElementLayoutHelpers for LayoutDom<'_, HTMLTableCellElement>
impl HTMLTableCellElementLayoutHelpers for LayoutDom<'_, HTMLTableCellElement>
fn get_background_color(self) -> Option<RGBA>
fn get_colspan(self) -> Option<u32>
fn get_rowspan(self) -> Option<u32>
fn get_width(self) -> LengthOrPercentageOrAuto
source§impl HTMLTableElementLayoutHelpers for LayoutDom<'_, HTMLTableElement>
impl HTMLTableElementLayoutHelpers for LayoutDom<'_, HTMLTableElement>
fn get_background_color(self) -> Option<RGBA>
fn get_border(self) -> Option<u32>
fn get_cellspacing(self) -> Option<u32>
fn get_width(self) -> LengthOrPercentageOrAuto
source§impl HTMLTableRowElementLayoutHelpers for LayoutDom<'_, HTMLTableRowElement>
impl HTMLTableRowElementLayoutHelpers for LayoutDom<'_, HTMLTableRowElement>
fn get_background_color(self) -> Option<RGBA>
source§impl HTMLTableSectionElementLayoutHelpers for LayoutDom<'_, HTMLTableSectionElement>
impl HTMLTableSectionElementLayoutHelpers for LayoutDom<'_, HTMLTableSectionElement>
fn get_background_color(self) -> Option<RGBA>
source§impl LayoutCanvasRenderingContext2DHelpers for LayoutDom<'_, CanvasRenderingContext2D>
impl LayoutCanvasRenderingContext2DHelpers for LayoutDom<'_, CanvasRenderingContext2D>
unsafe fn get_ipc_renderer(self) -> IpcSender<CanvasMsg>
fn get_canvas_id(self) -> CanvasId
source§impl LayoutCanvasRenderingContextHelpers for LayoutDom<'_, GPUCanvasContext>
impl LayoutCanvasRenderingContextHelpers for LayoutDom<'_, GPUCanvasContext>
unsafe fn canvas_data_source(self) -> HTMLCanvasDataSource
source§impl LayoutCanvasRenderingContextHelpers for LayoutDom<'_, WebGL2RenderingContext>
impl LayoutCanvasRenderingContextHelpers for LayoutDom<'_, WebGL2RenderingContext>
unsafe fn canvas_data_source(self) -> HTMLCanvasDataSource
source§impl LayoutCanvasRenderingContextHelpers for LayoutDom<'_, WebGLRenderingContext>
impl LayoutCanvasRenderingContextHelpers for LayoutDom<'_, WebGLRenderingContext>
unsafe 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
unsafe fn needs_paint_from_layout(self)
unsafe fn will_paint(self)
fn quirks_mode(self) -> QuirksMode
fn shadow_roots(self) -> Vec<LayoutDom<'dom, ShadowRoot>> ⓘ
fn shadow_roots_styles_changed(self) -> bool
unsafe 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_colspan(self) -> u32
fn get_rowspan(self) -> 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 has_selector_flags(self, flags: ElementSelectorFlags) -> bool
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_width(self) -> LengthOrPercentageOrAuto
fn get_height(self) -> LengthOrPercentageOrAuto
fn get_canvas_id_for_layout(self) -> CanvasId
source§impl LayoutHTMLImageElementHelpers for LayoutDom<'_, HTMLImageElement>
impl LayoutHTMLImageElementHelpers for LayoutDom<'_, HTMLImageElement>
fn image(self) -> Option<Arc<Image>>
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>>
fn checked_state_for_layout(self) -> bool
fn indeterminate_state_for_layout(self) -> bool
source§impl LayoutHTMLMediaElementHelpers for LayoutDom<'_, HTMLMediaElement>
impl LayoutHTMLMediaElementHelpers for LayoutDom<'_, HTMLMediaElement>
fn data(self) -> HTMLMediaData
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 children_count(self) -> u32
fn get_style_and_opaque_layout_data( self ) -> Option<&'dom StyleAndOpaqueLayoutData>
unsafe fn init_style_and_opaque_layout_data( self, val: Box<StyleAndOpaqueLayoutData> )
unsafe fn take_style_and_opaque_layout_data( self ) -> Box<StyleAndOpaqueLayoutData>
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<LayoutDom<'_, T>> for LayoutDom<'_, T>
impl<T> PartialEq<LayoutDom<'_, T>> for LayoutDom<'_, T>
impl<T> Copy for LayoutDom<'_, T>
impl<T> Eq for LayoutDom<'_, T>
Auto Trait Implementations§
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> CallHasher for Twhere
T: Hash + ?Sized,
impl<T> CallHasher for Twhere T: Hash + ?Sized,
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
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 Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
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> 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> MaybeBoxed<Box<T, Global>> for T
impl<T> MaybeBoxed<Box<T, Global>> for T
source§fn maybe_boxed(self) -> Box<T, Global>
fn maybe_boxed(self) -> Box<T, Global>
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