Struct script::dom::document::Document

source ·
#[repr(C)]
pub struct Document {
Show 95 fields node: Node, document_or_shadow_root: DocumentOrShadowRoot, window: Dom<Window>, implementation: MutNullableDom<DOMImplementation>, content_type: Mime, last_modified: Option<String>, encoding: Cell<&'static Encoding>, has_browsing_context: bool, is_html_document: bool, activity: Cell<DocumentActivity>, url: DomRefCell<ServoUrl>, quirks_mode: Cell<QuirksMode>, id_map: DomRefCell<HashMapTracedValues<Atom, Vec<Dom<Element>>>>, name_map: DomRefCell<HashMapTracedValues<Atom, Vec<Dom<Element>>>>, tag_map: DomRefCell<HashMapTracedValues<LocalName, Dom<HTMLCollection>>>, tagns_map: DomRefCell<HashMapTracedValues<QualName, Dom<HTMLCollection>>>, classes_map: DomRefCell<HashMapTracedValues<Vec<Atom>, Dom<HTMLCollection>>>, images: MutNullableDom<HTMLCollection>, embeds: MutNullableDom<HTMLCollection>, links: MutNullableDom<HTMLCollection>, forms: MutNullableDom<HTMLCollection>, scripts: MutNullableDom<HTMLCollection>, anchors: MutNullableDom<HTMLCollection>, applets: MutNullableDom<HTMLCollection>, style_shared_lock: SharedRwLock, stylesheets: DomRefCell<DocumentStylesheetSet<StyleSheetInDocument>>, stylesheet_list: MutNullableDom<StyleSheetList>, ready_state: Cell<DocumentReadyState>, domcontentloaded_dispatched: Cell<bool>, focus_transaction: DomRefCell<FocusTransaction>, focused: MutNullableDom<Element>, current_script: MutNullableDom<HTMLScriptElement>, pending_parsing_blocking_script: DomRefCell<Option<PendingScript>>, script_blocking_stylesheets_count: Cell<u32>, deferred_scripts: PendingInOrderScriptVec, asap_in_order_scripts_list: PendingInOrderScriptVec, asap_scripts_set: DomRefCell<Vec<Dom<HTMLScriptElement>>>, scripting_enabled: bool, animation_frame_ident: Cell<u32>, animation_frame_list: DomRefCell<Vec<(u32, Option<AnimationFrameCallback>)>>, running_animation_callbacks: Cell<bool>, loader: DomRefCell<DocumentLoader>, current_parser: MutNullableDom<ServoParser>, reflow_timeout: Cell<Option<u64>>, base_element: MutNullableDom<HTMLBaseElement>, appropriate_template_contents_owner_document: MutNullableDom<Document>, pending_restyles: DomRefCell<HashMap<Dom<Element>, NoTrace<PendingRestyle>>>, needs_paint: Cell<bool>, active_touch_points: DomRefCell<Vec<Dom<Touch>>>, dom_loading: Cell<u64>, dom_interactive: Cell<u64>, dom_content_loaded_event_start: Cell<u64>, dom_content_loaded_event_end: Cell<u64>, dom_complete: Cell<u64>, top_level_dom_complete: Cell<u64>, load_event_start: Cell<u64>, load_event_end: Cell<u64>, unload_event_start: Cell<u64>, unload_event_end: Cell<u64>, https_state: Cell<HttpsState>, origin: MutableOrigin, referrer_policy: Cell<Option<ReferrerPolicy>>, referrer: Option<String>, target_element: MutNullableDom<Element>, last_click_info: DomRefCell<Option<(Instant, Point2D<f32>)>>, ignore_destructive_writes_counter: Cell<u32>, ignore_opens_during_unload_counter: Cell<u32>, spurious_animation_frames: Cell<u8>, dom_count: Cell<u32>, fullscreen_element: MutNullableDom<Element>, form_id_listener_map: DomRefCell<HashMapTracedValues<Atom, HashSet<Dom<Element>>>>, interactive_time: DomRefCell<InteractiveMetrics>, tti_window: DomRefCell<InteractiveWindow>, canceller: FetchCanceller, throw_on_dynamic_markup_insertion_counter: Cell<u64>, page_showing: Cell<bool>, salvageable: Cell<bool>, active_parser_was_aborted: Cell<bool>, fired_unload: Cell<bool>, responsive_images: DomRefCell<Vec<Dom<HTMLImageElement>>>, redirect_count: Cell<u16>, script_and_layout_blockers: Cell<u32>, delayed_tasks: DomRefCell<Vec<Box<dyn TaskBox>>>, completely_loaded: Cell<bool>, shadow_roots: DomRefCell<HashSet<Dom<ShadowRoot>>>, shadow_roots_styles_changed: Cell<bool>, media_controls: DomRefCell<HashMap<String, Dom<ShadowRoot>>>, dirty_webgl_contexts: DomRefCell<HashMapTracedValues<WebGLContextId, Dom<WebGLRenderingContext>>>, dirty_webgpu_contexts: DomRefCell<HashMap<WebGPUContextId, Dom<GPUCanvasContext>>>, csp_list: DomRefCell<Option<CspList>>, selection: MutNullableDom<Selection>, animation_timeline: DomRefCell<AnimationTimeline>, animations: DomRefCell<Animations>, dirty_root: MutNullableDom<Element>, declarative_refresh: DomRefCell<Option<DeclarativeRefresh>>,
}
Expand description

Fields§

§node: Node§document_or_shadow_root: DocumentOrShadowRoot§window: Dom<Window>§implementation: MutNullableDom<DOMImplementation>§content_type: Mime§last_modified: Option<String>§encoding: Cell<&'static Encoding>§has_browsing_context: bool§is_html_document: bool§activity: Cell<DocumentActivity>§url: DomRefCell<ServoUrl>§quirks_mode: Cell<QuirksMode>§id_map: DomRefCell<HashMapTracedValues<Atom, Vec<Dom<Element>>>>

Caches for the getElement methods

§name_map: DomRefCell<HashMapTracedValues<Atom, Vec<Dom<Element>>>>§tag_map: DomRefCell<HashMapTracedValues<LocalName, Dom<HTMLCollection>>>§tagns_map: DomRefCell<HashMapTracedValues<QualName, Dom<HTMLCollection>>>§classes_map: DomRefCell<HashMapTracedValues<Vec<Atom>, Dom<HTMLCollection>>>§images: MutNullableDom<HTMLCollection>§embeds: MutNullableDom<HTMLCollection>§links: MutNullableDom<HTMLCollection>§forms: MutNullableDom<HTMLCollection>§scripts: MutNullableDom<HTMLCollection>§anchors: MutNullableDom<HTMLCollection>§applets: MutNullableDom<HTMLCollection>§style_shared_lock: SharedRwLock

Lock use for style attributes and author-origin stylesheet objects in this document. Can be acquired once for accessing many objects.

§stylesheets: DomRefCell<DocumentStylesheetSet<StyleSheetInDocument>>

List of stylesheets associated with nodes in this document. |None| if the list needs to be refreshed.

§stylesheet_list: MutNullableDom<StyleSheetList>§ready_state: Cell<DocumentReadyState>§domcontentloaded_dispatched: Cell<bool>

Whether the DOMContentLoaded event has already been dispatched.

§focus_transaction: DomRefCell<FocusTransaction>

The state of this document’s focus transaction.

§focused: MutNullableDom<Element>

The element that currently has the document focus context.

§current_script: MutNullableDom<HTMLScriptElement>

The script element that is currently executing.

§pending_parsing_blocking_script: DomRefCell<Option<PendingScript>>§script_blocking_stylesheets_count: Cell<u32>

Number of stylesheets that block executing the next parser-inserted script

§deferred_scripts: PendingInOrderScriptVec§asap_in_order_scripts_list: PendingInOrderScriptVec§asap_scripts_set: DomRefCell<Vec<Dom<HTMLScriptElement>>>§scripting_enabled: bool

https://html.spec.whatwg.org/multipage/#concept-n-noscript True if scripting is enabled for all scripts in this document

§animation_frame_ident: Cell<u32>§animation_frame_list: DomRefCell<Vec<(u32, Option<AnimationFrameCallback>)>>§running_animation_callbacks: Cell<bool>

Whether we’re in the process of running animation callbacks.

Tracking this is not necessary for correctness. Instead, it is an optimization to avoid sending needless ChangeRunningAnimationsState messages to the compositor.

§loader: DomRefCell<DocumentLoader>

Tracks all outstanding loads related to this document.

§current_parser: MutNullableDom<ServoParser>

The current active HTML parser, to allow resuming after interruptions.

§reflow_timeout: Cell<Option<u64>>

When we should kick off a reflow. This happens during parsing.

§base_element: MutNullableDom<HTMLBaseElement>

The cached first base element with an href attribute.

§appropriate_template_contents_owner_document: MutNullableDom<Document>

This field is set to the document itself for inert documents. https://html.spec.whatwg.org/multipage/#appropriate-template-contents-owner-document

§pending_restyles: DomRefCell<HashMap<Dom<Element>, NoTrace<PendingRestyle>>>

Information on elements needing restyle to ship over to layout when the time comes.

§needs_paint: Cell<bool>

This flag will be true if layout suppressed a reflow attempt that was needed in order for the page to be painted.

§active_touch_points: DomRefCell<Vec<Dom<Touch>>>§dom_loading: Cell<u64>§dom_interactive: Cell<u64>§dom_content_loaded_event_start: Cell<u64>§dom_content_loaded_event_end: Cell<u64>§dom_complete: Cell<u64>§top_level_dom_complete: Cell<u64>§load_event_start: Cell<u64>§load_event_end: Cell<u64>§unload_event_start: Cell<u64>§unload_event_end: Cell<u64>§https_state: Cell<HttpsState>§origin: MutableOrigin

The document’s origin.

§referrer_policy: Cell<Option<ReferrerPolicy>>§referrer: Option<String>§target_element: MutNullableDom<Element>§last_click_info: DomRefCell<Option<(Instant, Point2D<f32>)>>§ignore_destructive_writes_counter: Cell<u32>§ignore_opens_during_unload_counter: Cell<u32>§spurious_animation_frames: Cell<u8>

The number of spurious requestAnimationFrame() requests we’ve received.

A rAF request is considered spurious if nothing was actually reflowed.

§dom_count: Cell<u32>

Track the total number of elements in this DOM’s tree. This is sent to layout every time a reflow is done; layout uses this to determine if the gains from parallel layout will be worth the overhead.

See also: https://github.com/servo/servo/issues/10110

§fullscreen_element: MutNullableDom<Element>

Entry node for fullscreen.

§form_id_listener_map: DomRefCell<HashMapTracedValues<Atom, HashSet<Dom<Element>>>>

Map from ID to set of form control elements that have that ID as their ‘form’ content attribute. Used to reset form controls whenever any element with the same ID as the form attribute is inserted or removed from the document. See https://html.spec.whatwg.org/multipage/#form-owner

§interactive_time: DomRefCell<InteractiveMetrics>§tti_window: DomRefCell<InteractiveWindow>§canceller: FetchCanceller

RAII canceller for Fetch

§throw_on_dynamic_markup_insertion_counter: Cell<u64>§page_showing: Cell<bool>§salvageable: Cell<bool>

Whether the document is salvageable.

§active_parser_was_aborted: Cell<bool>

Whether the document was aborted with an active parser

§fired_unload: Cell<bool>

Whether the unload event has already been fired.

§responsive_images: DomRefCell<Vec<Dom<HTMLImageElement>>>

List of responsive images

§redirect_count: Cell<u16>

Number of redirects for the document load

§script_and_layout_blockers: Cell<u32>

Number of outstanding requests to prevent JS or layout from running.

§delayed_tasks: DomRefCell<Vec<Box<dyn TaskBox>>>

List of tasks to execute as soon as last script/layout blocker is removed.

§completely_loaded: Cell<bool>§shadow_roots: DomRefCell<HashSet<Dom<ShadowRoot>>>

Set of shadow roots connected to the document tree.

§shadow_roots_styles_changed: Cell<bool>

Whether any of the shadow roots need the stylesheets flushed.

§media_controls: DomRefCell<HashMap<String, Dom<ShadowRoot>>>

List of registered media controls. We need to keep this list to allow the media controls to access the “privileged” document.servoGetMediaControls(id) API, where id needs to match any of the registered ShadowRoots hosting the media controls UI.

§dirty_webgl_contexts: DomRefCell<HashMapTracedValues<WebGLContextId, Dom<WebGLRenderingContext>>>

List of all WebGL context IDs that need flushing.

§dirty_webgpu_contexts: DomRefCell<HashMap<WebGPUContextId, Dom<GPUCanvasContext>>>

List of all WebGPU context IDs that need flushing.

§csp_list: DomRefCell<Option<CspList>>§selection: MutNullableDom<Selection>§animation_timeline: DomRefCell<AnimationTimeline>

A timeline for animations which is used for synchronizing animations. https://drafts.csswg.org/web-animations/#timeline

§animations: DomRefCell<Animations>

Animations for this Document

§dirty_root: MutNullableDom<Element>

The nearest inclusive ancestors to all the nodes that require a restyle.

§declarative_refresh: DomRefCell<Option<DeclarativeRefresh>>

Implementations§

source§

impl Document

source

pub fn note_node_with_dirty_descendants(&self, node: &Node)

source

pub fn take_dirty_root(&self) -> Option<Root<Dom<Element>>>

source

pub fn loader(&self) -> Ref<'_, DocumentLoader>

source

pub fn loader_mut(&self) -> RefMut<'_, DocumentLoader>

source

pub fn has_browsing_context(&self) -> bool

source

pub fn browsing_context(&self) -> Option<Root<Dom<WindowProxy>>>

source

pub fn window(&self) -> &Window

source

pub fn is_html_document(&self) -> bool

source

pub fn set_https_state(&self, https_state: HttpsState)

source

pub fn is_fully_active(&self) -> bool

source

pub fn is_active(&self) -> bool

source

pub fn set_activity(&self, activity: DocumentActivity)

source

pub fn origin(&self) -> &MutableOrigin

source

pub fn url(&self) -> ServoUrl

source

pub fn set_url(&self, url: ServoUrl)

source

pub fn fallback_base_url(&self) -> ServoUrl

source

pub fn base_url(&self) -> ServoUrl

source

pub fn needs_paint(&self) -> bool

source

pub fn needs_reflow(&self) -> Option<ReflowTriggerCondition>

source

pub fn base_element(&self) -> Option<Root<Dom<HTMLBaseElement>>>

Returns the first base element in the DOM that has an href attribute.

source

pub fn refresh_base_element(&self)

Refresh the cached first base element in the DOM. https://github.com/w3c/web-platform-tests/issues/2122

source

pub fn dom_count(&self) -> u32

source

pub fn increment_dom_count(&self)

This is called by bind_to_tree when a node is added to the DOM. The internal count is used by layout to determine whether to be sequential or parallel. (it’s sequential for small DOMs)

source

pub fn decrement_dom_count(&self)

This is called by unbind_from_tree when a node is removed from the DOM.

source

pub fn quirks_mode(&self) -> QuirksMode

source

pub fn set_quirks_mode(&self, new_mode: QuirksMode)

source

pub fn encoding(&self) -> &'static Encoding

source

pub fn set_encoding(&self, encoding: &'static Encoding)

source

pub fn content_and_heritage_changed(&self, node: &Node)

source

pub fn reflow_if_reflow_timer_expired(&self)

Reflows and disarms the timer if the reflow timer has expired.

source

pub fn set_reflow_timeout(&self, timeout: u64)

Schedules a reflow to be kicked off at the given timeout (in time::precise_time_ns() units). This reflow happens even if the event loop is busy. This is used to display initial page content during parsing.

source

pub fn unregister_element_id(&self, to_unregister: &Element, id: Atom)

Remove any existing association between the provided id and any elements in this document.

source

pub fn register_element_id(&self, element: &Element, id: Atom)

Associate an element present in this document with the provided id.

source

pub fn unregister_element_name(&self, to_unregister: &Element, name: Atom)

Remove any existing association between the provided name and any elements in this document.

source

pub fn register_element_name(&self, element: &Element, name: Atom)

Associate an element present in this document with the provided name.

source

pub fn register_form_id_listener<T: ?Sized + FormControl>( &self, id: DOMString, listener: &T )

source

pub fn unregister_form_id_listener<T: ?Sized + FormControl>( &self, id: DOMString, listener: &T )

source

pub fn find_fragment_node(&self, fragid: &str) -> Option<Root<Dom<Element>>>

Attempt to find a named element in this page’s document. https://html.spec.whatwg.org/multipage/#the-indicated-part-of-the-document

source

pub fn check_and_scroll_fragment(&self, fragment: &str)

Scroll to the target element, and when we do not find a target and the fragment is empty or “top”, scroll to the top. https://html.spec.whatwg.org/multipage/#scroll-to-the-fragment-identifier

source

fn get_anchor_by_name(&self, name: &str) -> Option<Root<Dom<Element>>>

source

pub fn set_ready_state(&self, state: DocumentReadyState)

source

pub fn is_scripting_enabled(&self) -> bool

Return whether scripting is enabled or not

source

pub fn get_focused_element(&self) -> Option<Root<Dom<Element>>>

Return the element that currently has focus.

source

fn begin_focus_transaction(&self)

Initiate a new round of checking for elements requesting focus. The last element to call request_focus before commit_focus_transaction is called will receive focus.

source

pub(crate) fn perform_focus_fixup_rule(&self, not_focusable: &Element)

source

pub(crate) fn request_focus( &self, elem: Option<&Element>, focus_type: FocusType )

Request that the given element receive focus once the current transaction is complete. If None is passed, then whatever element is currently focused will no longer be focused once the transaction is complete.

source

fn commit_focus_transaction(&self, focus_type: FocusType)

Reassign the focus context to the element that last requested focus during this transaction, or none if no elements requested it.

source

pub fn title_changed(&self)

Handles any updates when the document’s title has changed.

source

pub fn send_title_to_embedder(&self)

Sends this document’s title to the constellation.

source

fn send_to_embedder(&self, msg: EmbedderMsg)

source

pub fn dirty_all_nodes(&self)

source

pub unsafe fn handle_mouse_event( &self, button: MouseButton, client_point: Point2D<f32>, mouse_event_type: MouseEventType, node_address: Option<UntrustedNodeAddress>, point_in_node: Option<Point2D<f32>>, pressed_mouse_buttons: u16 )

source

fn maybe_fire_dblclick( &self, click_pos: Point2D<f32>, target: &Node, pressed_mouse_buttons: u16 )

source

pub fn fire_mouse_event( &self, client_point: Point2D<f32>, target: &EventTarget, event_name: FireMouseEventType, can_bubble: EventBubbles, cancelable: EventCancelable, pressed_mouse_buttons: u16 )

source

pub unsafe fn handle_mouse_move_event( &self, client_point: Point2D<f32>, prev_mouse_over_target: &MutNullableDom<Element>, node_address: Option<UntrustedNodeAddress>, pressed_mouse_buttons: u16 )

source

fn handle_mouse_enter_leave_event( &self, client_point: Point2D<f32>, event_type: FireMouseEventType, related_target: Option<Root<Dom<Node>>>, event_target: Root<Dom<Node>>, pressed_mouse_buttons: u16 )

source

pub unsafe fn handle_wheel_event( &self, delta: WheelDelta, client_point: Point2D<f32>, node_address: Option<UntrustedNodeAddress> )

source

pub unsafe fn handle_touch_event( &self, event_type: TouchEventType, touch_id: TouchId, point: Point2D<f32>, node_address: Option<UntrustedNodeAddress> ) -> TouchEventResult

source

pub fn dispatch_key_event(&self, keyboard_event: KeyboardEvent)

The entry point for all key processing for web content

source

pub fn ime_dismissed(&self)

source

pub fn dispatch_composition_event(&self, composition_event: CompositionEvent)

source

pub fn node_from_nodes_and_strings( &self, nodes: Vec<NodeOrString> ) -> Result<Root<Dom<Node>>, Error>

source

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

source

pub fn set_body_attribute(&self, local_name: &LocalName, value: DOMString)

source

pub fn set_current_script(&self, script: Option<&HTMLScriptElement>)

source

pub fn get_script_blocking_stylesheets_count(&self) -> u32

source

pub fn increment_script_blocking_stylesheet_count(&self)

source

pub fn decrement_script_blocking_stylesheet_count(&self)

source

pub fn invalidate_stylesheets(&self)

source

pub fn request_animation_frame(&self, callback: AnimationFrameCallback) -> u32

source

pub fn cancel_animation_frame(&self, ident: u32)

source

pub fn run_the_animation_frame_callbacks(&self)

source

pub fn fetch_async( &self, load: LoadType, request: RequestBuilder, fetch_target: IpcSender<FetchResponseMsg> )

source

pub fn finish_load(&self, load: LoadType)

source

pub fn prompt_to_unload(&self, recursive_flag: bool) -> bool

source

pub fn unload(&self, recursive_flag: bool)

source

pub fn maybe_queue_document_completion(&self)

source

pub fn completely_loaded(&self) -> bool

source

pub fn set_pending_parsing_blocking_script( &self, script: &HTMLScriptElement, load: Option<Result<ScriptOrigin, NoTrace<NetworkError>>> )

source

pub fn has_pending_parsing_blocking_script(&self) -> bool

source

pub fn pending_parsing_blocking_script_loaded( &self, element: &HTMLScriptElement, result: Result<ScriptOrigin, NoTrace<NetworkError>> )

source

fn process_pending_parsing_blocking_script(&self)

source

pub fn add_asap_script(&self, script: &HTMLScriptElement)

source

pub fn asap_script_loaded( &self, element: &HTMLScriptElement, result: Result<ScriptOrigin, NoTrace<NetworkError>> )

source

pub fn push_asap_in_order_script(&self, script: &HTMLScriptElement)

source

pub fn asap_in_order_script_loaded( &self, element: &HTMLScriptElement, result: Result<ScriptOrigin, NoTrace<NetworkError>> )

source

pub fn add_deferred_script(&self, script: &HTMLScriptElement)

source

pub fn deferred_script_loaded( &self, element: &HTMLScriptElement, result: Result<ScriptOrigin, NoTrace<NetworkError>> )

source

fn process_deferred_scripts(&self)

source

pub fn maybe_dispatch_dom_content_loaded(&self)

source

pub fn abort(&self)

source

pub fn notify_constellation_load(&self)

source

pub fn set_current_parser(&self, script: Option<&ServoParser>)

source

pub fn get_current_parser(&self) -> Option<Root<Dom<ServoParser>>>

source

pub fn can_invoke_script(&self) -> bool

source

pub fn iter_iframes(&self) -> impl Iterator<Item = Root<Dom<HTMLIFrameElement>>>

Iterate over all iframes in the document.

source

pub fn find_iframe( &self, browsing_context_id: BrowsingContextId ) -> Option<Root<Dom<HTMLIFrameElement>>>

Find an iframe element in the document.

source

pub fn get_dom_loading(&self) -> u64

source

pub fn get_dom_interactive(&self) -> u64

source

pub fn set_navigation_start(&self, navigation_start: u64)

source

pub fn get_interactive_metrics(&self) -> Ref<'_, InteractiveMetrics>

source

pub fn has_recorded_tti_metric(&self) -> bool

source

pub fn get_dom_content_loaded_event_start(&self) -> u64

source

pub fn get_dom_content_loaded_event_end(&self) -> u64

source

pub fn get_dom_complete(&self) -> u64

source

pub fn get_top_level_dom_complete(&self) -> u64

source

pub fn get_load_event_start(&self) -> u64

source

pub fn get_load_event_end(&self) -> u64

source

pub fn get_unload_event_start(&self) -> u64

source

pub fn get_unload_event_end(&self) -> u64

source

pub fn start_tti(&self)

source

pub fn record_tti_if_necessary(&self)

check tti for this document if it’s been 10s since this doc encountered a task over 50ms, then we consider the main thread available and try to set tti

source

fn fire_focus_event( &self, focus_event_type: FocusEventType, node: &Node, related_target: Option<&EventTarget> )

source

pub fn lookup_custom_element_definition( &self, namespace: &Namespace, local_name: &LocalName, is: Option<&LocalName> ) -> Option<Rc<CustomElementDefinition>>

source

pub fn increment_throw_on_dynamic_markup_insertion_counter(&self)

source

pub fn decrement_throw_on_dynamic_markup_insertion_counter(&self)

source

pub fn react_to_environment_changes(&self)

source

pub fn register_responsive_image(&self, img: &HTMLImageElement)

source

pub fn unregister_responsive_image(&self, img: &HTMLImageElement)

source

pub fn register_media_controls(&self, controls: &ShadowRoot) -> String

source

pub fn unregister_media_controls(&self, id: &str)

source

pub fn add_dirty_webgl_canvas(&self, context: &WebGLRenderingContext)

source

pub fn flush_dirty_webgl_canvases(&self)

source

pub fn add_dirty_webgpu_canvas(&self, context: &GPUCanvasContext)

source

pub fn flush_dirty_webgpu_canvases(&self)

source

pub fn id_map(&self) -> Ref<'_, HashMapTracedValues<Atom, Vec<Dom<Element>>>>

source

pub fn name_map(&self) -> Ref<'_, HashMapTracedValues<Atom, Vec<Dom<Element>>>>

source§

impl Document

source

pub fn new_inherited( window: &Window, has_browsing_context: HasBrowsingContext, url: Option<ServoUrl>, origin: MutableOrigin, is_html_document: IsHTMLDocument, content_type: Option<Mime>, last_modified: Option<String>, activity: DocumentActivity, source: DocumentSource, doc_loader: DocumentLoader, referrer: Option<String>, referrer_policy: Option<ReferrerPolicy>, canceller: FetchCanceller ) -> Document

source

pub fn set_csp_list(&self, csp_list: Option<CspList>)

source

pub fn get_csp_list(&self) -> Option<Ref<'_, CspList>>

source

pub fn should_elements_inline_type_behavior_be_blocked( &self, el: &Element, type_: InlineCheckType, source: &str ) -> CheckResult

source

pub fn add_script_and_layout_blocker(&self)

Prevent any JS or layout from running until the corresponding call to remove_script_and_layout_blocker. Used to isolate periods in which the DOM is in an unstable state and should not be exposed to arbitrary web content. Any attempts to invoke content JS or query layout during that time will trigger a panic. add_delayed_task will cause the provided task to be executed as soon as the last blocker is removed.

source

pub fn remove_script_and_layout_blocker(&self)

Terminate the period in which JS or layout is disallowed from running. If no further blockers remain, any delayed tasks in the queue will be executed in queue order until the queue is empty.

source

pub fn add_delayed_task<T: 'static + TaskBox>(&self, task: T)

Enqueue a task to run as soon as any JS and layout blockers are removed.

source

pub fn ensure_safe_to_run_script_or_layout(&self)

Assert that the DOM is in a state that will allow running content JS or performing a layout operation.

source

pub fn Constructor( window: &Window, proto: Option<HandleObject<'_>> ) -> Result<Root<Dom<Document>>, Error>

source

pub fn new( window: &Window, has_browsing_context: HasBrowsingContext, url: Option<ServoUrl>, origin: MutableOrigin, doctype: IsHTMLDocument, content_type: Option<Mime>, last_modified: Option<String>, activity: DocumentActivity, source: DocumentSource, doc_loader: DocumentLoader, referrer: Option<String>, referrer_policy: Option<ReferrerPolicy>, canceller: FetchCanceller ) -> Root<Dom<Document>>

source

fn new_with_proto( window: &Window, proto: Option<HandleObject<'_>>, has_browsing_context: HasBrowsingContext, url: Option<ServoUrl>, origin: MutableOrigin, doctype: IsHTMLDocument, content_type: Option<Mime>, last_modified: Option<String>, activity: DocumentActivity, source: DocumentSource, doc_loader: DocumentLoader, referrer: Option<String>, referrer_policy: Option<ReferrerPolicy>, canceller: FetchCanceller ) -> Root<Dom<Document>>

source

pub fn get_redirect_count(&self) -> u16

source

pub fn set_redirect_count(&self, count: u16)

source

pub fn elements_by_name_count(&self, name: &DOMString) -> u32

source

pub fn nth_element_by_name( &self, index: u32, name: &DOMString ) -> Option<Root<Dom<Node>>>

source

fn is_element_in_get_by_name(node: &Node, name: &DOMString) -> bool

source

fn count_node_list<F: Fn(&Node) -> bool>(&self, callback: F) -> u32

source

fn nth_in_node_list<F: Fn(&Node) -> bool>( &self, index: u32, callback: F ) -> Option<Root<Dom<Node>>>

source

fn get_html_element(&self) -> Option<Root<Dom<HTMLHtmlElement>>>

source

pub fn style_shared_lock(&self) -> &StyleSharedRwLock

Return a reference to the per-document shared lock used in stylesheets.

source

pub fn flush_stylesheets_for_reflow(&self) -> bool

Flushes the stylesheet list, and returns whether any stylesheet changed.

source

pub fn device(&self) -> Device

Returns a Device suitable for media query evaluation.

FIXME(emilio): This really needs to be somehow more in sync with layout. Feels like a hack.

source

pub fn salvageable(&self) -> bool

source

pub fn appropriate_template_contents_owner_document( &self ) -> Root<Dom<Document>>

source

pub fn get_element_by_id(&self, id: &Atom) -> Option<Root<Dom<Element>>>

source

pub fn ensure_pending_restyle(&self, el: &Element) -> RefMut<'_, PendingRestyle>

source

pub fn element_state_will_change(&self, el: &Element)

source

pub fn element_attr_will_change(&self, el: &Element, attr: &Attr)

source

pub fn set_referrer_policy(&self, policy: Option<ReferrerPolicy>)

source

pub fn get_referrer_policy(&self) -> Option<ReferrerPolicy>

source

pub fn set_target_element(&self, node: Option<&Element>)

source

pub fn incr_ignore_destructive_writes_counter(&self)

source

pub fn decr_ignore_destructive_writes_counter(&self)

source

pub fn is_prompting_or_unloading(&self) -> bool

source

fn incr_ignore_opens_during_unload_counter(&self)

source

fn decr_ignore_opens_during_unload_counter(&self)

source

fn is_faking_animation_frames(&self) -> bool

Whether we’ve seen so many spurious animation frames (i.e. animation frames that didn’t mutate the DOM) that we’ve decided to fall back to fake ones.

source

pub fn enter_fullscreen(&self, pending: &Element) -> Rc<Promise>

source

pub fn exit_fullscreen(&self) -> Rc<Promise>

source

pub fn set_fullscreen_element(&self, element: Option<&Element>)

source

pub fn get_allow_fullscreen(&self) -> bool

source

fn reset_form_owner_for_listeners(&self, id: &Atom)

source

pub fn register_shadow_root(&self, shadow_root: &ShadowRoot)

source

pub fn unregister_shadow_root(&self, shadow_root: &ShadowRoot)

source

pub fn invalidate_shadow_roots_stylesheets(&self)

source

pub fn shadow_roots_styles_changed(&self) -> bool

source

pub fn flush_shadow_roots_stylesheets(&self)

source

pub fn stylesheet_count(&self) -> usize

source

pub fn stylesheet_at(&self, index: usize) -> Option<Root<Dom<CSSStyleSheet>>>

source

pub fn add_stylesheet(&self, owner: &Element, sheet: Arc<Stylesheet>)

Add a stylesheet owned by owner to the list of document sheets, in the correct tree position.

source

pub fn remove_stylesheet(&self, owner: &Element, stylesheet: &Arc<Stylesheet>)

Remove a stylesheet owned by owner from the list of document sheets.

source

pub fn get_elements_with_id(&self, id: &Atom) -> Ref<'_, [Dom<Element>]>

source

pub fn get_elements_with_name(&self, name: &Atom) -> Ref<'_, [Dom<Element>]>

source

pub fn drain_pending_restyles( &self ) -> Vec<(TrustedNodeAddress, PendingRestyle)>

source

pub(crate) fn advance_animation_timeline_for_testing(&self, delta: f64)

source

pub(crate) fn update_animation_timeline(&self)

source

pub(crate) fn maybe_mark_animating_nodes_as_dirty(&self)

source

pub(crate) fn current_animation_timeline_value(&self) -> f64

source

pub(crate) fn animations(&self) -> Ref<'_, Animations>

source

pub(crate) fn update_animations_post_reflow(&self)

source

pub(crate) fn cancel_animations_for_node(&self, node: &Node)

source

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

source

pub(crate) fn set_declarative_refresh(&self, refresh: DeclarativeRefresh)

Trait Implementations§

source§

impl Castable for Document

source§

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

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

fn upcast<T>(&self) -> &Twhere 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 DocumentMethods for Document

source§

fn QueryCommandSupported(&self, _command: DOMString) -> bool

source§

fn StyleSheets(&self) -> Root<Dom<StyleSheetList>>

source§

fn Implementation(&self) -> Root<Dom<DOMImplementation>>

source§

fn URL(&self) -> USVString

source§

fn GetActiveElement(&self) -> Option<Root<Dom<Element>>>

source§

fn HasFocus(&self) -> bool

source§

fn Domain(&self) -> DOMString

source§

fn SetDomain(&self, value: DOMString) -> Result<(), Error>

source§

fn Referrer(&self) -> DOMString

source§

fn DocumentURI(&self) -> USVString

source§

fn CompatMode(&self) -> DOMString

source§

fn CharacterSet(&self) -> DOMString

source§

fn Charset(&self) -> DOMString

source§

fn InputEncoding(&self) -> DOMString

source§

fn ContentType(&self) -> DOMString

source§

fn GetDoctype(&self) -> Option<Root<Dom<DocumentType>>>

source§

fn GetDocumentElement(&self) -> Option<Root<Dom<Element>>>

source§

fn GetElementsByTagName( &self, qualified_name: DOMString ) -> Root<Dom<HTMLCollection>>

source§

fn GetElementsByTagNameNS( &self, maybe_ns: Option<DOMString>, tag_name: DOMString ) -> Root<Dom<HTMLCollection>>

source§

fn GetElementsByClassName( &self, classes: DOMString ) -> Root<Dom<HTMLCollection>>

source§

fn GetElementById(&self, id: DOMString) -> Option<Root<Dom<Element>>>

source§

fn CreateElement( &self, local_name: DOMString, options: StringOrElementCreationOptions ) -> Result<Root<Dom<Element>>, Error>

source§

fn CreateElementNS( &self, namespace: Option<DOMString>, qualified_name: DOMString, options: StringOrElementCreationOptions ) -> Result<Root<Dom<Element>>, Error>

source§

fn CreateAttribute( &self, local_name: DOMString ) -> Result<Root<Dom<Attr>>, Error>

source§

fn CreateAttributeNS( &self, namespace: Option<DOMString>, qualified_name: DOMString ) -> Result<Root<Dom<Attr>>, Error>

source§

fn CreateDocumentFragment(&self) -> Root<Dom<DocumentFragment>>

source§

fn CreateTextNode(&self, data: DOMString) -> Root<Dom<Text>>

source§

fn CreateCDATASection( &self, data: DOMString ) -> Result<Root<Dom<CDATASection>>, Error>

source§

fn CreateComment(&self, data: DOMString) -> Root<Dom<Comment>>

source§

fn CreateProcessingInstruction( &self, target: DOMString, data: DOMString ) -> Result<Root<Dom<ProcessingInstruction>>, Error>

source§

fn ImportNode(&self, node: &Node, deep: bool) -> Result<Root<Dom<Node>>, Error>

source§

fn AdoptNode(&self, node: &Node) -> Result<Root<Dom<Node>>, Error>

source§

fn CreateEvent(&self, interface: DOMString) -> Result<Root<Dom<Event>>, Error>

source§

fn LastModified(&self) -> DOMString

source§

fn CreateRange(&self) -> Root<Dom<Range>>

source§

fn CreateNodeIterator( &self, root: &Node, what_to_show: u32, filter: Option<Rc<NodeFilter>> ) -> Root<Dom<NodeIterator>>

source§

fn CreateTreeWalker( &self, root: &Node, what_to_show: u32, filter: Option<Rc<NodeFilter>> ) -> Root<Dom<TreeWalker>>

source§

fn Title(&self) -> DOMString

source§

fn SetTitle(&self, title: DOMString)

source§

fn GetHead(&self) -> Option<Root<Dom<HTMLHeadElement>>>

source§

fn GetCurrentScript(&self) -> Option<Root<Dom<HTMLScriptElement>>>

source§

fn GetBody(&self) -> Option<Root<Dom<HTMLElement>>>

source§

fn SetBody(&self, new_body: Option<&HTMLElement>) -> Result<(), Error>

source§

fn GetElementsByName(&self, name: DOMString) -> Root<Dom<NodeList>>

source§

fn Images(&self) -> Root<Dom<HTMLCollection>>

source§

fn Embeds(&self) -> Root<Dom<HTMLCollection>>

source§

fn Plugins(&self) -> Root<Dom<HTMLCollection>>

source§

fn Forms(&self) -> Root<Dom<HTMLCollection>>

source§

fn Scripts(&self) -> Root<Dom<HTMLCollection>>

source§

fn Anchors(&self) -> Root<Dom<HTMLCollection>>

source§

fn Applets(&self) -> Root<Dom<HTMLCollection>>

source§

fn GetLocation(&self) -> Option<Root<Dom<Location>>>

source§

fn Children(&self) -> Root<Dom<HTMLCollection>>

source§

fn GetFirstElementChild(&self) -> Option<Root<Dom<Element>>>

source§

fn GetLastElementChild(&self) -> Option<Root<Dom<Element>>>

source§

fn ChildElementCount(&self) -> u32

source§

fn Prepend(&self, nodes: Vec<NodeOrString>) -> Result<(), Error>

source§

fn Append(&self, nodes: Vec<NodeOrString>) -> Result<(), Error>

source§

fn ReplaceChildren(&self, nodes: Vec<NodeOrString>) -> Result<(), Error>

source§

fn QuerySelector( &self, selectors: DOMString ) -> Result<Option<Root<Dom<Element>>>, Error>

source§

fn QuerySelectorAll( &self, selectors: DOMString ) -> Result<Root<Dom<NodeList>>, Error>

source§

fn ReadyState(&self) -> DocumentReadyState

source§

fn GetDefaultView(&self) -> Option<Root<Dom<Window>>>

source§

fn GetCookie(&self) -> Result<DOMString, Error>

source§

fn SetCookie(&self, cookie: DOMString) -> Result<(), Error>

source§

fn BgColor(&self) -> DOMString

source§

fn SetBgColor(&self, value: DOMString)

source§

fn FgColor(&self) -> DOMString

source§

fn SetFgColor(&self, value: DOMString)

source§

fn NamedGetter( &self, _cx: JSContext, name: DOMString ) -> Option<NonNull<JSObject>>

source§

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

source§

fn Clear(&self)

source§

fn CaptureEvents(&self)

source§

fn ReleaseEvents(&self)

source§

fn GetOnblur(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnblur(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnerror(&self) -> Option<Rc<OnErrorEventHandlerNonNull>>

source§

fn SetOnerror(&self, listener: Option<Rc<OnErrorEventHandlerNonNull>>)

source§

fn GetOnfocus(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnfocus(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnload(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnload(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnresize(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnresize(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnscroll(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnscroll(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnabort(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnabort(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnanimationend(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnanimationend(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnanimationiteration(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnanimationiteration(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOncancel(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOncancel(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOncanplay(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOncanplay(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOncanplaythrough(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOncanplaythrough(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnchange(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnchange(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnclick(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnclick(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnclose(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnclose(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOncontextmenu(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOncontextmenu(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOncuechange(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOncuechange(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOndblclick(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOndblclick(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOndrag(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOndrag(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOndragend(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOndragend(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOndragenter(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOndragenter(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOndragexit(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOndragexit(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOndragleave(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOndragleave(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOndragover(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOndragover(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOndragstart(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOndragstart(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOndrop(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOndrop(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOndurationchange(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOndurationchange(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnemptied(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnemptied(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnended(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnended(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnformdata(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnformdata(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOninput(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOninput(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOninvalid(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOninvalid(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnkeydown(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnkeydown(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnkeypress(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnkeypress(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnkeyup(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnkeyup(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnloadeddata(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnloadeddata(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnloadedmetadata(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnloadedmetadata(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnloadstart(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnloadstart(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnmousedown(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnmousedown(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnmouseenter(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnmouseenter(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnmouseleave(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnmouseleave(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnmousemove(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnmousemove(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnmouseout(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnmouseout(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnmouseover(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnmouseover(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnmouseup(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnmouseup(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnwheel(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnwheel(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnpause(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnpause(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnplay(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnplay(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnplaying(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnplaying(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnprogress(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnprogress(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnratechange(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnratechange(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnreset(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnreset(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnseeked(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnseeked(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnseeking(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnseeking(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnselect(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnselect(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnselectionchange(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnselectionchange(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnselectstart(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnselectstart(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnshow(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnshow(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnstalled(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnstalled(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnsubmit(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnsubmit(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnsuspend(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnsuspend(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOntimeupdate(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOntimeupdate(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOntoggle(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOntoggle(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOntransitioncancel(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOntransitioncancel(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOntransitionend(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOntransitionend(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOntransitionrun(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOntransitionrun(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnvolumechange(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnvolumechange(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnwaiting(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnwaiting(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnreadystatechange(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnreadystatechange(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn ElementFromPoint( &self, x: Finite<f64>, y: Finite<f64> ) -> Option<Root<Dom<Element>>>

source§

fn ElementsFromPoint( &self, x: Finite<f64>, y: Finite<f64> ) -> Vec<Root<Dom<Element>>>

source§

fn Open( &self, _unused1: Option<DOMString>, _unused2: Option<DOMString> ) -> Result<Root<Dom<Document>>, Error>

source§

fn Open_( &self, url: USVString, target: DOMString, features: DOMString ) -> Result<Option<Root<Dom<WindowProxy>>>, Error>

source§

fn Write(&self, text: Vec<DOMString>) -> Result<(), Error>

source§

fn Writeln(&self, text: Vec<DOMString>) -> Result<(), Error>

source§

fn Close(&self) -> Result<(), Error>

source§

fn GetOncut(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOncut(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOncopy(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOncopy(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnpaste(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnpaste(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnfullscreenerror(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnfullscreenerror(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn GetOnfullscreenchange(&self) -> Option<Rc<EventHandlerNonNull>>

source§

fn SetOnfullscreenchange(&self, listener: Option<Rc<EventHandlerNonNull>>)

source§

fn FullscreenEnabled(&self) -> bool

source§

fn Fullscreen(&self) -> bool

source§

fn GetFullscreenElement(&self) -> Option<Root<Dom<Element>>>

source§

fn ExitFullscreen(&self) -> Rc<Promise>

source§

fn ServoGetMediaControls( &self, id: DOMString ) -> Result<Root<Dom<ShadowRoot>>, Error>

source§

fn GetSelection(&self) -> Option<Root<Dom<Selection>>>

source§

impl DomObject for Document

source§

fn reflector(&self) -> &Reflector

Returns the receiver’s reflector.
source§

fn global(&self) -> Root<Dom<GlobalScope>>where Self: Sized,

Returns the global scope of the realm that the DomObject was created in.
source§

impl DomObjectWrap for Document

source§

const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::DocumentBinding::Document_Binding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::document::Document>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::document::Document>>}

Function pointer to the general wrap function type
source§

impl HasParent for Document

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

§

type Parent = Node

source§

impl IDLInterface for Document

source§

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

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

impl MallocSizeOf for Document

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 Document

source§

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

Initializes the Reflector
source§

impl PartialEq<Document> for Document

source§

fn eq(&self, other: &Document) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl ProfilerMetadataFactory for Document

source§

impl ToJSValConvertible for Document

source§

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

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

impl Traceable for Document

source§

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

Trace self.
source§

impl DerivedFrom<Document> for Document

source§

impl DerivedFrom<Document> for XMLDocument

source§

impl DerivedFrom<EventTarget> for Document

source§

impl DerivedFrom<Node> for Document

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. 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 Twhere 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> MaybeBoxed<Box<T, Global>> for T

source§

fn maybe_boxed(self) -> Box<T, Global>

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

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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<V, T> VZip<V> for Twhere 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> Erased for T