Struct script::dom::bindings::root::LayoutDom

source ·
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,

source

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.

source

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.

source

pub fn is<U>(&self) -> bool
where U: DerivedFrom<T>,

Returns whether this inner object is a U.

source§

impl<T> LayoutDom<'_, T>
where T: DomObject,

source

pub unsafe fn get_jsobject(&self) -> *mut JSObject

Get the reflector.

source§

impl LayoutDom<'_, Node>

source

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,

source

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.

source

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, Element>

source

pub(super) fn focus_state(self) -> bool

source§

impl<'dom> LayoutDom<'dom, HTMLImageElement>

source§

impl<'dom> LayoutDom<'dom, HTMLInputElement>

source§

impl<'dom> LayoutDom<'dom, HTMLTextAreaElement>

source§

impl<'dom> LayoutDom<'dom, Node>

Trait Implementations§

source§

impl<'dom> AttrHelpersForLayout<'dom> for LayoutDom<'dom, Attr>

source§

fn value(self) -> &'dom AttrValue

source§

fn as_str(&self) -> &'dom str

source§

fn to_tokens(self) -> Option<&'dom [Atom]>

source§

fn local_name(self) -> &'dom LocalName

source§

fn namespace(self) -> &'dom Namespace

source§

impl<T> Clone for LayoutDom<'_, T>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl HTMLBodyElementLayoutHelpers for LayoutDom<'_, HTMLBodyElement>

source§

impl HTMLFontElementLayoutHelpers for LayoutDom<'_, HTMLFontElement>

source§

impl HTMLHRLayoutHelpers for LayoutDom<'_, HTMLHRElement>

source§

impl HTMLIFrameElementLayoutMethods for LayoutDom<'_, HTMLIFrameElement>

source§

impl<'dom> HTMLTableCellElementLayoutHelpers<'dom> for LayoutDom<'dom, HTMLTableCellElement>

source§

impl<'dom> HTMLTableColElementLayoutHelpers<'dom> for LayoutDom<'dom, HTMLTableColElement>

source§

impl HTMLTableElementLayoutHelpers for LayoutDom<'_, HTMLTableElement>

source§

impl HTMLTableRowElementLayoutHelpers for LayoutDom<'_, HTMLTableRowElement>

source§

impl HTMLTableSectionElementLayoutHelpers for LayoutDom<'_, HTMLTableSectionElement>

source§

impl<T> Hash for LayoutDom<'_, T>

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl LayoutCanvasRenderingContext2DHelpers for LayoutDom<'_, CanvasRenderingContext2D>

source§

impl LayoutCanvasRenderingContextHelpers for LayoutDom<'_, GPUCanvasContext>

source§

impl LayoutCanvasRenderingContextHelpers for LayoutDom<'_, WebGL2RenderingContext>

source§

impl LayoutCanvasRenderingContextHelpers for LayoutDom<'_, WebGLRenderingContext>

source§

impl<'dom> LayoutCharacterDataHelpers<'dom> for LayoutDom<'dom, CharacterData>

source§

fn data_for_layout(self) -> &'dom str

source§

impl<'dom> LayoutDocumentHelpers<'dom> for LayoutDom<'dom, Document>

source§

impl<'dom> LayoutElementHelpers<'dom> for LayoutDom<'dom, Element>

source§

impl LayoutHTMLCanvasElementHelpers for LayoutDom<'_, HTMLCanvasElement>

source§

impl LayoutHTMLImageElementHelpers for LayoutDom<'_, HTMLImageElement>

source§

impl<'dom> LayoutHTMLInputElementHelpers<'dom> for LayoutDom<'dom, HTMLInputElement>

source§

impl LayoutHTMLMediaElementHelpers for LayoutDom<'_, HTMLMediaElement>

source§

impl LayoutHTMLTextAreaElementHelpers for LayoutDom<'_, HTMLTextAreaElement>

source§

impl<'dom> LayoutNodeHelpers<'dom> for LayoutDom<'dom, Node>

source§

fn type_id_for_layout(self) -> NodeTypeId

source§

fn is_element_for_layout(&self) -> bool

source§

fn composed_parent_node_ref(self) -> Option<LayoutDom<'dom, Node>>

source§

fn first_child_ref(self) -> Option<LayoutDom<'dom, Node>>

source§

fn last_child_ref(self) -> Option<LayoutDom<'dom, Node>>

source§

fn prev_sibling_ref(self) -> Option<LayoutDom<'dom, Node>>

source§

fn next_sibling_ref(self) -> Option<LayoutDom<'dom, Node>>

source§

fn owner_doc_for_layout(self) -> LayoutDom<'dom, Document>

source§

fn containing_shadow_root_for_layout( self ) -> Option<LayoutDom<'dom, ShadowRoot>>

source§

unsafe fn get_flag(self, flag: NodeFlags) -> bool

source§

unsafe fn set_flag(self, flag: NodeFlags, value: bool)

source§

fn style_data(self) -> Option<&'dom StyleData>

source§

fn layout_data(self) -> Option<&'dom GenericLayoutData>

source§

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>)

Initialize the opaque layout data of this node. Read more
source§

unsafe fn clear_style_and_layout_data(self)

Clear the style and opaque layout data of this node. Read more
source§

fn text_content(self) -> Cow<'dom, str>

source§

fn selection(self) -> Option<Range<usize>>

source§

fn image_url(self) -> Option<ServoUrl>

source§

fn image_data(self) -> Option<(Option<StdArc<Image>>, Option<ImageMetadata>)>

source§

fn image_density(self) -> Option<f64>

source§

fn canvas_data(self) -> Option<HTMLCanvasData>

source§

fn media_data(self) -> Option<HTMLMediaData>

source§

fn svg_data(self) -> Option<SVGSVGData>

source§

fn iframe_browsing_context_id(self) -> Option<BrowsingContextId>

source§

fn iframe_pipeline_id(self) -> Option<PipelineId>

source§

fn opaque(self) -> OpaqueNode

source§

impl LayoutSVGSVGElementHelpers for LayoutDom<'_, SVGSVGElement>

source§

impl<'dom> LayoutShadowRootHelpers<'dom> for LayoutDom<'dom, ShadowRoot>

source§

impl<T> PartialEq for LayoutDom<'_, T>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> Copy for LayoutDom<'_, T>

source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Downcast<T> for T

source§

fn downcast(&self) -> &T

source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

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
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> MaybeBoxed<Box<T>> for T

source§

fn maybe_boxed(self) -> Box<T>

Convert
source§

impl<T> MaybeBoxed<T> for T

source§

fn maybe_boxed(self) -> T

Convert
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Upcast<T> for T

source§

fn upcast(&self) -> Option<&T>

source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T

source§

impl<T> WasmNotSend for T
where T: Send,

source§

impl<T> WasmNotSendSync for T

source§

impl<T> WasmNotSync for T
where T: Sync,