#[repr(C)]pub struct Element {Show 13 fields
node: Node,
local_name: LocalName,
namespace: Namespace,
prefix: DomRefCell<Option<Prefix>>,
attrs: AttributeStorage,
id_attribute: AtomicRefCell<Option<Atom>>,
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§namespace: Namespace§prefix: DomRefCell<Option<Prefix>>§attrs: AttributeStorage§id_attribute: AtomicRefCell<Option<Atom>>§style_attribute: DomRefCell<Option<Arc<Locked<PropertyDeclarationBlock>>>>§attr_list: MutNullableDom<NamedNodeMap>§class_list: MutNullableDom<DOMTokenList>§state: Cell<ElementState>§selector_flags: AtomicUsizeThese 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
impl Element
fn __assert_parent_type(&self)
Source§impl Element
impl Element
Sourcepub(crate) fn get_attribute_string_value(
&self,
local_name: &LocalName,
) -> Option<String>
pub(crate) fn get_attribute_string_value( &self, local_name: &LocalName, ) -> Option<String>
Callers should convert the LocalName to ASCII lowercase before calling.
Consider using get_attribute_string_ref.
https://dom.spec.whatwg.org/#concept-element-attributes-get-by-name
Sourcepub(crate) fn get_attribute_string_ref<'a>(
&'a self,
local_name: &LocalName,
) -> Option<AttrStrRef<'a>>
pub(crate) fn get_attribute_string_ref<'a>( &'a self, local_name: &LocalName, ) -> Option<AttrStrRef<'a>>
This returns an attribute reference that can be seen as a &str. This keeps the borrow on attributes alive.
Callers should convert the LocalName to ASCII lowercase before calling.
pub(crate) fn get_attribute_string_value_with_namespace( &self, namespace: &Namespace, local_name: &LocalName, ) -> Option<String>
pub(crate) fn get_int_attribute( &self, local_name: &LocalName, default: i32, ) -> i32
pub(crate) fn set_atomic_attribute( &self, cx: &mut JSContext, local_name: &LocalName, value: DOMString, )
pub(crate) fn set_bool_attribute( &self, cx: &mut JSContext, local_name: &LocalName, value: bool, )
pub(crate) fn get_url_attribute(&self, local_name: &LocalName) -> USVString
pub(crate) fn set_url_attribute( &self, cx: &mut JSContext, local_name: &LocalName, value: USVString, )
pub(crate) fn get_trusted_type_url_attribute( &self, local_name: &LocalName, ) -> TrustedScriptURLOrUSVString<DomTypeHolder>
pub(crate) fn get_trusted_html_attribute( &self, local_name: &LocalName, ) -> TrustedHTMLOrString<DomTypeHolder>
pub(crate) fn get_string_attribute(&self, local_name: &LocalName) -> DOMString
pub(crate) fn set_string_attribute( &self, cx: &mut JSContext, local_name: &LocalName, value: DOMString, )
Sourcepub(crate) fn get_nullable_string_attribute(
&self,
local_name: &LocalName,
) -> Option<DOMString>
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.
Sourcepub(crate) fn set_nullable_string_attribute(
&self,
cx: &mut JSContext,
local_name: &LocalName,
value: Option<DOMString>,
)
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.
pub(crate) fn set_nullable_tokenlist_attribute( &self, cx: &mut JSContext, local_name: &LocalName, value: Option<DOMString>, )
Sourcepub(crate) fn any_tokenlist_attribute(
&self,
local_name: &LocalName,
f: impl Fn(&Atom) -> bool,
) -> bool
pub(crate) fn any_tokenlist_attribute( &self, local_name: &LocalName, f: impl Fn(&Atom) -> bool, ) -> bool
Returns true if any attribute in the tokenlist fulfill f. Equivalent to
get_tokenlist_attribute(name).iter().any(f).
pub(crate) fn get_tokenlist_attribute( &self, local_name: &LocalName, ) -> Vec<Atom> ⓘ
pub(crate) fn set_tokenlist_attribute( &self, cx: &mut JSContext, local_name: &LocalName, value: DOMString, )
pub(crate) fn get_uint_attribute( &self, local_name: &LocalName, default: u32, ) -> u32
Sourcefn compute_attribute_value_with_style_fast_path(
&self,
attr: AttrRef<'_>,
) -> AttrValue
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:
- It uses the same fast-path as CSSStyleDeclaration
- It also avoids the CSP checks when cloning (it shouldn’t run any when cloning existing valid attributes)
Sourcepub(crate) fn copy_all_attributes_to_other_element(
&self,
cx: &mut JSContext,
target_element: &Element,
)
pub(crate) fn copy_all_attributes_to_other_element( &self, cx: &mut JSContext, target_element: &Element, )
Source§impl Element
impl Element
pub(crate) fn create( cx: &mut JSContext, name: QualName, is: Option<LocalName>, document: &Document, creator: ElementCreator, mode: CustomElementCreationMode, proto: Option<HandleObject<'_>>, ) -> DomRoot<Element>
pub(crate) fn new_inherited( local_name: LocalName, namespace: Namespace, prefix: Option<Prefix>, document: &Document, ) -> Element
pub(crate) fn new_inherited_with_state( state: ElementState, local_name: LocalName, namespace: Namespace, prefix: Option<Prefix>, document: &Document, ) -> Element
pub(crate) fn set_had_duplicate_attributes(&self, no_gc: &NoGC)
pub(crate) fn new( cx: &mut JSContext, local_name: LocalName, namespace: Namespace, prefix: Option<Prefix>, document: &Document, proto: Option<HandleObject<'_>>, ) -> DomRoot<Element>
fn rare_data(&self) -> Ref<'_, Option<Box<ElementRareData>>>
fn rare_data_mut(&self) -> RefMut<'_, Option<Box<ElementRareData>>>
pub(crate) fn ensure_rare_data<'a: 'b, 'b>( &'a self, no_gc: &'b NoGC, ) -> RefMut<'b, Box<ElementRareData>>
pub(crate) fn clean_up_style_data(&self)
pub(crate) fn restyle(&self, no_gc: &NoGC, damage: NodeDamage)
pub(crate) fn has_dirty_descendants(&self) -> bool
pub(crate) fn note_dirty_descendants(&self, no_gc: &NoGC)
pub(crate) fn set_is(&self, is: LocalName, no_gc: &NoGC)
Sourcepub(crate) fn set_initial_custom_element_state_to_uncustomized(&self)
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.
Sourcepub(crate) fn set_custom_element_state(
&self,
state: CustomElementState,
no_gc: &NoGC,
)
pub(crate) fn set_custom_element_state( &self, state: CustomElementState, no_gc: &NoGC, )
pub(crate) fn get_custom_element_state(&self) -> CustomElementState
pub(crate) fn set_custom_element_definition( &self, definition: Rc<CustomElementDefinition>, no_gc: &NoGC, )
pub(crate) fn get_custom_element_definition( &self, ) -> Option<Rc<CustomElementDefinition>>
pub(crate) fn clear_custom_element_definition(&self, no_gc: &NoGC)
pub(crate) fn push_callback_reaction( &self, function: RootedCallback<Function<DomTypeHolder>>, args: Box<[Heap<JSVal>]>, no_gc: &NoGC, )
pub(crate) fn push_upgrade_reaction( &self, definition: Rc<CustomElementDefinition>, no_gc: &NoGC, )
pub(crate) fn clear_reaction_queue(&self)
pub(crate) fn invoke_reactions(&self, cx: &mut JSContext)
pub(crate) fn has_css_layout_box(&self, cx: &mut JSContext) -> bool
Sourcepub(crate) fn is_potentially_scrollable_body(&self, cx: &mut JSContext) -> bool
pub(crate) fn is_potentially_scrollable_body(&self, cx: &mut JSContext) -> bool
Sourcepub(crate) fn is_potentially_scrollable_body_for_scrolling_element(
&self,
cx: &mut JSContext,
) -> bool
pub(crate) fn is_potentially_scrollable_body_for_scrolling_element( &self, cx: &mut JSContext, ) -> bool
Sourcepub(crate) fn establishes_scroll_container(&self, cx: &mut JSContext) -> bool
pub(crate) fn establishes_scroll_container(&self, cx: &mut JSContext) -> bool
Whether this element is styled such that it establishes a scroll container. https://www.w3.org/TR/css-overflow-3/#scroll-container
Sourcepub(crate) fn establishes_scroll_container_without_reflow(&self) -> bool
pub(crate) fn establishes_scroll_container_without_reflow(&self) -> bool
Like Self::establishes_scroll_container, but without forcing a reflow.
pub(crate) fn has_overflow(&self, cx: &mut JSContext) -> bool
Sourcefn has_scrolling_box(&self, cx: &mut JSContext) -> bool
fn has_scrolling_box(&self, cx: &mut JSContext) -> bool
Whether or not this element has a scrolling box according to https://drafts.csswg.org/cssom-view/#scrolling-box.
This is true if:
- The element has a layout box.
- The style specifies that overflow should be scrollable (
auto,hiddenorscroll). - The fragment actually has content that overflows the box.
pub(crate) fn shadow_root(&self) -> Option<DomRoot<ShadowRoot>>
pub(crate) fn shadow_root_unrooted<'a>( &self, no_gc: &'a NoGC, ) -> Option<UnrootedDom<'a, ShadowRoot>>
pub(crate) fn is_shadow_host(&self) -> bool
Sourcepub(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>>
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>>
Sourcepub(crate) fn is_translate_enabled(&self) -> bool
pub(crate) fn is_translate_enabled(&self) -> bool
Sourcepub(crate) fn directionality(&self) -> String
pub(crate) fn directionality(&self) -> String
pub(crate) fn is_root(&self) -> bool
Sourcepub(crate) fn registered_intersection_observers_mut<'a: 'b, 'b>(
&'a self,
no_gc: &'b NoGC,
) -> RefMut<'b, Vec<IntersectionObserverRegistration>>
pub(crate) fn registered_intersection_observers_mut<'a: 'b, 'b>( &'a self, no_gc: &'b NoGC, ) -> RefMut<'b, Vec<IntersectionObserverRegistration>>
Return all IntersectionObserverRegistration for this element. Lazily initialize the raredata if it does not exist.
pub(crate) fn registered_intersection_observers( &self, ) -> Option<Ref<'_, Vec<IntersectionObserverRegistration>>>
pub(crate) fn get_intersection_observer_registration( &self, observer: &IntersectionObserver, ) -> Option<Ref<'_, IntersectionObserverRegistration>>
Sourcepub(crate) fn add_initial_intersection_observer_registration(
&self,
observer: &IntersectionObserver,
no_gc: &NoGC,
)
pub(crate) fn add_initial_intersection_observer_registration( &self, observer: &IntersectionObserver, no_gc: &NoGC, )
Add a new IntersectionObserverRegistration with initial value to the element.
Sourcepub(crate) fn remove_intersection_observer(
&self,
observer: &IntersectionObserver,
no_gc: &NoGC,
)
pub(crate) fn remove_intersection_observer( &self, observer: &IntersectionObserver, no_gc: &NoGC, )
Removes a certain IntersectionObserver.
Sourcepub(crate) fn scrolling_box(
&self,
flags: ScrollContainerQueryFlags,
) -> Option<ScrollingBox>
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.
Sourcepub(crate) fn scroll_into_view_with_options(
&self,
cx: &mut JSContext,
behavior: ScrollBehavior,
block: ScrollAxisState,
inline: ScrollAxisState,
container: Option<&Element>,
inner_target_rect: Option<Rect<Au, CSSPixel>>,
)
pub(crate) fn scroll_into_view_with_options( &self, cx: &mut JSContext, behavior: ScrollBehavior, block: ScrollAxisState, inline: ScrollAxisState, container: Option<&Element>, inner_target_rect: Option<Rect<Au, CSSPixel>>, )
pub(crate) fn ensure_contenteditable_selection_range( &self, cx: &mut JSContext, document: &Document, ) -> DomRoot<Range>
Sourcepub(crate) fn handle_scroll_event(&self)
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:
pub(crate) fn style( &self, cx: &mut JSContext, ) -> Option<ServoArc<ComputedValues>>
Sourcepub(crate) fn style_without_reflow(&self) -> Option<ServoArc<ComputedValues>>
pub(crate) fn style_without_reflow(&self) -> Option<ServoArc<ComputedValues>>
Do the same kind of query as Self::style, but do not force a reflow. This is for
callers that have just run another query and know the style data is already current.
pub(crate) fn is_styled(&self) -> bool
pub(crate) fn is_display_none(&self) -> bool
Sourcepub(crate) fn computed_user_select(&self) -> Option<UserSelect>
pub(crate) fn computed_user_select(&self) -> Option<UserSelect>
Returns the computed value of the user-select property. Returns None if the
element is unstyled.
pub(crate) fn check_style_on_self_or_eager_pseudos( &self, check_styles_fn: impl Fn(&ComputedValues) -> bool, ) -> bool
pub(crate) fn dirty_presentational_hints(&self)
Source§impl Element
impl Element
pub(crate) fn is_html_element(&self) -> bool
pub(crate) fn is_svg_element(&self) -> bool
pub(crate) fn html_element_in_html_document(&self) -> bool
pub(crate) fn local_name(&self) -> &LocalName
pub(crate) fn parsed_name(&self, name: DOMString) -> LocalName
pub(crate) fn namespace(&self) -> &Namespace
pub(crate) fn prefix(&self) -> Ref<'_, Option<Prefix>>
pub(crate) fn set_prefix(&self, prefix: Option<Prefix>)
pub(crate) fn set_custom_element_registry( &self, registry: Option<&CustomElementRegistry>, no_gc: &NoGC, )
pub(crate) fn custom_element_registry( &self, ) -> Option<DomRoot<CustomElementRegistry>>
pub(crate) fn attrs(&self) -> &AttributeStorage
pub(crate) fn dom_attrs(&self, cx: &mut JSContext) -> &AttributeStorage
Sourcepub(crate) fn locate_namespace(&self, prefix: Option<DOMString>) -> Namespace
pub(crate) fn locate_namespace(&self, prefix: Option<DOMString>) -> Namespace
Element branch of https://dom.spec.whatwg.org/#locate-a-namespace
pub(crate) fn name_attribute(&self) -> Option<Atom>
pub(crate) fn style_attribute( &self, ) -> &DomRefCell<Option<ServoArc<Locked<PropertyDeclarationBlock>>>>
pub(crate) fn summarize(&self) -> Vec<AttrInfo>
pub(crate) fn is_void(&self) -> bool
pub(crate) fn root_element(&self) -> DomRoot<Element>
Sourcepub(crate) fn lookup_prefix(&self, namespace: Namespace) -> Option<DOMString>
pub(crate) fn lookup_prefix(&self, namespace: Namespace) -> Option<DOMString>
Sourcepub(crate) fn is_document_element(&self) -> bool
pub(crate) fn is_document_element(&self) -> bool
Sourcepub(crate) fn is_active_element(&self) -> bool
pub(crate) fn is_active_element(&self) -> bool
pub(crate) fn is_actually_disabled(&self) -> bool
pub(crate) fn push_new_attribute( &self, cx: &mut JSContext, local_name: LocalName, value: AttrValue, name: LocalName, namespace: Namespace, prefix: Option<Prefix>, )
Sourcefn handle_attribute_changes(
&self,
cx: &mut JSContext,
attr: AttrRef<'_>,
old_value: Option<&AttrValue>,
new_value: Option<&AttrValue>,
)
fn handle_attribute_changes( &self, cx: &mut JSContext, attr: AttrRef<'_>, old_value: Option<&AttrValue>, new_value: Option<&AttrValue>, )
Sourcepub(crate) fn change_attribute(
&self,
cx: &mut JSContext,
attr: &Attr,
value: AttrValue,
)
pub(crate) fn change_attribute( &self, cx: &mut JSContext, attr: &Attr, value: AttrValue, )
Sourcepub(crate) fn push_attribute(&self, cx: &mut JSContext, attr: &Attr)
pub(crate) fn push_attribute(&self, cx: &mut JSContext, attr: &Attr)
pub(crate) fn with_attribute<R, F>( &self, namespace: &Namespace, local_name: &LocalName, map_func: F, ) -> Option<R>
pub(crate) fn attribute_str_ref<'a>( &'a self, namespace: &Namespace, local_name: &LocalName, ) -> Option<AttrStrRef<'a>>
Sourcepub(crate) fn get_attribute_with_namespace(
&self,
cx: &mut JSContext,
namespace: &Namespace,
local_name: &LocalName,
) -> Option<DomRoot<Attr>>
pub(crate) fn get_attribute_with_namespace( &self, cx: &mut JSContext, 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.
Sourcepub(crate) fn get_attribute_by_name(
&self,
cx: &mut JSContext,
name: DOMString,
) -> Option<DomRoot<Attr>>
pub(crate) fn get_attribute_by_name( &self, cx: &mut JSContext, name: DOMString, ) -> Option<DomRoot<Attr>>
pub(crate) fn set_attribute_from_parser( &self, cx: &mut JSContext, qname: QualName, value: DOMString, )
pub(crate) fn set_attribute( &self, cx: &mut JSContext, name: &LocalName, value: AttrValue, )
pub(crate) fn set_attribute_with_namespace( &self, cx: &mut JSContext, local_name: LocalName, value: AttrValue, name: LocalName, namespace: Namespace, prefix: Option<Prefix>, )
Sourcefn set_first_matching_attribute<F>(
&self,
cx: &mut JSContext,
local_name: LocalName,
value: AttrValue,
name: LocalName,
namespace: Namespace,
prefix: Option<Prefix>,
find: F,
)
fn set_first_matching_attribute<F>( &self, cx: &mut JSContext, local_name: LocalName, value: AttrValue, name: LocalName, namespace: Namespace, prefix: Option<Prefix>, find: F, )
pub(crate) fn parse_attribute( &self, namespace: &Namespace, local_name: &LocalName, value: DOMString, ) -> AttrValue
pub(crate) fn remove_attribute( &self, cx: &mut JSContext, namespace: &Namespace, local_name: &LocalName, ) -> Option<DomRoot<Attr>>
pub(crate) fn remove_attribute_by_name( &self, cx: &mut JSContext, name: &LocalName, ) -> Option<DomRoot<Attr>>
Sourcefn remove_first_matching_attribute<F>(
&self,
cx: &mut JSContext,
find: F,
) -> Option<DomRoot<Attr>>
fn remove_first_matching_attribute<F>( &self, cx: &mut JSContext, find: F, ) -> Option<DomRoot<Attr>>
pub(crate) fn has_class( &self, name: &Atom, case_sensitivity: CaseSensitivity, ) -> bool
pub(crate) fn has_attribute(&self, local_name: &LocalName) -> bool
pub(crate) fn will_mutate_attr(&self, no_gc: &NoGC, attr: AttrRef<'_>)
Sourcefn update_style_attribute(
&self,
cx: &mut JSContext,
attr: AttrRef<'_>,
mutation: AttributeMutation<'_>,
)
fn update_style_attribute( &self, cx: &mut JSContext, attr: AttrRef<'_>, mutation: AttributeMutation<'_>, )
Sourcefn set_attribute_node(
&self,
cx: &mut JSContext,
attr: &Attr,
) -> Fallible<Option<DomRoot<Attr>>>
fn set_attribute_node( &self, cx: &mut JSContext, attr: &Attr, ) -> Fallible<Option<DomRoot<Attr>>>
Sourcepub(crate) fn update_nonce_internal_slot(&self, nonce: String, no_gc: &NoGC)
pub(crate) fn update_nonce_internal_slot(&self, nonce: String, no_gc: &NoGC)
Sourcepub(crate) fn nonce_value(&self) -> String
pub(crate) fn nonce_value(&self) -> String
Sourcepub(crate) fn update_nonce_post_connection(&self, cx: &mut JSContext)
pub(crate) fn update_nonce_post_connection(&self, cx: &mut JSContext)
Sourcepub(crate) fn is_nonceable(&self) -> bool
pub(crate) fn is_nonceable(&self) -> bool
Sourcepub(crate) fn insert_adjacent(
&self,
cx: &mut JSContext,
where_: AdjacentPosition,
node: &Node,
) -> Fallible<Option<DomRoot<Node>>>
pub(crate) fn insert_adjacent( &self, cx: &mut JSContext, where_: AdjacentPosition, node: &Node, ) -> Fallible<Option<DomRoot<Node>>>
Sourcepub(crate) fn parse_fragment(
&self,
markup: DOMString,
cx: &mut JSContext,
) -> Fallible<DomRoot<DocumentFragment>>
pub(crate) fn parse_fragment( &self, markup: DOMString, cx: &mut JSContext, ) -> Fallible<DomRoot<DocumentFragment>>
Sourcepub(crate) fn fragment_parsing_context(
cx: &mut JSContext,
owner_doc: &Document,
element: Option<&Self>,
) -> DomRoot<Self>
pub(crate) fn fragment_parsing_context( cx: &mut JSContext, owner_doc: &Document, element: Option<&Self>, ) -> DomRoot<Self>
Sourcepub(crate) fn is_in_same_home_subtree<T>(&self, other: &T) -> bool
pub(crate) fn is_in_same_home_subtree<T>(&self, other: &T) -> bool
pub(crate) fn get_id(&self) -> Option<Atom>
pub(crate) fn get_name(&self) -> Option<Atom>
pub(crate) fn get_element_internals(&self) -> Option<DomRoot<ElementInternals>>
pub(crate) fn outer_html(&self, cx: &mut JSContext) -> Fallible<DOMString>
pub(crate) fn compute_source_position(&self, line_number: u32) -> SourcePosition
pub(crate) fn explicitly_set_tab_index(&self) -> Option<i32>
fn insert_selector_flags(&self, flags: ElementSelectorFlags)
fn get_selector_flags(&self) -> ElementSelectorFlags
Sourcepub(crate) fn needs_preserved_style_attribute_after_change(&self) -> bool
pub(crate) fn needs_preserved_style_attribute_after_change(&self) -> bool
Custom Elements and those with mutation observers sometimes need the old style
attribute to persist after modification, because it is sent as an argument to
script callbacks. Normally that’s not the case, so this method tries to detect
when it’s required so it can be avoided for performance reasons.
pub(crate) fn register_current_id_and_name_attribute(&self, cx: &mut JSContext)
pub(crate) fn unregister_current_id_and_name_attribute( &self, cx: &mut JSContext, )
Sourcepub(crate) fn qualified_name(&self) -> Cow<'_, str>
pub(crate) fn qualified_name(&self) -> Cow<'_, str>
An element’s qualified name is its local name if its namespace prefix is null; otherwise its namespace prefix, followed by “:”, followed by its local name. https://dom.spec.whatwg.org/#concept-element-qualified-name
Source§impl Element
impl Element
pub(crate) fn client_rect(&self, cx: &mut JSContext) -> Rect<i32, CSSPixel>
pub(crate) fn as_maybe_activatable(&self) -> Option<&dyn Activatable>
pub(crate) fn as_stylesheet_owner(&self) -> Option<&dyn StylesheetOwner>
Sourcepub(crate) fn as_maybe_validatable(&self) -> Option<&dyn Validatable>
pub(crate) fn as_maybe_validatable(&self) -> Option<&dyn Validatable>
pub(crate) fn is_invalid(&self, cx: &mut JSContext, needs_update: bool) -> bool
pub(crate) fn is_instance_validatable(&self, no_gc: &NoGC) -> bool
pub(crate) fn init_state_for_internals(&self, no_gc: &NoGC)
pub(crate) fn click_in_progress(&self) -> bool
pub(crate) fn set_click_in_progress(&self, click: bool)
pub fn state(&self) -> ElementState
pub(crate) fn set_state(&self, no_gc: &NoGC, which: ElementState, value: bool)
Sourcepub(crate) fn set_active_state(&self, no_gc: &NoGC, value: bool)
pub(crate) fn set_active_state(&self, no_gc: &NoGC, value: bool)
pub(crate) fn focus_state(&self) -> bool
pub(crate) fn set_focus_state(&self, no_gc: &NoGC, value: bool)
pub(crate) fn set_focusring_state(&self, no_gc: &NoGC, value: bool)
pub(crate) fn focus_within_state(&self) -> bool
pub(crate) fn set_focus_within_state(&self, no_gc: &NoGC, value: bool)
pub(crate) fn set_hover_state(&self, no_gc: &NoGC, value: bool)
pub(crate) fn enabled_state(&self) -> bool
pub(crate) fn set_enabled_state(&self, no_gc: &NoGC, value: bool)
pub(crate) fn disabled_state(&self) -> bool
pub(crate) fn set_disabled_state(&self, no_gc: &NoGC, value: bool)
pub(crate) fn read_write_state(&self) -> bool
pub(crate) fn set_read_write_state(&self, no_gc: &NoGC, value: bool)
pub(crate) fn set_open_state(&self, no_gc: &NoGC, value: bool)
pub(crate) fn set_placeholder_shown_state(&self, no_gc: &NoGC, value: bool)
pub(crate) fn set_modal_state(&self, no_gc: &NoGC, value: bool)
pub(crate) fn set_target_state(&self, no_gc: &NoGC, value: bool)
pub(crate) fn set_fullscreen_state(&self, no_gc: &NoGC, value: bool)
Sourcepub(crate) fn is_connected(&self) -> bool
pub(crate) fn is_connected(&self) -> bool
pub(crate) fn get_computed_role(&self, cx: &mut JSContext) -> Option<DOMString>
Source§impl Element
impl Element
Sourcepub(crate) fn is_disabled_by_ancestor_fieldset(&self, no_gc: &NoGC) -> bool
pub(crate) fn is_disabled_by_ancestor_fieldset(&self, no_gc: &NoGC) -> bool
Whether this Element is disabled by an HTMLFieldSetElement ancestor:
- It is the descendant of a disabled fieldset.
- It is not the descendant of of that fieldset’s first
HTMLLegendElementchild.
pub(crate) fn check_ancestors_disabled_state_for_form_control( &self, no_gc: &NoGC, )
pub(crate) fn check_disabled_attribute(&self, no_gc: &NoGC)
pub(crate) fn update_read_write_state_from_readonly_attribute( &self, no_gc: &NoGC, )
Source§impl Element
impl Element
Sourcepub(crate) fn focusable_area_kind(
&self,
cx: &mut JSContext,
) -> FocusableAreaKind
pub(crate) fn focusable_area_kind( &self, cx: &mut JSContext, ) -> 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.”
Sourcepub(crate) fn is_sequentially_focusable(&self, cx: &mut JSContext) -> bool
pub(crate) fn is_sequentially_focusable(&self, cx: &mut JSContext) -> bool
Sourcepub(crate) fn is_focusable_area(&self, cx: &mut JSContext) -> bool
pub(crate) fn is_focusable_area(&self, cx: &mut JSContext) -> bool
pub(crate) fn set_focus_within_state_for_inclusive_ancestors( &self, no_gc: &NoGC, maybe_common_ancestor: Option<&Node>, focus_within_state: bool, )
pub(crate) fn maybe_reset_focus_within_state( &self, no_gc: &NoGC, parent_element: Option<&Element>, )
Source§impl Element
impl Element
pub(crate) fn resolved_display_value( &self, cx: &mut JSContext, ) -> Option<DisplayOutside>
Sourcepub(crate) fn specified_command_value(
&self,
cx: &mut JSContext,
command: &CommandName,
) -> Option<DOMString>
pub(crate) fn specified_command_value( &self, cx: &mut JSContext, command: &CommandName, ) -> Option<DOMString>
Sourcepub(crate) fn is_modifiable_element(&self) -> bool
pub(crate) fn is_modifiable_element(&self) -> bool
pub(crate) fn is_indentation_element(&self) -> bool
pub(crate) fn has_empty_style_attribute(&self) -> bool
Sourcepub(crate) fn is_non_list_single_line_container(&self) -> bool
pub(crate) fn is_non_list_single_line_container(&self) -> bool
Sourcepub(crate) fn is_simple_modifiable_element(&self) -> bool
pub(crate) fn is_simple_modifiable_element(&self) -> bool
pub(crate) fn is_simple_indentation_element(&self) -> bool
Source§impl Element
impl Element
fn determine_auto_margins(&self, cx: &mut JSContext) -> AutoMargins
Trait Implementations§
§impl Castable for Element
impl Castable for Element
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 MathMLElement
impl DerivedFrom<Element> for SVGAElement
impl DerivedFrom<Element> for SVGCircleElement
impl DerivedFrom<Element> for SVGDefsElement
impl DerivedFrom<Element> for SVGElement
impl DerivedFrom<Element> for SVGEllipseElement
impl DerivedFrom<Element> for SVGGElement
impl DerivedFrom<Element> for SVGGeometryElement
impl DerivedFrom<Element> for SVGGradientElement
impl DerivedFrom<Element> for SVGGraphicsElement
impl DerivedFrom<Element> for SVGImageElement
impl DerivedFrom<Element> for SVGLineElement
impl DerivedFrom<Element> for SVGLinearGradientElement
impl DerivedFrom<Element> for SVGPathElement
impl DerivedFrom<Element> for SVGPatternElement
impl DerivedFrom<Element> for SVGPolygonElement
impl DerivedFrom<Element> for SVGPolylineElement
impl DerivedFrom<Element> for SVGRadialGradientElement
impl DerivedFrom<Element> for SVGRectElement
impl DerivedFrom<Element> for SVGSVGElement
impl DerivedFrom<Element> for SVGStopElement
impl DerivedFrom<Element> for SVGSymbolElement
impl DerivedFrom<Element> for SVGTSpanElement
impl DerivedFrom<Element> for SVGTextContentElement
impl DerivedFrom<Element> for SVGTextElement
impl DerivedFrom<Element> for SVGTextPositioningElement
impl DerivedFrom<Element> for SVGUseElement
impl DerivedFrom<EventTarget> for Element
impl DerivedFrom<Node> for Element
Source§impl DomObject for Element
impl DomObject for Element
type ReflectorType = <Node as DomObject>::ReflectorType
Source§fn reflector(&self) -> &Reflector<Self::ReflectorType>
fn reflector(&self) -> &Reflector<Self::ReflectorType>
Source§impl DomObjectWrap<DomTypeHolder> for Element
impl DomObjectWrap<DomTypeHolder> for Element
Source§impl ElementMethods<DomTypeHolder> for Element
impl ElementMethods<DomTypeHolder> for Element
Source§fn GetNamespaceURI(&self) -> Option<DOMString>
fn GetNamespaceURI(&self) -> Option<DOMString>
Source§fn SetClassName(&self, cx: &mut JSContext, class: DOMString)
fn SetClassName(&self, cx: &mut JSContext, class: DOMString)
Source§fn Attributes(&self, cx: &mut JSContext) -> DomRoot<NamedNodeMap>
fn Attributes(&self, cx: &mut JSContext) -> DomRoot<NamedNodeMap>
Source§fn GetAttributeNames(&self) -> Vec<DOMString>
fn GetAttributeNames(&self) -> Vec<DOMString>
Source§fn GetAttributeNS(
&self,
cx: &mut JSContext,
namespace: Option<DOMString>,
local_name: DOMString,
) -> Option<DOMString>
fn GetAttributeNS( &self, cx: &mut JSContext, namespace: Option<DOMString>, local_name: DOMString, ) -> Option<DOMString>
Source§fn GetAttributeNodeNS(
&self,
cx: &mut JSContext,
namespace: Option<DOMString>,
local_name: DOMString,
) -> Option<DomRoot<Attr>>
fn GetAttributeNodeNS( &self, cx: &mut JSContext, namespace: Option<DOMString>, local_name: DOMString, ) -> Option<DomRoot<Attr>>
Source§fn ToggleAttribute(
&self,
cx: &mut JSContext,
name: DOMString,
force: Option<bool>,
) -> Fallible<bool>
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
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
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>>>
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>>>
fn SetAttributeNodeNS( &self, cx: &mut JSContext, attr: &Attr, ) -> Fallible<Option<DomRoot<Attr>>>
Source§fn RemoveAttribute(&self, cx: &mut JSContext, name: DOMString)
fn RemoveAttribute(&self, cx: &mut JSContext, name: DOMString)
Source§fn RemoveAttributeNS(
&self,
cx: &mut JSContext,
namespace: Option<DOMString>,
local_name: DOMString,
)
fn RemoveAttributeNS( &self, cx: &mut JSContext, namespace: Option<DOMString>, local_name: DOMString, )
Source§fn HasAttributeNS(
&self,
cx: &mut JSContext,
namespace: Option<DOMString>,
local_name: DOMString,
) -> bool
fn HasAttributeNS( &self, cx: &mut JSContext, namespace: Option<DOMString>, local_name: DOMString, ) -> bool
Source§fn GetElementsByTagName(
&self,
cx: &mut JSContext,
localname: DOMString,
) -> DomRoot<HTMLCollection>
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>
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>
fn GetElementsByClassName( &self, cx: &mut JSContext, classes: DOMString, ) -> DomRoot<HTMLCollection>
Source§fn GetClientRects(&self, cx: &mut JSContext) -> DomRoot<DOMRectList>
fn GetClientRects(&self, cx: &mut JSContext) -> DomRoot<DOMRectList>
Source§fn Scroll(&self, cx: &mut JSContext, options: &ScrollToOptions)
fn Scroll(&self, cx: &mut JSContext, options: &ScrollToOptions)
Source§fn ScrollTo(&self, cx: &mut JSContext, options: &ScrollToOptions)
fn ScrollTo(&self, cx: &mut JSContext, options: &ScrollToOptions)
Source§fn ScrollBy(&self, cx: &mut JSContext, options: &ScrollToOptions)
fn ScrollBy(&self, cx: &mut JSContext, options: &ScrollToOptions)
Source§fn ScrollLeft(&self, cx: &mut JSContext) -> f64
fn ScrollLeft(&self, cx: &mut JSContext) -> f64
Source§fn SetScrollLeft(&self, cx: &mut JSContext, x: f64)
fn SetScrollLeft(&self, cx: &mut JSContext, x: f64)
Source§fn ScrollIntoView(
&self,
cx: &mut JSContext,
arg: BooleanOrScrollIntoViewOptions,
)
fn ScrollIntoView( &self, cx: &mut JSContext, arg: BooleanOrScrollIntoViewOptions, )
Source§fn ScrollWidth(&self, cx: &mut JSContext) -> i32
fn ScrollWidth(&self, cx: &mut JSContext) -> i32
Source§fn ScrollHeight(&self, cx: &mut JSContext) -> i32
fn ScrollHeight(&self, cx: &mut JSContext) -> i32
Source§fn ClientLeft(&self, cx: &mut JSContext) -> i32
fn ClientLeft(&self, cx: &mut JSContext) -> i32
Source§fn ClientWidth(&self, cx: &mut JSContext) -> i32
fn ClientWidth(&self, cx: &mut JSContext) -> i32
Source§fn ClientHeight(&self, cx: &mut JSContext) -> i32
fn ClientHeight(&self, cx: &mut JSContext) -> i32
Source§fn SetHTMLUnsafe(
&self,
cx: &mut JSContext,
html: TrustedHTMLOrString<DomTypeHolder>,
options: &SetHTMLUnsafeOptions<DomTypeHolder>,
) -> ErrorResult
fn SetHTMLUnsafe( &self, cx: &mut JSContext, html: TrustedHTMLOrString<DomTypeHolder>, options: &SetHTMLUnsafeOptions<DomTypeHolder>, ) -> ErrorResult
Source§fn SetHTML(
&self,
cx: &mut JSContext,
html: DOMString,
options: &SetHTMLOptions<DomTypeHolder>,
) -> ErrorResult
fn SetHTML( &self, cx: &mut JSContext, html: DOMString, options: &SetHTMLOptions<DomTypeHolder>, ) -> ErrorResult
Source§fn GetHTML(
&self,
cx: &mut JSContext,
options: &GetHTMLOptions<DomTypeHolder>,
) -> DOMString
fn GetHTML( &self, cx: &mut JSContext, options: &GetHTMLOptions<DomTypeHolder>, ) -> DOMString
Source§fn GetInnerHTML(
&self,
cx: &mut JSContext,
) -> Fallible<TrustedHTMLOrNullIsEmptyString<DomTypeHolder>>
fn GetInnerHTML( &self, cx: &mut JSContext, ) -> Fallible<TrustedHTMLOrNullIsEmptyString<DomTypeHolder>>
Source§fn SetInnerHTML(
&self,
cx: &mut JSContext,
value: TrustedHTMLOrNullIsEmptyString<DomTypeHolder>,
) -> ErrorResult
fn SetInnerHTML( &self, cx: &mut JSContext, value: TrustedHTMLOrNullIsEmptyString<DomTypeHolder>, ) -> ErrorResult
Source§fn GetOuterHTML(
&self,
cx: &mut JSContext,
) -> Fallible<TrustedHTMLOrNullIsEmptyString<DomTypeHolder>>
fn GetOuterHTML( &self, cx: &mut JSContext, ) -> Fallible<TrustedHTMLOrNullIsEmptyString<DomTypeHolder>>
Source§fn SetOuterHTML(
&self,
cx: &mut JSContext,
value: TrustedHTMLOrNullIsEmptyString<DomTypeHolder>,
) -> ErrorResult
fn SetOuterHTML( &self, cx: &mut JSContext, value: TrustedHTMLOrNullIsEmptyString<DomTypeHolder>, ) -> ErrorResult
Source§fn ChildElementCount(&self) -> u32
fn ChildElementCount(&self) -> u32
Source§fn Prepend(
&self,
cx: &mut JSContext,
nodes: Vec<NodeOrString<DomTypeHolder>>,
) -> ErrorResult
fn Prepend( &self, cx: &mut JSContext, nodes: Vec<NodeOrString<DomTypeHolder>>, ) -> ErrorResult
Source§fn Append(
&self,
cx: &mut JSContext,
nodes: Vec<NodeOrString<DomTypeHolder>>,
) -> ErrorResult
fn Append( &self, cx: &mut JSContext, nodes: Vec<NodeOrString<DomTypeHolder>>, ) -> ErrorResult
Source§fn ReplaceChildren(
&self,
cx: &mut JSContext,
nodes: Vec<NodeOrString<DomTypeHolder>>,
) -> ErrorResult
fn ReplaceChildren( &self, cx: &mut JSContext, nodes: Vec<NodeOrString<DomTypeHolder>>, ) -> ErrorResult
Source§fn MoveBefore(
&self,
cx: &mut JSContext,
node: &Node,
child: Option<&Node>,
) -> ErrorResult
fn MoveBefore( &self, cx: &mut JSContext, node: &Node, child: Option<&Node>, ) -> ErrorResult
Source§fn QuerySelector(
&self,
cx: &mut JSContext,
selectors: DOMString,
) -> Fallible<Option<DomRoot<Element>>>
fn QuerySelector( &self, cx: &mut JSContext, selectors: DOMString, ) -> Fallible<Option<DomRoot<Element>>>
Source§fn QuerySelectorAll(
&self,
cx: &mut JSContext,
selectors: DOMString,
) -> Fallible<DomRoot<NodeList>>
fn QuerySelectorAll( &self, cx: &mut JSContext, selectors: DOMString, ) -> Fallible<DomRoot<NodeList>>
Source§fn Before(
&self,
cx: &mut JSContext,
nodes: Vec<NodeOrString<DomTypeHolder>>,
) -> ErrorResult
fn Before( &self, cx: &mut JSContext, nodes: Vec<NodeOrString<DomTypeHolder>>, ) -> ErrorResult
Source§fn After(
&self,
cx: &mut JSContext,
nodes: Vec<NodeOrString<DomTypeHolder>>,
) -> ErrorResult
fn After( &self, cx: &mut JSContext, nodes: Vec<NodeOrString<DomTypeHolder>>, ) -> ErrorResult
Source§fn ReplaceWith(
&self,
cx: &mut JSContext,
nodes: Vec<NodeOrString<DomTypeHolder>>,
) -> ErrorResult
fn ReplaceWith( &self, cx: &mut JSContext, nodes: Vec<NodeOrString<DomTypeHolder>>, ) -> ErrorResult
Source§fn InsertAdjacentElement(
&self,
cx: &mut JSContext,
where_: DOMString,
element: &Element,
) -> Fallible<Option<DomRoot<Element>>>
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
fn InsertAdjacentText( &self, cx: &mut JSContext, where_: DOMString, data: DOMString, ) -> ErrorResult
Source§fn InsertAdjacentHTML(
&self,
cx: &mut JSContext,
position: DOMString,
text: TrustedHTMLOrString<DomTypeHolder>,
) -> ErrorResult
fn InsertAdjacentHTML( &self, cx: &mut JSContext, position: DOMString, text: TrustedHTMLOrString<DomTypeHolder>, ) -> ErrorResult
Source§fn RequestFullscreen(&self, cx: &mut CurrentRealm<'_>) -> RootedPromise
fn RequestFullscreen(&self, cx: &mut CurrentRealm<'_>) -> RootedPromise
Source§fn SetPointerCapture(&self, pointer_id: i32) -> ErrorResult
fn SetPointerCapture(&self, pointer_id: i32) -> ErrorResult
Source§fn ReleasePointerCapture(&self, pointer_id: i32) -> ErrorResult
fn ReleasePointerCapture(&self, pointer_id: i32) -> ErrorResult
Source§fn HasPointerCapture(&self, pointer_id: i32) -> bool
fn HasPointerCapture(&self, pointer_id: i32) -> bool
Source§fn AttachShadow(
&self,
cx: &mut JSContext,
init: &ShadowRootInit,
) -> Fallible<DomRoot<ShadowRoot>>
fn AttachShadow( &self, cx: &mut JSContext, init: &ShadowRootInit, ) -> Fallible<DomRoot<ShadowRoot>>
Source§fn GetShadowRoot(&self) -> Option<DomRoot<ShadowRoot>>
fn GetShadowRoot(&self) -> Option<DomRoot<ShadowRoot>>
Source§fn GetCustomElementRegistry(&self) -> Option<DomRoot<CustomElementRegistry>>
fn GetCustomElementRegistry(&self) -> Option<DomRoot<CustomElementRegistry>>
Source§fn GetAssignedSlot(&self, cx: &JSContext) -> Option<DomRoot<HTMLSlotElement>>
fn GetAssignedSlot(&self, cx: &JSContext) -> Option<DomRoot<HTMLSlotElement>>
Source§fn Animate(
&self,
cx: &mut JSContext,
keyframes: *mut JSObject,
options: UnrestrictedDoubleOrKeyframeAnimationOptions<DomTypeHolder>,
) -> DomRoot<Animation>
fn Animate( &self, cx: &mut JSContext, keyframes: *mut JSObject, options: UnrestrictedDoubleOrKeyframeAnimationOptions<DomTypeHolder>, ) -> DomRoot<Animation>
fn Id(&self) -> DOMString
fn Slot(&self) -> DOMString
fn SetSlot(&self, cx: &mut JSContext, value: DOMString)
fn SetScrollTop(&self, cx: &mut JSContext, y_: f64)
fn CurrentCSSZoom(&self, cx: &mut JSContext) -> Finite<f64>
fn EnterFormalActivationState(&self, cx: &JSContext) -> ErrorResult
fn ExitFormalActivationState(&self, cx: &JSContext) -> ErrorResult
fn GetAriaAtomic(&self) -> Option<DOMString>
fn SetAriaAtomic(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaAutoComplete(&self) -> Option<DOMString>
fn SetAriaAutoComplete(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaBrailleLabel(&self) -> Option<DOMString>
fn SetAriaBrailleLabel(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaBrailleRoleDescription(&self) -> Option<DOMString>
fn SetAriaBrailleRoleDescription( &self, cx: &mut JSContext, value: Option<DOMString>, )
fn GetAriaBusy(&self) -> Option<DOMString>
fn SetAriaBusy(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaChecked(&self) -> Option<DOMString>
fn SetAriaChecked(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaColCount(&self) -> Option<DOMString>
fn SetAriaColCount(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaColIndex(&self) -> Option<DOMString>
fn SetAriaColIndex(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaColIndexText(&self) -> Option<DOMString>
fn SetAriaColIndexText(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaColSpan(&self) -> Option<DOMString>
fn SetAriaColSpan(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaCurrent(&self) -> Option<DOMString>
fn SetAriaCurrent(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaDescription(&self) -> Option<DOMString>
fn SetAriaDescription(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaDisabled(&self) -> Option<DOMString>
fn SetAriaDisabled(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaExpanded(&self) -> Option<DOMString>
fn SetAriaExpanded(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaHasPopup(&self) -> Option<DOMString>
fn SetAriaHasPopup(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaHidden(&self) -> Option<DOMString>
fn SetAriaHidden(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaInvalid(&self) -> Option<DOMString>
fn SetAriaInvalid(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaKeyShortcuts(&self) -> Option<DOMString>
fn SetAriaKeyShortcuts(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaLabel(&self) -> Option<DOMString>
fn SetAriaLabel(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaLevel(&self) -> Option<DOMString>
fn SetAriaLevel(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaLive(&self) -> Option<DOMString>
fn SetAriaLive(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaModal(&self) -> Option<DOMString>
fn SetAriaModal(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaMultiLine(&self) -> Option<DOMString>
fn SetAriaMultiLine(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaMultiSelectable(&self) -> Option<DOMString>
fn SetAriaMultiSelectable(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaOrientation(&self) -> Option<DOMString>
fn SetAriaOrientation(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaPlaceholder(&self) -> Option<DOMString>
fn SetAriaPlaceholder(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaPosInSet(&self) -> Option<DOMString>
fn SetAriaPosInSet(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaPressed(&self) -> Option<DOMString>
fn SetAriaPressed(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaReadOnly(&self) -> Option<DOMString>
fn SetAriaReadOnly(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaRelevant(&self) -> Option<DOMString>
fn SetAriaRelevant(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaRequired(&self) -> Option<DOMString>
fn SetAriaRequired(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaRoleDescription(&self) -> Option<DOMString>
fn SetAriaRoleDescription(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaRowCount(&self) -> Option<DOMString>
fn SetAriaRowCount(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaRowIndex(&self) -> Option<DOMString>
fn SetAriaRowIndex(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaRowIndexText(&self) -> Option<DOMString>
fn SetAriaRowIndexText(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaRowSpan(&self) -> Option<DOMString>
fn SetAriaRowSpan(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaSelected(&self) -> Option<DOMString>
fn SetAriaSelected(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaSetSize(&self) -> Option<DOMString>
fn SetAriaSetSize(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaSort(&self) -> Option<DOMString>
fn SetAriaSort(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaValueMax(&self) -> Option<DOMString>
fn SetAriaValueMax(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaValueMin(&self) -> Option<DOMString>
fn SetAriaValueMin(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaValueNow(&self) -> Option<DOMString>
fn SetAriaValueNow(&self, cx: &mut JSContext, value: Option<DOMString>)
fn GetAriaValueText(&self) -> Option<DOMString>
fn SetAriaValueText(&self, cx: &mut JSContext, value: Option<DOMString>)
impl Eq for Element
Source§impl FormControlElementHelpers for Element
impl FormControlElementHelpers for Element
fn as_maybe_form_control(&self) -> Option<&dyn FormControl>
Source§impl HasPrototype for Element
impl HasPrototype for Element
const PROTOTYPE_ID: ID = script_bindings::codegen::PrototypeList::ID::Element
Source§impl IDLInterface for Element
impl IDLInterface for Element
Source§const PROTO_ID: ID = PrototypeList::ID::Element
const PROTO_ID: ID = PrototypeList::ID::Element
Source§const PROTO_FIRST: u16 = 227
const PROTO_FIRST: u16 = 227
Source§const PROTO_LAST: u16 = 325
const PROTO_LAST: u16 = 325
Source§impl MallocSizeOf for Element
impl MallocSizeOf for Element
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Source§impl MutDomObject for Element
impl MutDomObject for Element
Source§impl OwnerWindow<DomTypeHolder> for Element
impl OwnerWindow<DomTypeHolder> for Element
Source§impl PrototypeInitializer for Element
impl PrototypeInitializer for Element
fn set_proto_id(&mut self, id: ID)
Source§impl ToJSValConvertible for Element
impl ToJSValConvertible for Element
Source§fn to_jsval(&self, cx: &mut JSContext, rval: MutableHandleValue<'_>)
fn to_jsval(&self, cx: &mut JSContext, rval: MutableHandleValue<'_>)
self to a JSVal. JSAPI failure causes a panic.Source§impl VirtualMethods for Element
impl VirtualMethods for Element
Source§fn cloning_steps(
&self,
cx: &mut JSContext,
copy: &Node,
maybe_doc: Option<&Document>,
clone_children: CloneChildrenFlag,
)
fn cloning_steps( &self, cx: &mut JSContext, copy: &Node, maybe_doc: Option<&Document>, clone_children: CloneChildrenFlag, )
Source§fn super_type(&self) -> Option<&dyn VirtualMethods>
fn super_type(&self) -> Option<&dyn VirtualMethods>
Source§fn attribute_affects_presentational_hints(&self, attr: AttrRef<'_>) -> bool
fn attribute_affects_presentational_hints(&self, attr: AttrRef<'_>) -> bool
true if given attribute attr affects style of the
given element.Source§fn attribute_mutated(
&self,
cx: &mut JSContext,
attr: AttrRef<'_>,
mutation: AttributeMutation<'_>,
)
fn attribute_mutated( &self, cx: &mut JSContext, attr: AttrRef<'_>, mutation: AttributeMutation<'_>, )
Source§fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue
fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue
name
on this element.Source§fn bind_to_tree(&self, cx: &mut JSContext, context: &BindContext<'_>)
fn bind_to_tree(&self, cx: &mut JSContext, context: &BindContext<'_>)
Source§fn unbind_from_tree(&self, cx: &mut JSContext, context: &UnbindContext<'_>)
fn unbind_from_tree(&self, cx: &mut JSContext, context: &UnbindContext<'_>)
Source§fn moving_steps(&self, cx: &mut JSContext, context: &MoveContext<'_>)
fn moving_steps(&self, cx: &mut JSContext, context: &MoveContext<'_>)
Source§fn children_changed(&self, cx: &mut JSContext, mutation: &ChildrenMutation<'_>)
fn children_changed(&self, cx: &mut JSContext, mutation: &ChildrenMutation<'_>)
Source§fn adopting_steps(&self, cx: &mut JSContext, old_doc: &Document)
fn adopting_steps(&self, cx: &mut JSContext, old_doc: &Document)
Source§fn post_connection_steps(&self, cx: &mut JSContext)
fn post_connection_steps(&self, cx: &mut JSContext)
Source§fn handle_event(&self, cx: &mut JSContext, event: &Event)
fn handle_event(&self, cx: &mut JSContext, event: &Event)
Source§fn is_valid_command_steps(&self, command: CommandState) -> bool
fn is_valid_command_steps(&self, command: CommandState) -> bool
Source§fn command_steps(
&self,
cx: &mut JSContext,
button: DomRoot<HTMLButtonElement>,
command: CommandState,
) -> bool
fn command_steps( &self, cx: &mut JSContext, button: DomRoot<HTMLButtonElement>, command: CommandState, ) -> bool
Auto Trait Implementations§
impl !Freeze for Element
impl !RefUnwindSafe for Element
impl !Send for Element
impl !Sync for Element
impl !UnwindSafe for Element
impl Unpin for Element
impl UnsafeUnpin for Element
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<D, T> DomGlobalGeneric<D> for T
impl<D, T> DomGlobalGeneric<D> for T
Source§fn global_from_reflector(&self) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
fn global_from_reflector(&self) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
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<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
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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> ⓘ
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