Trait webkit2gtk_webextension::prelude::DOMElementExt
source · [−]pub trait DOMElementExt: 'static {
Show 119 methods
fn blur(&self);
fn closest(&self, selectors: &str) -> Result<DOMElement, Error>;
fn focus(&self);
fn attribute(&self, name: &str) -> Option<GString>;
fn attribute_node(&self, name: &str) -> Option<DOMAttr>;
fn attribute_node_ns(
&self,
namespaceURI: &str,
localName: &str
) -> Option<DOMAttr>;
fn attribute_ns(&self, namespaceURI: &str, localName: &str) -> Option<GString>;
fn attributes(&self) -> Option<DOMNamedNodeMap>;
fn bounding_client_rect(&self) -> Option<DOMClientRect>;
fn child_element_count(&self) -> c_ulong;
fn children(&self) -> Option<DOMHTMLCollection>;
fn class_list(&self) -> Option<DOMDOMTokenList>;
fn class_name(&self) -> Option<GString>;
fn client_height(&self) -> f64;
fn client_left(&self) -> f64;
fn client_rects(&self) -> Option<DOMClientRectList>;
fn client_top(&self) -> f64;
fn client_width(&self) -> f64;
fn elements_by_class_name(&self, class_name: &str) -> Option<DOMNodeList>;
fn elements_by_class_name_as_html_collection(
&self,
name: &str
) -> Option<DOMHTMLCollection>;
fn elements_by_tag_name(&self, tag_name: &str) -> Option<DOMNodeList>;
fn elements_by_tag_name_as_html_collection(
&self,
name: &str
) -> Option<DOMHTMLCollection>;
fn elements_by_tag_name_ns(
&self,
namespace_uri: &str,
tag_name: &str
) -> Option<DOMNodeList>;
fn elements_by_tag_name_ns_as_html_collection(
&self,
namespaceURI: &str,
localName: &str
) -> Option<DOMHTMLCollection>;
fn first_element_child(&self) -> Option<DOMElement>;
fn id(&self) -> Option<GString>;
fn inner_html(&self) -> Option<GString>;
fn last_element_child(&self) -> Option<DOMElement>;
fn local_name(&self) -> Option<GString>;
fn namespace_uri(&self) -> Option<GString>;
fn next_element_sibling(&self) -> Option<DOMElement>;
fn offset_height(&self) -> f64;
fn offset_left(&self) -> f64;
fn offset_parent(&self) -> Option<DOMElement>;
fn offset_top(&self) -> f64;
fn offset_width(&self) -> f64;
fn outer_html(&self) -> Option<GString>;
fn prefix(&self) -> Option<GString>;
fn previous_element_sibling(&self) -> Option<DOMElement>;
fn scroll_height(&self) -> c_long;
fn scroll_left(&self) -> c_long;
fn scroll_top(&self) -> c_long;
fn scroll_width(&self) -> c_long;
fn style(&self) -> Option<DOMCSSStyleDeclaration>;
fn tag_name(&self) -> Option<GString>;
fn webkit_region_overset(&self) -> Option<GString>;
fn has_attribute(&self, name: &str) -> bool;
fn has_attribute_ns(&self, namespaceURI: &str, localName: &str) -> bool;
fn has_attributes(&self) -> bool;
fn html_input_element_get_auto_filled(&self) -> bool;
fn html_input_element_is_user_edited(&self) -> bool;
fn html_input_element_set_auto_filled(&self, auto_filled: bool);
fn html_input_element_set_editing_value(&self, value: &str);
fn insert_adjacent_element(
&self,
where_: &str,
element: &impl IsA<DOMElement>
) -> Result<DOMElement, Error>;
fn insert_adjacent_html(&self, where_: &str, html: &str) -> Result<(), Error>;
fn insert_adjacent_text(&self, where_: &str, text: &str) -> Result<(), Error>;
fn matches(&self, selectors: &str) -> Result<(), Error>;
fn query_selector(
&self,
selectors: &str
) -> Result<Option<DOMElement>, Error>;
fn query_selector_all(&self, selectors: &str) -> Result<DOMNodeList, Error>;
fn remove(&self) -> Result<(), Error>;
fn remove_attribute(&self, name: &str);
fn remove_attribute_node(
&self,
oldAttr: &impl IsA<DOMAttr>
) -> Result<DOMAttr, Error>;
fn remove_attribute_ns(&self, namespaceURI: &str, localName: &str);
fn request_pointer_lock(&self);
fn scroll_by_lines(&self, lines: c_long);
fn scroll_by_pages(&self, pages: c_long);
fn scroll_into_view(&self, alignWithTop: bool);
fn scroll_into_view_if_needed(&self, centerIfNeeded: bool);
fn set_attribute(&self, name: &str, value: &str) -> Result<(), Error>;
fn set_attribute_node(
&self,
newAttr: &impl IsA<DOMAttr>
) -> Result<DOMAttr, Error>;
fn set_attribute_node_ns(
&self,
newAttr: &impl IsA<DOMAttr>
) -> Result<DOMAttr, Error>;
fn set_attribute_ns(
&self,
namespaceURI: Option<&str>,
qualifiedName: &str,
value: &str
) -> Result<(), Error>;
fn set_class_name(&self, value: &str);
fn set_id(&self, value: &str);
fn set_inner_html(&self, value: &str) -> Result<(), Error>;
fn set_outer_html(&self, value: &str) -> Result<(), Error>;
fn set_scroll_left(&self, value: c_long);
fn set_scroll_top(&self, value: c_long);
fn webkit_matches_selector(&self, selectors: &str) -> Result<(), Error>;
fn webkit_request_fullscreen(&self);
fn get_property_children(&self) -> Option<DOMHTMLCollection>;
fn get_property_inner_html(&self) -> Option<GString>;
fn set_property_inner_html(&self, inner_html: Option<&str>);
fn get_property_local_name(&self) -> Option<GString>;
fn get_property_namespace_uri(&self) -> Option<GString>;
fn get_property_outer_html(&self) -> Option<GString>;
fn set_property_outer_html(&self, outer_html: Option<&str>);
fn get_property_prefix(&self) -> Option<GString>;
fn connect_attributes_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_child_element_count_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_children_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_class_list_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_class_name_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_client_height_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_client_left_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_client_top_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_client_width_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_first_element_child_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_inner_html_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_last_element_child_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_local_name_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_namespace_uri_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_next_element_sibling_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_offset_height_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_offset_left_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_offset_parent_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_offset_top_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_offset_width_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_outer_html_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_prefix_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_previous_element_sibling_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_scroll_height_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_scroll_left_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_scroll_top_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_scroll_width_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_style_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_tag_name_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_webkit_region_overset_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
}
Expand description
Required Methods
sourcefn blur(&self)
fn blur(&self)
Deprecated since 2.22
Use JavaScriptCore API instead
sourcefn closest(&self, selectors: &str) -> Result<DOMElement, Error>
fn closest(&self, selectors: &str) -> Result<DOMElement, Error>
v2_16
only.sourcefn focus(&self)
fn focus(&self)
Deprecated since 2.22
Use JavaScriptCore API instead
sourcefn attribute_node(&self, name: &str) -> Option<DOMAttr>
fn attribute_node(&self, name: &str) -> Option<DOMAttr>
sourcefn attribute_node_ns(
&self,
namespaceURI: &str,
localName: &str
) -> Option<DOMAttr>
fn attribute_node_ns(
&self,
namespaceURI: &str,
localName: &str
) -> Option<DOMAttr>
Deprecated since 2.22
Use JavaScriptCore API instead
namespaceURI
A gchar
localName
A gchar
Returns
A DOMAttr
sourcefn attribute_ns(&self, namespaceURI: &str, localName: &str) -> Option<GString>
fn attribute_ns(&self, namespaceURI: &str, localName: &str) -> Option<GString>
Deprecated since 2.22
Use JavaScriptCore API instead
namespaceURI
A gchar
localName
A gchar
Returns
A gchar
sourcefn attributes(&self) -> Option<DOMNamedNodeMap>
fn attributes(&self) -> Option<DOMNamedNodeMap>
sourcefn bounding_client_rect(&self) -> Option<DOMClientRect>
fn bounding_client_rect(&self) -> Option<DOMClientRect>
v2_18
only.Returns a DOMClientRect
representing the size and position of self
relative to the viewport.
Deprecated since 2.22
Use JavaScriptCore API instead
Returns
sourcefn child_element_count(&self) -> c_ulong
fn child_element_count(&self) -> c_ulong
sourcefn children(&self) -> Option<DOMHTMLCollection>
fn children(&self) -> Option<DOMHTMLCollection>
v2_10
only.sourcefn class_list(&self) -> Option<DOMDOMTokenList>
fn class_list(&self) -> Option<DOMDOMTokenList>
v2_16
only.sourcefn class_name(&self) -> Option<GString>
fn class_name(&self) -> Option<GString>
sourcefn client_height(&self) -> f64
fn client_height(&self) -> f64
sourcefn client_left(&self) -> f64
fn client_left(&self) -> f64
sourcefn client_rects(&self) -> Option<DOMClientRectList>
fn client_rects(&self) -> Option<DOMClientRectList>
v2_18
only.Returns a collection of DOMClientRect
objects, each of which describe
the size and position of a CSS border box relative to the viewport.
Deprecated since 2.22
Use JavaScriptCore API instead
Returns
sourcefn client_top(&self) -> f64
fn client_top(&self) -> f64
sourcefn client_width(&self) -> f64
fn client_width(&self) -> f64
sourcefn elements_by_class_name(&self, class_name: &str) -> Option<DOMNodeList>
fn elements_by_class_name(&self, class_name: &str) -> Option<DOMNodeList>
Deprecated since 2.12
Use elements_by_class_name_as_html_collection()
instead.
class_name
a gchar
with the tag name
Returns
sourcefn elements_by_class_name_as_html_collection(
&self,
name: &str
) -> Option<DOMHTMLCollection>
fn elements_by_class_name_as_html_collection(
&self,
name: &str
) -> Option<DOMHTMLCollection>
v2_12
only.sourcefn elements_by_tag_name(&self, tag_name: &str) -> Option<DOMNodeList>
fn elements_by_tag_name(&self, tag_name: &str) -> Option<DOMNodeList>
Deprecated since 2.12
Use elements_by_tag_name_as_html_collection()
instead.
tag_name
a gchar
with the tag name
Returns
sourcefn elements_by_tag_name_as_html_collection(
&self,
name: &str
) -> Option<DOMHTMLCollection>
fn elements_by_tag_name_as_html_collection(
&self,
name: &str
) -> Option<DOMHTMLCollection>
v2_12
only.sourcefn elements_by_tag_name_ns(
&self,
namespace_uri: &str,
tag_name: &str
) -> Option<DOMNodeList>
fn elements_by_tag_name_ns(
&self,
namespace_uri: &str,
tag_name: &str
) -> Option<DOMNodeList>
Deprecated since 2.12
Use elements_by_tag_name_ns_as_html_collection()
instead.
namespace_uri
a gchar
with the namespace URI
tag_name
a gchar
with the tag name
Returns
sourcefn elements_by_tag_name_ns_as_html_collection(
&self,
namespaceURI: &str,
localName: &str
) -> Option<DOMHTMLCollection>
fn elements_by_tag_name_ns_as_html_collection(
&self,
namespaceURI: &str,
localName: &str
) -> Option<DOMHTMLCollection>
v2_12
only.sourcefn first_element_child(&self) -> Option<DOMElement>
fn first_element_child(&self) -> Option<DOMElement>
sourcefn inner_html(&self) -> Option<GString>
fn inner_html(&self) -> Option<GString>
v2_8
only.sourcefn last_element_child(&self) -> Option<DOMElement>
fn last_element_child(&self) -> Option<DOMElement>
sourcefn local_name(&self) -> Option<GString>
fn local_name(&self) -> Option<GString>
v2_14
only.sourcefn namespace_uri(&self) -> Option<GString>
fn namespace_uri(&self) -> Option<GString>
v2_14
only.sourcefn next_element_sibling(&self) -> Option<DOMElement>
fn next_element_sibling(&self) -> Option<DOMElement>
sourcefn offset_height(&self) -> f64
fn offset_height(&self) -> f64
sourcefn offset_left(&self) -> f64
fn offset_left(&self) -> f64
sourcefn offset_parent(&self) -> Option<DOMElement>
fn offset_parent(&self) -> Option<DOMElement>
sourcefn offset_top(&self) -> f64
fn offset_top(&self) -> f64
sourcefn offset_width(&self) -> f64
fn offset_width(&self) -> f64
sourcefn outer_html(&self) -> Option<GString>
fn outer_html(&self) -> Option<GString>
v2_8
only.sourcefn previous_element_sibling(&self) -> Option<DOMElement>
fn previous_element_sibling(&self) -> Option<DOMElement>
sourcefn scroll_height(&self) -> c_long
fn scroll_height(&self) -> c_long
sourcefn scroll_left(&self) -> c_long
fn scroll_left(&self) -> c_long
sourcefn scroll_top(&self) -> c_long
fn scroll_top(&self) -> c_long
sourcefn scroll_width(&self) -> c_long
fn scroll_width(&self) -> c_long
sourcefn style(&self) -> Option<DOMCSSStyleDeclaration>
fn style(&self) -> Option<DOMCSSStyleDeclaration>
sourcefn webkit_region_overset(&self) -> Option<GString>
fn webkit_region_overset(&self) -> Option<GString>
sourcefn has_attribute(&self, name: &str) -> bool
fn has_attribute(&self, name: &str) -> bool
sourcefn has_attribute_ns(&self, namespaceURI: &str, localName: &str) -> bool
fn has_attribute_ns(&self, namespaceURI: &str, localName: &str) -> bool
Deprecated since 2.22
Use JavaScriptCore API instead
namespaceURI
A gchar
localName
A gchar
Returns
A gboolean
sourcefn has_attributes(&self) -> bool
fn has_attributes(&self) -> bool
fn html_input_element_get_auto_filled(&self) -> bool
sourcefn html_input_element_is_user_edited(&self) -> bool
fn html_input_element_is_user_edited(&self) -> bool
v2_22
only.Get whether self
is an HTML text input element that has been edited by a user action.
Returns
whether self
has been edited by a user action.
sourcefn html_input_element_set_auto_filled(&self, auto_filled: bool)
fn html_input_element_set_auto_filled(&self, auto_filled: bool)
v2_22
only.Set whether the element is an HTML input element that has been filled automatically.
If self
is not an HTML input element this function does nothing.
auto_filled
value to set
sourcefn html_input_element_set_editing_value(&self, value: &str)
fn html_input_element_set_editing_value(&self, value: &str)
v2_22
only.Set the value of an HTML input element as if it had been edited by
the user, triggering a change event. If self
is not an HTML input
element this function does nothing.
value
the text to set
sourcefn insert_adjacent_element(
&self,
where_: &str,
element: &impl IsA<DOMElement>
) -> Result<DOMElement, Error>
fn insert_adjacent_element(
&self,
where_: &str,
element: &impl IsA<DOMElement>
) -> Result<DOMElement, Error>
v2_16
only.sourcefn insert_adjacent_html(&self, where_: &str, html: &str) -> Result<(), Error>
fn insert_adjacent_html(&self, where_: &str, html: &str) -> Result<(), Error>
v2_16
only.sourcefn insert_adjacent_text(&self, where_: &str, text: &str) -> Result<(), Error>
fn insert_adjacent_text(&self, where_: &str, text: &str) -> Result<(), Error>
v2_16
only.sourcefn query_selector(&self, selectors: &str) -> Result<Option<DOMElement>, Error>
fn query_selector(&self, selectors: &str) -> Result<Option<DOMElement>, Error>
sourcefn query_selector_all(&self, selectors: &str) -> Result<DOMNodeList, Error>
fn query_selector_all(&self, selectors: &str) -> Result<DOMNodeList, Error>
sourcefn remove(&self) -> Result<(), Error>
fn remove(&self) -> Result<(), Error>
v2_16
only.Deprecated since 2.22
Use JavaScriptCore API instead
sourcefn remove_attribute(&self, name: &str)
fn remove_attribute(&self, name: &str)
sourcefn remove_attribute_ns(&self, namespaceURI: &str, localName: &str)
fn remove_attribute_ns(&self, namespaceURI: &str, localName: &str)
sourcefn request_pointer_lock(&self)
fn request_pointer_lock(&self)
v2_16
only.Deprecated since 2.22
Use JavaScriptCore API instead
sourcefn scroll_by_lines(&self, lines: c_long)
fn scroll_by_lines(&self, lines: c_long)
sourcefn scroll_by_pages(&self, pages: c_long)
fn scroll_by_pages(&self, pages: c_long)
sourcefn scroll_into_view(&self, alignWithTop: bool)
fn scroll_into_view(&self, alignWithTop: bool)
sourcefn scroll_into_view_if_needed(&self, centerIfNeeded: bool)
fn scroll_into_view_if_needed(&self, centerIfNeeded: bool)
sourcefn set_attribute_ns(
&self,
namespaceURI: Option<&str>,
qualifiedName: &str,
value: &str
) -> Result<(), Error>
fn set_attribute_ns(
&self,
namespaceURI: Option<&str>,
qualifiedName: &str,
value: &str
) -> Result<(), Error>
Deprecated since 2.22
Use JavaScriptCore API instead
namespaceURI
A gchar
qualifiedName
A gchar
value
A gchar
sourcefn set_class_name(&self, value: &str)
fn set_class_name(&self, value: &str)
sourcefn set_inner_html(&self, value: &str) -> Result<(), Error>
fn set_inner_html(&self, value: &str) -> Result<(), Error>
v2_8
only.sourcefn set_outer_html(&self, value: &str) -> Result<(), Error>
fn set_outer_html(&self, value: &str) -> Result<(), Error>
v2_8
only.sourcefn set_scroll_left(&self, value: c_long)
fn set_scroll_left(&self, value: c_long)
sourcefn set_scroll_top(&self, value: c_long)
fn set_scroll_top(&self, value: c_long)
sourcefn webkit_matches_selector(&self, selectors: &str) -> Result<(), Error>
fn webkit_matches_selector(&self, selectors: &str) -> Result<(), Error>
v2_16
only.sourcefn webkit_request_fullscreen(&self)
fn webkit_request_fullscreen(&self)
v2_16
only.Deprecated since 2.22
Use JavaScriptCore API instead
fn get_property_children(&self) -> Option<DOMHTMLCollection>
fn get_property_inner_html(&self) -> Option<GString>
fn set_property_inner_html(&self, inner_html: Option<&str>)
fn get_property_local_name(&self) -> Option<GString>
fn get_property_namespace_uri(&self) -> Option<GString>
fn get_property_outer_html(&self) -> Option<GString>
fn set_property_outer_html(&self, outer_html: Option<&str>)
fn get_property_prefix(&self) -> Option<GString>
fn connect_attributes_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_child_element_count_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_children_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
sourcefn connect_class_list_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_class_list_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
v2_16
only.