Struct script::dom::element::Element[][src]

#[repr(C)]pub struct Element {
    node: Node,
    local_name: LocalName,
    tag_name: TagName,
    namespace: Namespace,
    prefix: DomRefCell<Option<Prefix>>,
    attrs: DomRefCell<Vec<Dom<Attr>>>,
    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: Cell<ElementSelectorFlags>,
    rare_data: DomRefCell<Option<Box<ElementRareData>>>,
}

Fields

node: Nodelocal_name: LocalNametag_name: TagNamenamespace: Namespaceprefix: DomRefCell<Option<Prefix>>attrs: DomRefCell<Vec<Dom<Attr>>>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: Cell<ElementSelectorFlags>

These flags are set by the style system to indicate the that certain operations may require restyling this element or its descendants. The flags are not atomic, so the style system takes care of only set them when it has exclusive access to the element.

rare_data: DomRefCell<Option<Box<ElementRareData>>>

Implementations

impl Element[src]

fn __assert_parent_type(&self)[src]

impl Element[src]

fn click_event_filter_by_disabled_state(&self) -> bool[src]

impl Element[src]

pub fn create(
    name: QualName,
    is: Option<LocalName>,
    document: &Document,
    creator: ElementCreator,
    mode: CustomElementCreationMode
) -> Root<Dom<Element>>
[src]

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

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

pub fn new(
    local_name: LocalName,
    namespace: Namespace,
    prefix: Option<Prefix>,
    document: &Document
) -> Root<Dom<Element>>
[src]

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

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

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

pub fn restyle(&self, damage: NodeDamage)[src]

pub fn set_is(&self, is: LocalName)[src]

pub fn get_is(&self) -> Option<LocalName>[src]

pub fn set_custom_element_state(&self, state: CustomElementState)[src]

pub fn get_custom_element_state(&self) -> CustomElementState[src]

pub fn set_custom_element_definition(
    &self,
    definition: Rc<CustomElementDefinition>
)
[src]

pub fn get_custom_element_definition(
    &self
) -> Option<Rc<CustomElementDefinition>>
[src]

pub fn clear_custom_element_definition(&self)[src]

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

pub fn push_upgrade_reaction(&self, definition: Rc<CustomElementDefinition>)[src]

pub fn clear_reaction_queue(&self)[src]

pub fn invoke_reactions(&self)[src]

pub fn style(&self) -> Option<Arc<ComputedValues>>[src]

style will be None for elements in a display: none subtree. otherwise, the element has a layout box iff it doesn’t have display: none.

pub fn has_css_layout_box(&self) -> bool[src]

fn potentially_scrollable(&self) -> bool[src]

fn has_scrolling_box(&self) -> bool[src]

fn has_overflow(&self) -> bool[src]

fn has_any_visible_overflow(&self) -> bool[src]

Computed value of overflow-x or overflow-y is “visible”

fn has_any_hidden_overflow(&self) -> bool[src]

Computed value of overflow-x or overflow-y is “hidden”

fn shadow_root(&self) -> Option<Root<Dom<ShadowRoot>>>[src]

pub fn is_shadow_host(&self) -> bool[src]

pub fn attach_shadow(
    &self,
    is_ua_widget: IsUserAgentWidget
) -> Result<Root<Dom<ShadowRoot>>, Error>
[src]

https://dom.spec.whatwg.org/#dom-element-attachshadow XXX This is not exposed to web content yet. It is meant to be used for UA widgets only.

pub fn detach_shadow(&self)[src]

pub fn is_translate_enabled(&self) -> bool[src]

pub fn directionality(&self) -> String[src]

impl Element[src]

pub fn is_html_element(&self) -> bool[src]

pub fn html_element_in_html_document(&self) -> bool[src]

pub fn local_name(&self) -> &LocalName[src]

pub fn parsed_name(&self, name: DOMString) -> LocalName[src]

pub fn namespace(&self) -> &Namespace[src]

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

pub fn set_prefix(&self, prefix: Option<Prefix>)[src]

pub fn attrs(&self) -> Ref<'_, [Dom<Attr>]>[src]

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

pub fn name_attribute(&self) -> Option<Atom>[src]

pub fn style_attribute(
    &self
) -> &DomRefCell<Option<Arc<Locked<PropertyDeclarationBlock>>>>
[src]

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

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
[src]

pub fn is_void(&self) -> bool[src]

pub fn serialize(
    &self,
    traversal_scope: TraversalScope
) -> Result<DOMString, Error>
[src]

pub fn xmlSerialize(
    &self,
    traversal_scope: XmlTraversalScope
) -> Result<DOMString, Error>
[src]

pub fn root_element(&self) -> Root<Dom<Element>>[src]

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

pub fn input_method_type(&self) -> Option<InputMethodType>[src]

pub fn is_focusable_area(&self) -> bool[src]

pub fn is_actually_disabled(&self) -> bool[src]

pub fn push_new_attribute(
    &self,
    local_name: LocalName,
    value: AttrValue,
    name: LocalName,
    namespace: Namespace,
    prefix: Option<Prefix>
)
[src]

pub fn push_attribute(&self, attr: &Attr)[src]

pub fn get_attribute(
    &self,
    namespace: &Namespace,
    local_name: &LocalName
) -> Option<Root<Dom<Attr>>>
[src]

pub fn get_attribute_by_name(&self, name: DOMString) -> Option<Root<Dom<Attr>>>[src]

pub fn set_attribute_from_parser(
    &self,
    qname: QualName,
    value: DOMString,
    prefix: Option<Prefix>
)
[src]

pub fn set_attribute(&self, name: &LocalName, value: AttrValue)[src]

pub fn set_custom_attribute(
    &self,
    name: DOMString,
    value: DOMString
) -> Result<(), Error>
[src]

fn set_first_matching_attribute<F>(
    &self,
    local_name: LocalName,
    value: AttrValue,
    name: LocalName,
    namespace: Namespace,
    prefix: Option<Prefix>,
    find: F
) where
    F: Fn(&Attr) -> bool
[src]

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

pub fn remove_attribute(
    &self,
    namespace: &Namespace,
    local_name: &LocalName
) -> Option<Root<Dom<Attr>>>
[src]

pub fn remove_attribute_by_name(
    &self,
    name: &LocalName
) -> Option<Root<Dom<Attr>>>
[src]

fn remove_first_matching_attribute<F>(&self, find: F) -> Option<Root<Dom<Attr>>> where
    F: Fn(&Attr) -> bool
[src]

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

pub fn set_atomic_attribute(&self, local_name: &LocalName, value: DOMString)[src]

pub fn has_attribute(&self, local_name: &LocalName) -> bool[src]

pub fn set_bool_attribute(&self, local_name: &LocalName, value: bool)[src]

pub fn get_url_attribute(&self, local_name: &LocalName) -> USVString[src]

pub fn set_url_attribute(&self, local_name: &LocalName, value: USVString)[src]

pub fn get_string_attribute(&self, local_name: &LocalName) -> DOMString[src]

pub fn set_string_attribute(&self, local_name: &LocalName, value: DOMString)[src]

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

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
[src]

pub fn set_tokenlist_attribute(&self, local_name: &LocalName, value: DOMString)[src]

pub fn set_atomic_tokenlist_attribute(
    &self,
    local_name: &LocalName,
    tokens: Vec<Atom>
)
[src]

pub fn get_int_attribute(&self, local_name: &LocalName, default: i32) -> i32[src]

pub fn set_int_attribute(&self, local_name: &LocalName, value: i32)[src]

pub fn get_uint_attribute(&self, local_name: &LocalName, default: u32) -> u32[src]

pub fn set_uint_attribute(&self, local_name: &LocalName, value: u32)[src]

pub fn will_mutate_attr(&self, attr: &Attr)[src]

pub fn insert_adjacent(
    &self,
    where_: AdjacentPosition,
    node: &Node
) -> Result<Option<Root<Dom<Node>>>, Error>
[src]

pub fn scroll(&self, x_: f64, y_: f64, behavior: ScrollBehavior)[src]

pub fn parse_fragment(
    &self,
    markup: DOMString
) -> Result<Root<Dom<DocumentFragment>>, Error>
[src]

pub fn fragment_parsing_context(
    owner_doc: &Document,
    element: Option<&Self>
) -> Root<Dom<Self>>
[src]

pub fn fullscreen_element_ready_check(&self) -> bool[src]

pub fn is_in_same_home_subtree<T>(&self, other: &T) -> bool where
    T: DerivedFrom<Element> + DomObject
[src]

pub fn get_id(&self) -> Option<Atom>[src]

pub fn get_name(&self) -> Option<Atom>[src]

fn is_sequentially_focusable(&self) -> bool[src]

pub(crate) fn update_sequentially_focusable_status(&self)[src]

impl Element[src]

fn client_rect(&self) -> Rect<i32>[src]

pub fn as_maybe_activatable(&self) -> Option<&dyn Activatable>[src]

pub fn as_stylesheet_owner(&self) -> Option<&dyn StylesheetOwner>[src]

pub fn as_maybe_validatable(&self) -> Option<&dyn Validatable>[src]

pub fn click_in_progress(&self) -> bool[src]

pub fn set_click_in_progress(&self, click: bool)[src]

pub fn nearest_activable_element(&self) -> Option<Root<Dom<Element>>>[src]

pub fn get_lang(&self) -> String[src]

pub fn state(&self) -> ElementState[src]

pub fn set_state(&self, which: ElementState, value: bool)[src]

pub fn set_active_state(&self, value: bool)[src]

pub fn focus_state(&self) -> bool[src]

pub fn set_focus_state(&self, value: bool)[src]

pub fn hover_state(&self) -> bool[src]

pub fn set_hover_state(&self, value: bool)[src]

pub fn enabled_state(&self) -> bool[src]

pub fn set_enabled_state(&self, value: bool)[src]

pub fn disabled_state(&self) -> bool[src]

pub fn set_disabled_state(&self, value: bool)[src]

pub fn read_write_state(&self) -> bool[src]

pub fn set_read_write_state(&self, value: bool)[src]

pub fn placeholder_shown_state(&self) -> bool[src]

pub fn set_placeholder_shown_state(&self, value: bool)[src]

pub fn set_target_state(&self, value: bool)[src]

pub fn set_fullscreen_state(&self, value: bool)[src]

pub fn is_connected(&self) -> bool[src]

pub fn cannot_navigate(&self) -> bool[src]

impl Element[src]

pub fn check_ancestors_disabled_state_for_form_control(&self)[src]

pub fn check_parent_disabled_state_for_option(&self)[src]

pub fn check_disabled_attribute(&self)[src]

Trait Implementations

impl Castable for Element[src]

impl Debug for Element[src]

impl DerivedFrom<Element> for Element[src]

impl DerivedFrom<Element> for HTMLAnchorElement[src]

impl DerivedFrom<Element> for HTMLDataElement[src]

impl DerivedFrom<Element> for HTMLDataListElement[src]

impl DerivedFrom<Element> for HTMLDetailsElement[src]

impl DerivedFrom<Element> for HTMLDialogElement[src]

impl DerivedFrom<Element> for HTMLDirectoryElement[src]

impl DerivedFrom<Element> for HTMLDivElement[src]

impl DerivedFrom<Element> for HTMLElement[src]

impl DerivedFrom<Element> for HTMLEmbedElement[src]

impl DerivedFrom<Element> for HTMLFieldSetElement[src]

impl DerivedFrom<Element> for HTMLFontElement[src]

impl DerivedFrom<Element> for HTMLAreaElement[src]

impl DerivedFrom<Element> for HTMLFormElement[src]

impl DerivedFrom<Element> for HTMLFrameElement[src]

impl DerivedFrom<Element> for HTMLFrameSetElement[src]

impl DerivedFrom<Element> for HTMLHRElement[src]

impl DerivedFrom<Element> for HTMLHeadElement[src]

impl DerivedFrom<Element> for HTMLHeadingElement[src]

impl DerivedFrom<Element> for HTMLHtmlElement[src]

impl DerivedFrom<Element> for HTMLIFrameElement[src]

impl DerivedFrom<Element> for HTMLImageElement[src]

impl DerivedFrom<Element> for HTMLInputElement[src]

impl DerivedFrom<Element> for HTMLAudioElement[src]

impl DerivedFrom<Element> for HTMLLIElement[src]

impl DerivedFrom<Element> for HTMLLabelElement[src]

impl DerivedFrom<Element> for HTMLLegendElement[src]

impl DerivedFrom<Element> for HTMLLinkElement[src]

impl DerivedFrom<Element> for HTMLMapElement[src]

impl DerivedFrom<Element> for HTMLMediaElement[src]

impl DerivedFrom<Element> for HTMLMenuElement[src]

impl DerivedFrom<Element> for HTMLMetaElement[src]

impl DerivedFrom<Element> for HTMLMeterElement[src]

impl DerivedFrom<Element> for HTMLModElement[src]

impl DerivedFrom<Element> for HTMLBRElement[src]

impl DerivedFrom<Element> for HTMLOListElement[src]

impl DerivedFrom<Element> for HTMLObjectElement[src]

impl DerivedFrom<Element> for HTMLOptGroupElement[src]

impl DerivedFrom<Element> for HTMLOptionElement[src]

impl DerivedFrom<Element> for HTMLOutputElement[src]

impl DerivedFrom<Element> for HTMLParagraphElement[src]

impl DerivedFrom<Element> for HTMLParamElement[src]

impl DerivedFrom<Element> for HTMLPictureElement[src]

impl DerivedFrom<Element> for HTMLPreElement[src]

impl DerivedFrom<Element> for HTMLProgressElement[src]

impl DerivedFrom<Element> for HTMLBaseElement[src]

impl DerivedFrom<Element> for HTMLQuoteElement[src]

impl DerivedFrom<Element> for HTMLScriptElement[src]

impl DerivedFrom<Element> for HTMLSelectElement[src]

impl DerivedFrom<Element> for HTMLSourceElement[src]

impl DerivedFrom<Element> for HTMLSpanElement[src]

impl DerivedFrom<Element> for HTMLStyleElement[src]

impl DerivedFrom<Element> for HTMLTableCaptionElement[src]

impl DerivedFrom<Element> for HTMLTableCellElement[src]

impl DerivedFrom<Element> for HTMLTableColElement[src]

impl DerivedFrom<Element> for HTMLTableElement[src]

impl DerivedFrom<Element> for HTMLBodyElement[src]

impl DerivedFrom<Element> for HTMLTableRowElement[src]

impl DerivedFrom<Element> for HTMLTableSectionElement[src]

impl DerivedFrom<Element> for HTMLTemplateElement[src]

impl DerivedFrom<Element> for HTMLTextAreaElement[src]

impl DerivedFrom<Element> for HTMLTimeElement[src]

impl DerivedFrom<Element> for HTMLTitleElement[src]

impl DerivedFrom<Element> for HTMLTrackElement[src]

impl DerivedFrom<Element> for HTMLUListElement[src]

impl DerivedFrom<Element> for HTMLUnknownElement[src]

impl DerivedFrom<Element> for HTMLVideoElement[src]

impl DerivedFrom<Element> for HTMLButtonElement[src]

impl DerivedFrom<Element> for SVGElement[src]

impl DerivedFrom<Element> for SVGGraphicsElement[src]

impl DerivedFrom<Element> for SVGSVGElement[src]

impl DerivedFrom<Element> for HTMLCanvasElement[src]

impl DerivedFrom<Element> for HTMLDListElement[src]

impl DerivedFrom<EventTarget> for Element[src]

impl DerivedFrom<Node> for Element[src]

impl DomObject for Element[src]

impl DomObjectWrap for Element[src]

impl ElementMethods for Element[src]

fn GetInnerHTML(&self) -> Result<DOMString, Error>[src]

fn SetInnerHTML(&self, value: DOMString) -> Result<(), Error>[src]

impl FormControlElementHelpers for Element[src]

impl HasParent for Element[src]

type Parent = Node

fn as_parent(&self) -> &Node[src]

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

impl IDLInterface for Element[src]

impl JSTraceable for Element[src]

impl MallocSizeOf for Element[src]

impl MutDomObject for Element[src]

impl PartialEq<Element> for Element[src]

impl ToJSValConvertible for Element[src]

impl VirtualMethods for Element[src]

Auto Trait Implementations

impl !RefUnwindSafe for Element

impl !Send for Element

impl !Sync for Element

impl Unpin for Element

impl !UnwindSafe for Element

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> MaybeBoxed<Box<T, Global>> for T[src]

impl<T> MaybeBoxed<T> for T[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]