ServoLayoutElement

Struct ServoLayoutElement 

Source
pub struct ServoLayoutElement<'dom> {
    pub(super) element: LayoutDom<'dom, Element>,
    pub(super) pseudo_element_chain: PseudoElementChain,
}
Expand description

An implementation of LayoutElement for Servo’s script crate.

Fields§

§element: LayoutDom<'dom, Element>

The wrapped private DOM Element.

§pseudo_element_chain: PseudoElementChain

The possibly nested PseudoElementChain for this element.

Implementations§

Source§

impl<'dom> ServoLayoutElement<'dom>

Source

pub(super) fn is_html_element(&self) -> bool

Source

pub(super) fn shadow_root(&self) -> Option<ServoDangerousStyleShadowRoot<'dom>>

The shadow root that this ServoLayoutElement is a host of, if it has one.

Note: This should not be exposed to layout as it allows access to an ancestor element.

Trait Implementations§

Source§

impl<'dom> Clone for ServoLayoutElement<'dom>

Source§

fn clone(&self) -> ServoLayoutElement<'dom>

Returns a duplicate 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<'dom> Debug for ServoLayoutElement<'dom>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'dom> From<LayoutDom<'dom, Element>> for ServoLayoutElement<'dom>

Source§

fn from(element: LayoutDom<'dom, Element>) -> Self

Converts to this type from the input type.
Source§

impl<'dom> Hash for ServoLayoutElement<'dom>

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<'dom> LayoutElement<'dom> for ServoLayoutElement<'dom>

Source§

type ConcreteLayoutNode = ServoLayoutNode<'dom>

An associated type that refers to the concrete implementation of LayoutNode implemented in script.
Source§

type ConcreteStyleElement = ServoDangerousStyleElement<'dom>

An associated type that refers to the concrete implementation of DangerousStyleElement implemented in script.
Source§

fn with_pseudo(&self, pseudo_element: PseudoElement) -> Option<Self>

Creates a new LayoutElement for the same LayoutElement with a different pseudo-element type. Read more
Source§

fn pseudo_element_chain(&self) -> PseudoElementChain

Returns the PseudoElementChain for this LayoutElement.
Source§

fn as_node(&self) -> ServoLayoutNode<'dom>

Return this LayoutElement as a LayoutNode, preserving the internal pseudo-element chain.
Source§

fn initialize_style_and_layout_data<RequestedLayoutDataType: LayoutDataTrait>( &self, )

Initialize this node with empty style and opaque layout data.
Source§

fn unset_snapshot_flags(&self)

Unset the snapshot flags on the underlying DOM object for this element.
Source§

fn set_has_snapshot(&self)

Set the snapshot flags on the underlying DOM object for this element.
Source§

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

Get the StyleData for this LayoutElement.
Source§

fn element_data(&self) -> ElementDataRef<'dom>

Get a reference to the inner ElementDataRef for this element’s StyleData. This will panic if the element is unstyled.
Source§

fn element_data_mut(&self) -> ElementDataMut<'dom>

Get a mutable reference to the inner ElementDataRef for this element’s StyleData. This will panic if the element is unstyled.
Source§

fn style(&self, context: &SharedStyleContext<'_>) -> Arc<ComputedValues>

Returns the computed style for the given element, properly handling pseudo-elements. Read more
Source§

fn type_id(&self) -> Option<LayoutNodeType>

Returns the type ID of this node. Returns None if this is a pseudo-element; otherwise, returns Some.
Source§

unsafe fn dangerous_style_element(self) -> ServoDangerousStyleElement<'dom>

Returns access to a version of this LayoutElement that can be used by stylo and selectors. This is dangerous as it allows more access to ancestor nodes that might be in the process of being read or written to in other threads. This should only be used when handing a node to stylo or selectors. Read more
Source§

fn local_name(&self) -> &LocalName

Get the local name of this element. See https://dom.spec.whatwg.org/#concept-element-local-name.
Source§

fn attribute( &self, namespace: &Namespace, name: &LocalName, ) -> Option<&AttrValue>

Get the attribute with the given namespace and name as an AttrValue if it exists, otherwise return None.
Source§

fn attribute_as_str<'a>( &'a self, namespace: &Namespace, name: &LocalName, ) -> Option<&'a str>

Get the attribute with the given namespace and name as an AttrValue if it exists and converting the result to a &str, otherwise return None.
Source§

fn is_shadow_host(&self) -> bool

Returns true if this LayoutElement is a shadow DOM host and false otherwise.
Source§

fn is_body_element_of_html_element_root(&self) -> bool

Returns whether this node is a body element of an HTML element root in an HTML document. Read more
Source§

fn is_html_element_in_html_document(&self) -> bool

Returns true if this LayoutNode is any kind of HTML element inside an HTML document and false otherwise.
Source§

fn is_root(&self) -> bool

Returns whether this node is the root element in an HTML document element. Read more
Source§

impl<'dom> PartialEq for ServoLayoutElement<'dom>

Source§

fn eq(&self, other: &ServoLayoutElement<'dom>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'dom> Copy for ServoLayoutElement<'dom>

Source§

impl<'dom> Eq for ServoLayoutElement<'dom>

Source§

impl Send for ServoLayoutElement<'_>

Source§

impl<'dom> StructuralPartialEq for ServoLayoutElement<'dom>

Source§

impl Sync for ServoLayoutElement<'_>

Auto Trait Implementations§

§

impl<'dom> Freeze for ServoLayoutElement<'dom>

§

impl<'dom> !RefUnwindSafe for ServoLayoutElement<'dom>

§

impl<'dom> Unpin for ServoLayoutElement<'dom>

§

impl<'dom> !UnwindSafe for ServoLayoutElement<'dom>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Filterable for T

Source§

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> 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.
Source§

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

Source§

type Output = T

Should always be Self
Source§

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

Source§

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

Source§

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

Source§

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,