Skip to main content

Element

Struct Element 

Source
#[repr(C)]
pub struct Element {
Show 15 fields node: Node, local_name: LocalName, tag_name: TagName, namespace: Namespace, prefix: DomRefCell<Option<Prefix>>, attrs: AttributeStorage, id_attribute: DomRefCell<Option<Atom>>, is: DomRefCell<Option<LocalName>>, style_attribute: DomRefCell<Option<Arc<Locked<PropertyDeclarationBlock>>>>, attr_list: MutNullableDom<NamedNodeMap>, class_list: MutNullableDom<DOMTokenList>, state: Cell<ElementState>, selector_flags: AtomicUsize, rare_data: DomRefCell<Option<Box<ElementRareData>>>, style_data: DomRefCell<Option<Box<StyleData>>>,
}
Expand description

Fields§

§node: Node§local_name: LocalName§tag_name: TagName§namespace: Namespace§prefix: DomRefCell<Option<Prefix>>§attrs: AttributeStorage§id_attribute: DomRefCell<Option<Atom>>§is: DomRefCell<Option<LocalName>>§style_attribute: DomRefCell<Option<Arc<Locked<PropertyDeclarationBlock>>>>§attr_list: MutNullableDom<NamedNodeMap>§class_list: MutNullableDom<DOMTokenList>§state: Cell<ElementState>§selector_flags: AtomicUsize

These flags are set by the style system to indicate the that certain operations may require restyling this element or its descendants.

§rare_data: DomRefCell<Option<Box<ElementRareData>>>§style_data: DomRefCell<Option<Box<StyleData>>>

Style data for this node. This is accessed and mutated by style passes and is used to lay out this node and populate layout data.

Implementations§

Source§

impl Element

Source§

impl Element

Source§

impl Element

Source§

impl Element

Source

pub(crate) fn get_int_attribute( &self, local_name: &LocalName, default: i32, ) -> i32

Source

pub(crate) fn set_atomic_attribute( &self, cx: &mut JSContext, local_name: &LocalName, value: DOMString, )

Source

pub(crate) fn set_bool_attribute( &self, cx: &mut JSContext, local_name: &LocalName, value: bool, )

Source

pub(crate) fn get_url_attribute(&self, local_name: &LocalName) -> USVString

Source

pub(crate) fn set_url_attribute( &self, cx: &mut JSContext, local_name: &LocalName, value: USVString, )

Source

pub(crate) fn get_trusted_type_url_attribute( &self, local_name: &LocalName, ) -> TrustedScriptURLOrUSVString<DomTypeHolder>

Source

pub(crate) fn get_trusted_html_attribute( &self, local_name: &LocalName, ) -> TrustedHTMLOrString<DomTypeHolder>

Source

pub(crate) fn get_string_attribute(&self, local_name: &LocalName) -> DOMString

Source

pub(crate) fn set_string_attribute( &self, cx: &mut JSContext, local_name: &LocalName, value: DOMString, )

Source

pub(crate) fn get_nullable_string_attribute( &self, local_name: &LocalName, ) -> Option<DOMString>

Used for string attribute reflections where absence of the attribute returns null, e.g. element.ariaLabel returning null when the aria-label attribute is absent.

Source

pub(crate) fn set_nullable_string_attribute( &self, cx: &mut JSContext, local_name: &LocalName, value: Option<DOMString>, )

Used for string attribute reflections where setting null/undefined removes the attribute, e.g. element.ariaLabel = null removing the aria-label attribute.

Source

pub(crate) fn get_tokenlist_attribute( &self, local_name: &LocalName, ) -> Vec<Atom>

Source

pub(crate) fn set_tokenlist_attribute( &self, cx: &mut JSContext, local_name: &LocalName, value: DOMString, )

Source

pub(crate) fn set_atomic_tokenlist_attribute( &self, cx: &mut JSContext, local_name: &LocalName, tokens: Vec<Atom>, )

Source

pub(crate) fn set_int_attribute( &self, cx: &mut JSContext, local_name: &LocalName, value: i32, )

Source

pub(crate) fn get_uint_attribute( &self, local_name: &LocalName, default: u32, ) -> u32

Source

pub(crate) fn set_uint_attribute( &self, cx: &mut JSContext, local_name: &LocalName, value: u32, )

Source

fn compute_attribute_value_with_style_fast_path( &self, attr: AttrRef<'_>, ) -> AttrValue

Ensure that for styles, we clone the already-parsed property declaration block. This does two things:

  1. It uses the same fast-path as CSSStyleDeclaration
  2. It also avoids the CSP checks when cloning (it shouldn’t run any when cloning existing valid attributes)
Source

pub(crate) fn copy_all_attributes_to_other_element( &self, cx: &mut JSContext, target_element: &Element, )

Source§

impl Element

Source

pub(crate) fn create( cx: &mut JSContext, name: QualName, is: Option<LocalName>, document: &Document, creator: ElementCreator, mode: CustomElementCreationMode, proto: Option<HandleObject<'_>>, ) -> DomRoot<Element>

Source

pub(crate) fn new_inherited( local_name: LocalName, namespace: Namespace, prefix: Option<Prefix>, document: &Document, ) -> Element

Source

pub(crate) fn new_inherited_with_state( state: ElementState, local_name: LocalName, namespace: Namespace, prefix: Option<Prefix>, document: &Document, ) -> Element

Source

pub(crate) fn set_had_duplicate_attributes(&self)

Source

pub(crate) fn new( cx: &mut JSContext, local_name: LocalName, namespace: Namespace, prefix: Option<Prefix>, document: &Document, proto: Option<HandleObject<'_>>, ) -> DomRoot<Element>

Source

fn rare_data(&self) -> Ref<'_, Option<Box<ElementRareData>>>

Source

fn rare_data_mut(&self) -> RefMut<'_, Option<Box<ElementRareData>>>

Source

fn ensure_rare_data(&self) -> RefMut<'_, Box<ElementRareData>>

Source

pub(crate) fn clean_up_style_data(&self)

Source

pub(crate) fn restyle(&self, damage: NodeDamage)

Source

pub(crate) fn set_is(&self, is: LocalName)

Source

pub(crate) fn get_is(&self) -> Option<LocalName>

Source

pub(crate) fn set_initial_custom_element_state_to_uncustomized(&self)

This is a performance optimization. Element::create can simply call element.set_custom_element_state(CustomElementState::Uncustomized) to initialize uncustomized, built-in elements with the right state, which currently just means that the DEFINED state should be true for styling. However set_custom_element_state has a high performance cost and it is unnecessary if the element is being created as an uncustomized built-in element.

See https://github.com/servo/servo/issues/37745 for more details.

Source

pub(crate) fn set_custom_element_state(&self, state: CustomElementState)

Source

pub(crate) fn get_custom_element_state(&self) -> CustomElementState

Source

pub(crate) fn is_custom(&self) -> bool

Source

pub(crate) fn set_custom_element_definition( &self, definition: Rc<CustomElementDefinition>, )

Source

pub(crate) fn get_custom_element_definition( &self, ) -> Option<Rc<CustomElementDefinition>>

Source

pub(crate) fn clear_custom_element_definition(&self)

Source

pub(crate) fn push_callback_reaction( &self, function: Rc<Function<DomTypeHolder>>, args: Box<[Heap<JSVal>]>, )

Source

pub(crate) fn push_upgrade_reaction( &self, definition: Rc<CustomElementDefinition>, )

Source

pub(crate) fn clear_reaction_queue(&self)

Source

pub(crate) fn invoke_reactions(&self, cx: &mut JSContext)

Source

pub(crate) fn has_css_layout_box(&self) -> bool

Source

pub(crate) fn is_potentially_scrollable_body(&self) -> bool

Source

pub(crate) fn is_potentially_scrollable_body_for_scrolling_element( &self, ) -> bool

Source

fn is_potentially_scrollable_body_shared_logic( &self, treat_overflow_clip_on_parent_as_hidden: bool, ) -> bool

Source

pub(crate) fn establishes_scroll_container(&self) -> bool

Whether this element is styled such that it establishes a scroll container. https://www.w3.org/TR/css-overflow-3/#scroll-container

Source

pub(crate) fn has_overflow(&self) -> bool

Source

fn has_scrolling_box(&self) -> bool

Whether or not this element has a scrolling box according to https://drafts.csswg.org/cssom-view/#scrolling-box.

This is true if:

  1. The element has a layout box.
  2. The style specifies that overflow should be scrollable (auto, hidden or scroll).
  3. The fragment actually has content that overflows the box.
Source

pub(crate) fn shadow_root(&self) -> Option<DomRoot<ShadowRoot>>

Source

pub(crate) fn is_shadow_host(&self) -> bool

Source

pub(crate) fn attach_shadow( &self, cx: &mut JSContext, is_ua_widget: IsUserAgentWidget, mode: ShadowRootMode, clonable: bool, serializable: bool, delegates_focus: bool, slot_assignment_mode: SlotAssignmentMode, ) -> Fallible<DomRoot<ShadowRoot>>

Source

pub(crate) fn attach_ua_shadow_root( &self, cx: &mut JSContext, use_ua_widget_styling: bool, ) -> DomRoot<ShadowRoot>

Attach a UA widget shadow root with its default parameters. Additionally mark ShadowRoot to use styling configuration for a UA widget.

The general trait of these elements is that it would hide the implementation. Thus, we would make it inaccessible (i.e., closed mode, not cloneable, and not serializable).

With UA shadow root element being assumed as one element, any focus should be delegated to its host.

Source

pub(crate) fn is_translate_enabled(&self) -> bool

Source

pub(crate) fn directionality(&self) -> String

Source

pub(crate) fn is_root(&self) -> bool

Source

pub(crate) fn registered_intersection_observers_mut( &self, ) -> RefMut<'_, Vec<IntersectionObserverRegistration>>

Return all IntersectionObserverRegistration for this element. Lazily initialize the raredata if it does not exist.

Source

pub(crate) fn registered_intersection_observers( &self, ) -> Option<Ref<'_, Vec<IntersectionObserverRegistration>>>

Source

pub(crate) fn get_intersection_observer_registration( &self, observer: &IntersectionObserver, ) -> Option<Ref<'_, IntersectionObserverRegistration>>

Source

pub(crate) fn add_initial_intersection_observer_registration( &self, observer: &IntersectionObserver, )

Add a new IntersectionObserverRegistration with initial value to the element.

Source

pub(crate) fn remove_intersection_observer( &self, observer: &IntersectionObserver, )

Removes a certain IntersectionObserver.

Source

pub(crate) fn scrolling_box( &self, flags: ScrollContainerQueryFlags, ) -> Option<ScrollingBox>

Get the ScrollingBox that contains this element, if one does. position: fixed elements do not have a containing ScrollingBox.

Source

pub(crate) fn scroll_into_view_with_options( &self, behavior: ScrollBehavior, block: ScrollAxisState, inline: ScrollAxisState, container: Option<&Element>, inner_target_rect: Option<Rect<Au, CSSPixel>>, )

Source

pub(crate) fn ensure_contenteditable_selection_range( &self, document: &Document, can_gc: CanGc, ) -> DomRoot<Range>

Source

pub(crate) fn handle_scroll_event(&self)

https://drafts.csswg.org/cssom-view/#scrolling-events

Whenever an element gets scrolled (whether in response to user interaction or by an API), the user agent must run these steps:

Source

pub(crate) fn style(&self) -> Option<ServoArc<ComputedValues>>

Source

pub(crate) fn is_styled(&self) -> bool

Source

pub(crate) fn is_display_none(&self) -> bool

Source§

impl Element

Source

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

Source

pub(crate) fn html_element_in_html_document(&self) -> bool

Source

pub(crate) fn local_name(&self) -> &LocalName

Source

pub(crate) fn parsed_name(&self, name: DOMString) -> LocalName

Source

pub(crate) fn namespace(&self) -> &Namespace

Source

pub(crate) fn prefix(&self) -> Ref<'_, Option<Prefix>>

Source

pub(crate) fn set_prefix(&self, prefix: Option<Prefix>)

Source

pub(crate) fn set_custom_element_registry( &self, registry: Option<DomRoot<CustomElementRegistry>>, )

Source

pub(crate) fn custom_element_registry( &self, ) -> Option<DomRoot<CustomElementRegistry>>

Source

pub(crate) fn attrs(&self) -> &AttributeStorage

Source

pub(crate) fn dom_attrs(&self) -> &AttributeStorage

Source

pub(crate) fn locate_namespace(&self, prefix: Option<DOMString>) -> Namespace

Source

pub(crate) fn name_attribute(&self) -> Option<Atom>

Source

pub(crate) fn style_attribute( &self, ) -> &DomRefCell<Option<ServoArc<Locked<PropertyDeclarationBlock>>>>

Source

pub(crate) fn summarize(&self) -> Vec<AttrInfo>

Source

pub(crate) fn is_void(&self) -> bool

Source

pub(crate) fn root_element(&self) -> DomRoot<Element>

Source

pub(crate) fn lookup_prefix(&self, namespace: Namespace) -> Option<DOMString>

Source

pub(crate) fn is_document_element(&self) -> bool

Source

pub(crate) fn is_active_element(&self) -> bool

Source

pub(crate) fn is_editing_host(&self) -> bool

Source

pub(crate) fn is_actually_disabled(&self) -> bool

Source

pub(crate) fn push_new_attribute( &self, cx: &mut JSContext, local_name: LocalName, value: AttrValue, name: LocalName, namespace: Namespace, prefix: Option<Prefix>, reason: AttributeMutationReason, )

Source

fn handle_attribute_changes( &self, cx: &mut JSContext, attr: AttrRef<'_>, old_value: Option<&AttrValue>, new_value: Option<DOMString>, reason: AttributeMutationReason, )

Source

pub(crate) fn change_attribute( &self, cx: &mut JSContext, attr: &Attr, value: AttrValue, )

Source

pub(crate) fn push_attribute( &self, cx: &mut JSContext, attr: &Attr, reason: AttributeMutationReason, )

Source

pub(crate) fn get_attribute_with_namespace( &self, namespace: &Namespace, local_name: &LocalName, ) -> Option<DomRoot<Attr>>

This is the inner logic for: https://dom.spec.whatwg.org/#concept-element-attributes-get-by-namespace

In addition to taking a namespace argument, this version does not require the attribute to be lowercase ASCII, in accordance with the specification.

Source

pub(crate) fn get_attribute( &self, local_name: &LocalName, ) -> Option<DomRoot<Attr>>

This is the inner logic for: https://dom.spec.whatwg.org/#concept-element-attributes-get-by-name

Callers should convert the LocalName to ASCII lowercase before calling.

Source

pub(crate) fn get_attribute_by_name( &self, name: DOMString, ) -> Option<DomRoot<Attr>>

Source

pub(crate) fn set_attribute_from_parser( &self, cx: &mut JSContext, qname: QualName, value: DOMString, prefix: Option<Prefix>, )

Source

pub(crate) fn set_attribute( &self, cx: &mut JSContext, name: &LocalName, value: AttrValue, )

Source

pub(crate) fn set_attribute_with_namespace( &self, cx: &mut JSContext, local_name: LocalName, value: AttrValue, name: LocalName, namespace: Namespace, prefix: Option<Prefix>, )

Source

fn set_first_matching_attribute<F>( &self, cx: &mut JSContext, local_name: LocalName, value: AttrValue, name: LocalName, namespace: Namespace, prefix: Option<Prefix>, find: F, )
where F: Fn(AttrRef<'_>) -> bool,

Source

pub(crate) fn parse_attribute( &self, namespace: &Namespace, local_name: &LocalName, value: DOMString, ) -> AttrValue

Source

pub(crate) fn remove_attribute( &self, cx: &mut JSContext, namespace: &Namespace, local_name: &LocalName, ) -> Option<DomRoot<Attr>>

Source

pub(crate) fn remove_attribute_by_name( &self, cx: &mut JSContext, name: &LocalName, ) -> Option<DomRoot<Attr>>

Source

fn remove_first_matching_attribute<F>( &self, cx: &mut JSContext, find: F, ) -> Option<DomRoot<Attr>>
where F: Fn(AttrRef<'_>) -> bool,

Source

pub(crate) fn has_class( &self, name: &Atom, case_sensitivity: CaseSensitivity, ) -> bool

Source

pub(crate) fn has_attribute(&self, local_name: &LocalName) -> bool

Source

pub(crate) fn will_mutate_attr(&self, attr: AttrRef<'_>)

Source

fn update_style_attribute( &self, attr: AttrRef<'_>, mutation: AttributeMutation<'_>, )

Source

fn set_attribute_node( &self, cx: &mut JSContext, attr: &Attr, ) -> Fallible<Option<DomRoot<Attr>>>

Source

pub(crate) fn update_nonce_internal_slot(&self, nonce: String)

Source

pub(crate) fn nonce_value(&self) -> String

Source

pub(crate) fn update_nonce_post_connection(&self, cx: &mut JSContext)

Source

pub(crate) fn is_nonceable(&self) -> bool

Source

pub(crate) fn insert_adjacent( &self, cx: &mut JSContext, where_: AdjacentPosition, node: &Node, ) -> Fallible<Option<DomRoot<Node>>>

Source

pub(crate) fn scroll(&self, x: f64, y: f64, behavior: ScrollBehavior)

https://drafts.csswg.org/cssom-view/#dom-element-scroll

TODO(stevennovaryo): Need to update the scroll API to follow the spec since it is quite outdated.

Source

pub(crate) fn parse_fragment( &self, markup: DOMString, cx: &mut JSContext, ) -> Fallible<DomRoot<DocumentFragment>>

Source

pub(crate) fn fragment_parsing_context( cx: &mut JSContext, owner_doc: &Document, element: Option<&Self>, ) -> DomRoot<Self>

Source

pub(crate) fn is_in_same_home_subtree<T>(&self, other: &T) -> bool

Source

pub(crate) fn get_id(&self) -> Option<Atom>

Source

pub(crate) fn get_name(&self) -> Option<Atom>

Source

pub(crate) fn get_element_internals(&self) -> Option<DomRoot<ElementInternals>>

Source

pub(crate) fn ensure_element_internals( &self, can_gc: CanGc, ) -> DomRoot<ElementInternals>

Source

pub(crate) fn outer_html(&self, cx: &mut JSContext) -> Fallible<DOMString>

Source

pub(crate) fn compute_source_position(&self, line_number: u32) -> SourcePosition

Source

pub(crate) fn explicitly_set_tab_index(&self) -> Option<i32>

Source

pub(crate) fn tab_index(&self) -> i32

Source

fn insert_selector_flags(&self, flags: ElementSelectorFlags)

Source

fn get_selector_flags(&self) -> ElementSelectorFlags

Source§

impl Element

Source

pub(crate) fn client_rect(&self) -> Rect<i32, CSSPixel>

Source

pub(crate) fn as_maybe_activatable(&self) -> Option<&dyn Activatable>

Source

pub(crate) fn as_stylesheet_owner(&self) -> Option<&dyn StylesheetOwner>

Source

pub(crate) fn as_maybe_validatable(&self) -> Option<&dyn Validatable>

Source

pub(crate) fn is_invalid(&self, needs_update: bool, can_gc: CanGc) -> bool

Source

pub(crate) fn is_instance_validatable(&self) -> bool

Source

pub(crate) fn init_state_for_internals(&self)

Source

pub(crate) fn click_in_progress(&self) -> bool

Source

pub(crate) fn set_click_in_progress(&self, click: bool)

Source

pub fn state(&self) -> ElementState

Source

pub(crate) fn set_state(&self, which: ElementState, value: bool)

Source

pub(crate) fn set_active_state(&self, value: bool)

Source

pub(crate) fn focus_state(&self) -> bool

Source

pub(crate) fn set_focus_state(&self, value: bool)

Source

pub(crate) fn set_hover_state(&self, value: bool)

Source

pub(crate) fn enabled_state(&self) -> bool

Source

pub(crate) fn set_enabled_state(&self, value: bool)

Source

pub(crate) fn disabled_state(&self) -> bool

Source

pub(crate) fn set_disabled_state(&self, value: bool)

Source

pub(crate) fn read_write_state(&self) -> bool

Source

pub(crate) fn set_read_write_state(&self, value: bool)

Source

pub(crate) fn set_open_state(&self, value: bool)

Source

pub(crate) fn set_placeholder_shown_state(&self, value: bool)

Source

pub(crate) fn set_modal_state(&self, value: bool)

Source

pub(crate) fn set_target_state(&self, value: bool)

Source

pub(crate) fn set_fullscreen_state(&self, value: bool)

Source

pub(crate) fn is_connected(&self) -> bool

Source

pub(crate) fn cannot_navigate(&self) -> bool

Source§

impl Element

Source§

impl Element

Source

pub(crate) fn focusable_area_kind(&self) -> FocusableAreaKind

https://html.spec.whatwg.org/multipage/#focusable-area

The list of focusable areas at this point in the specification is both incomplete and leaves a lot up to the user agent. In addition, the specifications for “click focusable” and “sequentially focusable” are written in a way that they are subsets of all focusable areas. In order to avoid having to first determine whether an element is a focusable area and then work backwards to figure out what kind it is, this function attempts to classify the different types of focusable areas ahead of time so that the logic is useful for answering both “Is this element a focusable area?” and “Is this element click (or sequentially) focusable.”

Source

pub(crate) fn is_sequentially_focusable(&self) -> bool

Source

pub(crate) fn is_focusable_area(&self) -> bool

Source§

impl Element

Source§

impl Element

Source§

impl Element

Source

pub(crate) fn is_resettable(&self) -> bool

Source

pub(crate) fn reset(&self, cx: &mut JSContext)

Source§

impl Element

Trait Implementations§

§

impl Castable for Element

Source§

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

Check whether a DOM object implements one of its deriving interfaces.
Source§

fn upcast<T>(&self) -> &T
where T: Castable, Self: DerivedFrom<T>,

Cast a DOM object upwards to one of the interfaces it derives from.
Source§

fn downcast<T>(&self) -> Option<&T>
where T: DerivedFrom<Self>,

Cast a DOM object downwards to one of the interfaces it might implement.
Source§

impl Debug for Element

Source§

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

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

impl DomObject for Element

Source§

type ReflectorType = ()

Source§

fn reflector(&self) -> &Reflector<Self::ReflectorType>

Returns the receiver’s reflector.
Source§

impl DomObjectWrap<DomTypeHolder> for Element

Source§

const WRAP: unsafe fn(&mut JSContext, &GlobalScope, Option<HandleObject<'_>>, Box<Self>) -> Root<Dom<Self>>

Function pointer to the general wrap function type
Source§

impl Drop for Element

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl ElementMethods<DomTypeHolder> for Element

Source§

fn GetNamespaceURI(&self) -> Option<DOMString>

Source§

fn LocalName(&self) -> DOMString

Source§

fn GetPrefix(&self) -> Option<DOMString>

Source§

fn TagName(&self) -> DOMString

Source§

fn SetId(&self, cx: &mut JSContext, id: DOMString)

Source§

fn ClassName(&self) -> DOMString

Source§

fn SetClassName(&self, cx: &mut JSContext, class: DOMString)

Source§

fn ClassList(&self, cx: &mut JSContext) -> DomRoot<DOMTokenList>

Source§

fn Attributes(&self, can_gc: CanGc) -> DomRoot<NamedNodeMap>

Source§

fn HasAttributes(&self) -> bool

Source§

fn GetAttributeNames(&self) -> Vec<DOMString>

Source§

fn GetAttribute(&self, name: DOMString) -> Option<DOMString>

Source§

fn GetAttributeNS( &self, namespace: Option<DOMString>, local_name: DOMString, ) -> Option<DOMString>

Source§

fn GetAttributeNode(&self, name: DOMString) -> Option<DomRoot<Attr>>

Source§

fn GetAttributeNodeNS( &self, namespace: Option<DOMString>, local_name: DOMString, ) -> Option<DomRoot<Attr>>

Source§

fn ToggleAttribute( &self, cx: &mut JSContext, name: DOMString, force: Option<bool>, ) -> Fallible<bool>

Source§

fn SetAttribute( &self, cx: &mut JSContext, name: DOMString, value: TrustedHTMLOrTrustedScriptOrTrustedScriptURLOrString<DomTypeHolder>, ) -> ErrorResult

Source§

fn SetAttributeNS( &self, cx: &mut JSContext, namespace: Option<DOMString>, qualified_name: DOMString, value: TrustedHTMLOrTrustedScriptOrTrustedScriptURLOrString<DomTypeHolder>, ) -> ErrorResult

Source§

fn SetAttributeNode( &self, cx: &mut JSContext, attr: &Attr, ) -> Fallible<Option<DomRoot<Attr>>>

Source§

fn SetAttributeNodeNS( &self, cx: &mut JSContext, attr: &Attr, ) -> Fallible<Option<DomRoot<Attr>>>

Source§

fn RemoveAttribute(&self, cx: &mut JSContext, name: DOMString)

Source§

fn RemoveAttributeNS( &self, cx: &mut JSContext, namespace: Option<DOMString>, local_name: DOMString, )

Source§

fn RemoveAttributeNode( &self, cx: &mut JSContext, attr: &Attr, ) -> Fallible<DomRoot<Attr>>

Source§

fn HasAttribute(&self, name: DOMString) -> bool

Source§

fn HasAttributeNS( &self, namespace: Option<DOMString>, local_name: DOMString, ) -> bool

Source§

fn GetElementsByTagName( &self, cx: &mut JSContext, localname: DOMString, ) -> DomRoot<HTMLCollection>

Source§

fn GetElementsByTagNameNS( &self, cx: &mut JSContext, maybe_ns: Option<DOMString>, localname: DOMString, ) -> DomRoot<HTMLCollection>

Source§

fn GetElementsByClassName( &self, cx: &mut JSContext, classes: DOMString, ) -> DomRoot<HTMLCollection>

Source§

fn GetClientRects(&self, cx: &mut JSContext) -> DomRoot<DOMRectList>

Source§

fn GetBoundingClientRect(&self, cx: &mut JSContext) -> DomRoot<DOMRect>

Source§

fn Scroll(&self, options: &ScrollToOptions)

Source§

fn Scroll_(&self, x: f64, y: f64)

Source§

fn ScrollTo(&self, options: &ScrollToOptions)

Source§

fn ScrollTo_(&self, x: f64, y: f64)

Source§

fn ScrollBy(&self, options: &ScrollToOptions)

Source§

fn ScrollBy_(&self, x: f64, y: f64)

Source§

fn ScrollTop(&self) -> f64

Source§

fn ScrollLeft(&self) -> f64

Source§

fn SetScrollLeft(&self, _cx: &mut JSContext, x: f64)

Source§

fn ScrollIntoView(&self, arg: BooleanOrScrollIntoViewOptions)

Source§

fn ScrollWidth(&self) -> i32

Source§

fn ScrollHeight(&self) -> i32

Source§

fn ClientTop(&self) -> i32

Source§

fn ClientLeft(&self) -> i32

Source§

fn ClientWidth(&self) -> i32

Source§

fn ClientHeight(&self) -> i32

Source§

fn SetHTMLUnsafe( &self, cx: &mut JSContext, html: TrustedHTMLOrString<DomTypeHolder>, ) -> ErrorResult

Source§

fn GetHTML( &self, cx: &mut JSContext, options: &GetHTMLOptions<DomTypeHolder>, ) -> DOMString

Source§

fn GetInnerHTML( &self, cx: &mut JSContext, ) -> Fallible<TrustedHTMLOrNullIsEmptyString<DomTypeHolder>>

Source§

fn SetInnerHTML( &self, cx: &mut JSContext, value: TrustedHTMLOrNullIsEmptyString<DomTypeHolder>, ) -> ErrorResult

Source§

fn GetOuterHTML( &self, cx: &mut JSContext, ) -> Fallible<TrustedHTMLOrNullIsEmptyString<DomTypeHolder>>

Source§

fn SetOuterHTML( &self, cx: &mut JSContext, value: TrustedHTMLOrNullIsEmptyString<DomTypeHolder>, ) -> ErrorResult

Source§

fn GetPreviousElementSibling(&self) -> Option<DomRoot<Element>>

Source§

fn GetNextElementSibling(&self) -> Option<DomRoot<Element>>

Source§

fn Children(&self, cx: &mut JSContext) -> DomRoot<HTMLCollection>

Source§

fn GetFirstElementChild(&self) -> Option<DomRoot<Element>>

Source§

fn GetLastElementChild(&self) -> Option<DomRoot<Element>>

Source§

fn ChildElementCount(&self) -> u32

Source§

fn Prepend( &self, cx: &mut JSContext, nodes: Vec<NodeOrString<DomTypeHolder>>, ) -> ErrorResult

Source§

fn Append( &self, cx: &mut JSContext, nodes: Vec<NodeOrString<DomTypeHolder>>, ) -> ErrorResult

Source§

fn ReplaceChildren( &self, cx: &mut JSContext, nodes: Vec<NodeOrString<DomTypeHolder>>, ) -> ErrorResult

Source§

fn MoveBefore( &self, cx: &mut JSContext, node: &Node, child: Option<&Node>, ) -> ErrorResult

Source§

fn QuerySelector( &self, selectors: DOMString, ) -> Fallible<Option<DomRoot<Element>>>

Source§

fn QuerySelectorAll(&self, selectors: DOMString) -> Fallible<DomRoot<NodeList>>

Source§

fn Before( &self, cx: &mut JSContext, nodes: Vec<NodeOrString<DomTypeHolder>>, ) -> ErrorResult

Source§

fn After( &self, cx: &mut JSContext, nodes: Vec<NodeOrString<DomTypeHolder>>, ) -> ErrorResult

Source§

fn ReplaceWith( &self, cx: &mut JSContext, nodes: Vec<NodeOrString<DomTypeHolder>>, ) -> ErrorResult

Source§

fn Remove(&self, cx: &mut JSContext)

Source§

fn Matches(&self, selectors: DOMString) -> Fallible<bool>

Source§

fn WebkitMatchesSelector(&self, selectors: DOMString) -> Fallible<bool>

Source§

fn Closest(&self, selectors: DOMString) -> Fallible<Option<DomRoot<Element>>>

Source§

fn InsertAdjacentElement( &self, cx: &mut JSContext, where_: DOMString, element: &Element, ) -> Fallible<Option<DomRoot<Element>>>

Source§

fn InsertAdjacentText( &self, cx: &mut JSContext, where_: DOMString, data: DOMString, ) -> ErrorResult

Source§

fn InsertAdjacentHTML( &self, cx: &mut JSContext, position: DOMString, text: TrustedHTMLOrString<DomTypeHolder>, ) -> ErrorResult

Source§

fn RequestFullscreen(&self, can_gc: CanGc) -> Rc<Promise>

Source§

fn AttachShadow( &self, cx: &mut JSContext, init: &ShadowRootInit, ) -> Fallible<DomRoot<ShadowRoot>>

Source§

fn GetShadowRoot(&self) -> Option<DomRoot<ShadowRoot>>

Source§

fn GetCustomElementRegistry(&self) -> Option<DomRoot<CustomElementRegistry>>

Source§

fn GetRole(&self) -> Option<DOMString>

Source§

fn SetRole(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAssignedSlot(&self) -> Option<DomRoot<HTMLSlotElement>>

Source§

fn Part(&self, cx: &mut JSContext) -> DomRoot<DOMTokenList>

Source§

fn Id(&self) -> DOMString

Source§

fn Slot(&self) -> DOMString

Source§

fn SetSlot(&self, cx: &mut JSContext, value: DOMString)

Source§

fn SetScrollTop(&self, _cx: &mut JSContext, y_: f64)

Source§

fn CurrentCSSZoom(&self) -> Finite<f64>

Source§

fn EnterFormalActivationState(&self) -> ErrorResult

Source§

fn ExitFormalActivationState(&self) -> ErrorResult

Source§

fn GetAriaAtomic(&self) -> Option<DOMString>

Source§

fn SetAriaAtomic(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaAutoComplete(&self) -> Option<DOMString>

Source§

fn SetAriaAutoComplete(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaBrailleLabel(&self) -> Option<DOMString>

Source§

fn SetAriaBrailleLabel(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaBrailleRoleDescription(&self) -> Option<DOMString>

Source§

fn SetAriaBrailleRoleDescription( &self, cx: &mut JSContext, value: Option<DOMString>, )

Source§

fn GetAriaBusy(&self) -> Option<DOMString>

Source§

fn SetAriaBusy(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaChecked(&self) -> Option<DOMString>

Source§

fn SetAriaChecked(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaColCount(&self) -> Option<DOMString>

Source§

fn SetAriaColCount(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaColIndex(&self) -> Option<DOMString>

Source§

fn SetAriaColIndex(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaColIndexText(&self) -> Option<DOMString>

Source§

fn SetAriaColIndexText(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaColSpan(&self) -> Option<DOMString>

Source§

fn SetAriaColSpan(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaCurrent(&self) -> Option<DOMString>

Source§

fn SetAriaCurrent(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaDescription(&self) -> Option<DOMString>

Source§

fn SetAriaDescription(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaDisabled(&self) -> Option<DOMString>

Source§

fn SetAriaDisabled(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaExpanded(&self) -> Option<DOMString>

Source§

fn SetAriaExpanded(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaHasPopup(&self) -> Option<DOMString>

Source§

fn SetAriaHasPopup(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaHidden(&self) -> Option<DOMString>

Source§

fn SetAriaHidden(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaInvalid(&self) -> Option<DOMString>

Source§

fn SetAriaInvalid(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaKeyShortcuts(&self) -> Option<DOMString>

Source§

fn SetAriaKeyShortcuts(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaLabel(&self) -> Option<DOMString>

Source§

fn SetAriaLabel(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaLevel(&self) -> Option<DOMString>

Source§

fn SetAriaLevel(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaLive(&self) -> Option<DOMString>

Source§

fn SetAriaLive(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaModal(&self) -> Option<DOMString>

Source§

fn SetAriaModal(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaMultiLine(&self) -> Option<DOMString>

Source§

fn SetAriaMultiLine(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaMultiSelectable(&self) -> Option<DOMString>

Source§

fn SetAriaMultiSelectable(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaOrientation(&self) -> Option<DOMString>

Source§

fn SetAriaOrientation(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaPlaceholder(&self) -> Option<DOMString>

Source§

fn SetAriaPlaceholder(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaPosInSet(&self) -> Option<DOMString>

Source§

fn SetAriaPosInSet(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaPressed(&self) -> Option<DOMString>

Source§

fn SetAriaPressed(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaReadOnly(&self) -> Option<DOMString>

Source§

fn SetAriaReadOnly(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaRelevant(&self) -> Option<DOMString>

Source§

fn SetAriaRelevant(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaRequired(&self) -> Option<DOMString>

Source§

fn SetAriaRequired(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaRoleDescription(&self) -> Option<DOMString>

Source§

fn SetAriaRoleDescription(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaRowCount(&self) -> Option<DOMString>

Source§

fn SetAriaRowCount(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaRowIndex(&self) -> Option<DOMString>

Source§

fn SetAriaRowIndex(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaRowIndexText(&self) -> Option<DOMString>

Source§

fn SetAriaRowIndexText(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaRowSpan(&self) -> Option<DOMString>

Source§

fn SetAriaRowSpan(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaSelected(&self) -> Option<DOMString>

Source§

fn SetAriaSelected(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaSetSize(&self) -> Option<DOMString>

Source§

fn SetAriaSetSize(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaSort(&self) -> Option<DOMString>

Source§

fn SetAriaSort(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaValueMax(&self) -> Option<DOMString>

Source§

fn SetAriaValueMax(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaValueMin(&self) -> Option<DOMString>

Source§

fn SetAriaValueMin(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaValueNow(&self) -> Option<DOMString>

Source§

fn SetAriaValueNow(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

fn GetAriaValueText(&self) -> Option<DOMString>

Source§

fn SetAriaValueText(&self, cx: &mut JSContext, value: Option<DOMString>)

Source§

impl FormControlElementHelpers for Element

Source§

impl HasParent for Element

Source§

fn as_parent(&self) -> &Node

This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is

Source§

type Parent = Node

Source§

impl IDLInterface for Element

Source§

const PROTO_FIRST: u16 = 209

First prototype ID in the DFS-ordered range for this interface and its descendants.
Source§

const PROTO_LAST: u16 = 284

Last prototype ID in the DFS-ordered range for this interface and its descendants.
Source§

fn derives(class: &'static DOMClass) -> bool

Returns whether the given DOM class derives that interface.
Source§

impl MallocSizeOf for Element

Source§

fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself.
Source§

impl MutDomObject for Element

Source§

unsafe fn init_reflector<Actual>(&self, obj: *mut JSObject)

Initializes the Reflector Read more
Source§

unsafe fn init_reflector_without_associated_memory(&self, obj: *mut JSObject)

Initializes the Reflector without recording any associated memory usage. Read more
Source§

impl PartialEq for Element

Source§

fn eq(&self, other: &Self) -> 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 ToJSValConvertible for Element

Source§

unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)

Convert self to a JSVal. JSAPI failure causes a panic.
Source§

fn safe_to_jsval(&self, cx: &mut JSContext, rval: MutableHandle<'_, Value>)

Convert self to a JSVal. JSAPI failure causes a panic.
Source§

impl Traceable for Element

Source§

unsafe fn trace(&self, tracer: *mut JSTracer)

Trace self.
Source§

impl VirtualMethods for Element

Source§

fn cloning_steps( &self, cx: &mut JSContext, copy: &Node, maybe_doc: Option<&Document>, clone_children: CloneChildrenFlag, )

Source§

fn super_type(&self) -> Option<&dyn VirtualMethods>

Returns self as the superclass of the implementation for this trait, if any.
Source§

fn attribute_affects_presentational_hints(&self, attr: AttrRef<'_>) -> bool

Returns true if given attribute attr affects style of the given element.
Source§

fn attribute_mutated( &self, cx: &mut JSContext, attr: AttrRef<'_>, mutation: AttributeMutation<'_>, )

Source§

fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue

Returns the right AttrValue variant for the attribute with name name on this element.
Source§

fn bind_to_tree(&self, cx: &mut JSContext, context: &BindContext<'_>)

Called when a Node is appended to a tree.
Source§

fn unbind_from_tree(&self, cx: &mut JSContext, context: &UnbindContext<'_>)

Called when a Node is removed from a tree. Implements removing steps: https://dom.spec.whatwg.org/#concept-node-remove-ext
Source§

fn children_changed(&self, cx: &mut JSContext, mutation: &ChildrenMutation<'_>)

Called on the parent when its children are changed.
Source§

fn adopting_steps(&self, cx: &mut JSContext, old_doc: &Document)

Source§

fn post_connection_steps(&self, cx: &mut JSContext)

Invoked during a DOM tree mutation after a node becomes connected, once all related DOM tree mutations have been applied. https://dom.spec.whatwg.org/#concept-node-post-connection-ext
Source§

fn moving_steps(&self, cx: &mut JSContext, context: &MoveContext<'_>)

Source§

fn handle_event(&self, cx: &mut JSContext, event: &Event)

Called during event dispatch after the bubbling phase completes.
Source§

fn is_valid_command_steps(&self, command: CommandState) -> bool

Source§

fn command_steps( &self, cx: &mut JSContext, button: DomRoot<HTMLButtonElement>, command: CommandState, ) -> bool

Source§

fn pop(&self, cx: &mut JSContext)

Called on an element when it is popped off the stack of open elements of a parser.
§

impl DerivedFrom<Element> for Element

§

impl DerivedFrom<Element> for HTMLAnchorElement

§

impl DerivedFrom<Element> for HTMLAreaElement

§

impl DerivedFrom<Element> for HTMLAudioElement

§

impl DerivedFrom<Element> for HTMLBRElement

§

impl DerivedFrom<Element> for HTMLBaseElement

§

impl DerivedFrom<Element> for HTMLBodyElement

§

impl DerivedFrom<Element> for HTMLButtonElement

§

impl DerivedFrom<Element> for HTMLCanvasElement

§

impl DerivedFrom<Element> for HTMLDListElement

§

impl DerivedFrom<Element> for HTMLDataElement

§

impl DerivedFrom<Element> for HTMLDataListElement

§

impl DerivedFrom<Element> for HTMLDetailsElement

§

impl DerivedFrom<Element> for HTMLDialogElement

§

impl DerivedFrom<Element> for HTMLDirectoryElement

§

impl DerivedFrom<Element> for HTMLDivElement

§

impl DerivedFrom<Element> for HTMLElement

§

impl DerivedFrom<Element> for HTMLEmbedElement

§

impl DerivedFrom<Element> for HTMLFieldSetElement

§

impl DerivedFrom<Element> for HTMLFontElement

§

impl DerivedFrom<Element> for HTMLFormElement

§

impl DerivedFrom<Element> for HTMLFrameElement

§

impl DerivedFrom<Element> for HTMLFrameSetElement

§

impl DerivedFrom<Element> for HTMLHRElement

§

impl DerivedFrom<Element> for HTMLHeadElement

§

impl DerivedFrom<Element> for HTMLHeadingElement

§

impl DerivedFrom<Element> for HTMLHtmlElement

§

impl DerivedFrom<Element> for HTMLIFrameElement

§

impl DerivedFrom<Element> for HTMLImageElement

§

impl DerivedFrom<Element> for HTMLInputElement

§

impl DerivedFrom<Element> for HTMLLIElement

§

impl DerivedFrom<Element> for HTMLLabelElement

§

impl DerivedFrom<Element> for HTMLLegendElement

§

impl DerivedFrom<Element> for HTMLLinkElement

§

impl DerivedFrom<Element> for HTMLMapElement

§

impl DerivedFrom<Element> for HTMLMarqueeElement

§

impl DerivedFrom<Element> for HTMLMediaElement

§

impl DerivedFrom<Element> for HTMLMenuElement

§

impl DerivedFrom<Element> for HTMLMetaElement

§

impl DerivedFrom<Element> for HTMLMeterElement

§

impl DerivedFrom<Element> for HTMLModElement

§

impl DerivedFrom<Element> for HTMLOListElement

§

impl DerivedFrom<Element> for HTMLObjectElement

§

impl DerivedFrom<Element> for HTMLOptGroupElement

§

impl DerivedFrom<Element> for HTMLOptionElement

§

impl DerivedFrom<Element> for HTMLOutputElement

§

impl DerivedFrom<Element> for HTMLParagraphElement

§

impl DerivedFrom<Element> for HTMLParamElement

§

impl DerivedFrom<Element> for HTMLPictureElement

§

impl DerivedFrom<Element> for HTMLPreElement

§

impl DerivedFrom<Element> for HTMLProgressElement

§

impl DerivedFrom<Element> for HTMLQuoteElement

§

impl DerivedFrom<Element> for HTMLScriptElement

§

impl DerivedFrom<Element> for HTMLSelectElement

§

impl DerivedFrom<Element> for HTMLSlotElement

§

impl DerivedFrom<Element> for HTMLSourceElement

§

impl DerivedFrom<Element> for HTMLSpanElement

§

impl DerivedFrom<Element> for HTMLStyleElement

§

impl DerivedFrom<Element> for HTMLTableCaptionElement

§

impl DerivedFrom<Element> for HTMLTableCellElement

§

impl DerivedFrom<Element> for HTMLTableColElement

§

impl DerivedFrom<Element> for HTMLTableElement

§

impl DerivedFrom<Element> for HTMLTableRowElement

§

impl DerivedFrom<Element> for HTMLTableSectionElement

§

impl DerivedFrom<Element> for HTMLTemplateElement

§

impl DerivedFrom<Element> for HTMLTextAreaElement

§

impl DerivedFrom<Element> for HTMLTimeElement

§

impl DerivedFrom<Element> for HTMLTitleElement

§

impl DerivedFrom<Element> for HTMLTrackElement

§

impl DerivedFrom<Element> for HTMLUListElement

§

impl DerivedFrom<Element> for HTMLUnknownElement

§

impl DerivedFrom<Element> for HTMLVideoElement

§

impl DerivedFrom<Element> for SVGElement

§

impl DerivedFrom<Element> for SVGGraphicsElement

§

impl DerivedFrom<Element> for SVGImageElement

§

impl DerivedFrom<Element> for SVGSVGElement

§

impl DerivedFrom<EventTarget> for Element

§

impl DerivedFrom<Node> for Element

Source§

impl Eq for Element

Auto Trait Implementations§

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<D, T> DomGlobalGeneric<D> for T
where D: DomTypes, T: DomObject,

Source§

fn global_(&self, realm: InRealm<'_>) -> Root<Dom<<D as DomTypes>::GlobalScope>>
where Self: Sized,

Returns the [GlobalScope] of the realm that the DomObject was created in. If this object is a Node, this will be different from it’s owning Document if adopted by. For Nodes it’s almost always better to use NodeTraits::owning_global.
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> SafeToJSValConvertible for T

Source§

fn safe_to_jsval( &self, cx: JSContext, rval: MutableHandle<'_, Value>, _can_gc: CanGc, )

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ThisReflector for T
where T: DomObject,

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