#[repr(C)]pub struct Document {Show 100 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<Instant>>,
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_interactive: Cell<Option<CrossProcessInstant>>,
dom_content_loaded_event_start: Cell<Option<CrossProcessInstant>>,
dom_content_loaded_event_end: Cell<Option<CrossProcessInstant>>,
dom_complete: Cell<Option<CrossProcessInstant>>,
top_level_dom_complete: Cell<Option<CrossProcessInstant>>,
load_event_start: Cell<Option<CrossProcessInstant>>,
load_event_end: Cell<Option<CrossProcessInstant>>,
unload_event_start: Cell<Option<CrossProcessInstant>>,
unload_event_end: Cell<Option<CrossProcessInstant>>,
https_state: Cell<HttpsState>,
origin: MutableOrigin,
referrer: Option<String>,
target_element: MutNullableDom<Element>,
policy_container: DomRefCell<PolicyContainer>,
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<HashMapTracedValues<WebGPUContextId, Dom<GPUCanvasContext>>>,
selection: MutNullableDom<Selection>,
animation_timeline: DomRefCell<AnimationTimeline>,
animations: DomRefCell<Animations>,
dirty_root: MutNullableDom<Element>,
declarative_refresh: DomRefCell<Option<DeclarativeRefresh>>,
pending_compositor_events: DomRefCell<Vec<CompositorEvent>>,
mouse_move_event_index: DomRefCell<Option<usize>>,
pending_animation_ticks: DomRefCell<AnimationTickType>,
resize_observers: DomRefCell<Vec<Dom<ResizeObserver>>>,
fonts: MutNullableDom<FontFaceSet>,
visibility_state: Cell<DocumentVisibilityState>,
status_code: Option<u16>,
}
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>
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>
https://html.spec.whatwg.org/multipage/#animation-frame-callback-identifier Current identifier of animation frame callback
animation_frame_list: DomRefCell<Vec<(u32, Option<AnimationFrameCallback>)>>
https://html.spec.whatwg.org/multipage/#list-of-animation-frame-callbacks List of animation frame callbacks
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<Instant>>
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_interactive: Cell<Option<CrossProcessInstant>>
Navigation Timing properties: https://w3c.github.io/navigation-timing/#sec-PerformanceNavigationTiming
dom_content_loaded_event_start: Cell<Option<CrossProcessInstant>>
§dom_content_loaded_event_end: Cell<Option<CrossProcessInstant>>
§dom_complete: Cell<Option<CrossProcessInstant>>
§top_level_dom_complete: Cell<Option<CrossProcessInstant>>
§load_event_start: Cell<Option<CrossProcessInstant>>
§load_event_end: Cell<Option<CrossProcessInstant>>
§unload_event_start: Cell<Option<CrossProcessInstant>>
§unload_event_end: Cell<Option<CrossProcessInstant>>
§https_state: Cell<HttpsState>
§origin: MutableOrigin
The document’s origin.
referrer: Option<String>
§target_element: MutNullableDom<Element>
§policy_container: DomRefCell<PolicyContainer>
§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.
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<HashMapTracedValues<WebGPUContextId, Dom<GPUCanvasContext>>>
List of all WebGPU context IDs that need flushing.
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>>
§pending_compositor_events: DomRefCell<Vec<CompositorEvent>>
Pending composition events, to be handled at the next rendering opportunity.
mouse_move_event_index: DomRefCell<Option<usize>>
The index of the last mouse move event in the pending compositor events queue.
pending_animation_ticks: DomRefCell<AnimationTickType>
Pending animation ticks, to be handled at the next rendering opportunity.
resize_observers: DomRefCell<Vec<Dom<ResizeObserver>>>
https://drafts.csswg.org/resize-observer/#dom-document-resizeobservers-slot
Note: we are storing, but never removing, resize observers. The lifetime of resize observers is specified at https://drafts.csswg.org/resize-observer/#lifetime. But implementing it comes with known problems:
fonts: MutNullableDom<FontFaceSet>
The set of all fonts loaded by this document. https://drafts.csswg.org/css-font-loading/#font-face-source
visibility_state: Cell<DocumentVisibilityState>
§status_code: Option<u16>
Implementations§
source§impl Document
impl Document
pub fn note_node_with_dirty_descendants(&self, node: &Node)
pub fn take_dirty_root(&self) -> Option<Root<Dom<Element>>>
pub fn loader(&self) -> Ref<'_, DocumentLoader>
pub fn loader_mut(&self) -> RefMut<'_, DocumentLoader>
pub fn has_browsing_context(&self) -> bool
sourcepub fn browsing_context(&self) -> Option<Root<Dom<WindowProxy>>>
pub fn browsing_context(&self) -> Option<Root<Dom<WindowProxy>>>
pub fn window(&self) -> &Window
pub fn is_html_document(&self) -> bool
pub fn set_https_state(&self, https_state: HttpsState)
pub fn is_fully_active(&self) -> bool
pub fn is_active(&self) -> bool
pub fn set_activity(&self, activity: DocumentActivity, can_gc: CanGc)
pub fn origin(&self) -> &MutableOrigin
pub fn set_url(&self, url: ServoUrl)
sourcepub fn fallback_base_url(&self) -> ServoUrl
pub fn fallback_base_url(&self) -> ServoUrl
pub fn needs_paint(&self) -> bool
pub fn needs_reflow(&self) -> Option<ReflowTriggerCondition>
sourcepub fn base_element(&self) -> Option<Root<Dom<HTMLBaseElement>>>
pub fn base_element(&self) -> Option<Root<Dom<HTMLBaseElement>>>
Returns the first base
element in the DOM that has an href
attribute.
sourcepub fn refresh_base_element(&self)
pub fn refresh_base_element(&self)
Refresh the cached first base element in the DOM. https://github.com/w3c/web-platform-tests/issues/2122
pub fn dom_count(&self) -> u32
sourcepub fn increment_dom_count(&self)
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)
sourcepub fn decrement_dom_count(&self)
pub fn decrement_dom_count(&self)
This is called by unbind_from_tree
when a node is removed from the DOM.
pub fn quirks_mode(&self) -> QuirksMode
pub fn set_quirks_mode(&self, new_mode: QuirksMode)
pub fn encoding(&self) -> &'static Encoding
pub fn set_encoding(&self, encoding: &'static Encoding)
pub fn content_and_heritage_changed(&self, node: &Node)
sourcepub fn reflow_if_reflow_timer_expired(&self, can_gc: CanGc)
pub fn reflow_if_reflow_timer_expired(&self, can_gc: CanGc)
Reflows and disarms the timer if the reflow timer has expired.
sourcepub fn set_reflow_timeout(&self, duration: Duration)
pub fn set_reflow_timeout(&self, duration: Duration)
Schedules a reflow to be kicked off at the given Duration
in the future. This reflow
happens even if the event loop is busy. This is used to display initial page content during
parsing.
sourcepub fn unregister_element_id(&self, to_unregister: &Element, id: Atom)
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.
sourcepub fn register_element_id(&self, element: &Element, id: Atom)
pub fn register_element_id(&self, element: &Element, id: Atom)
Associate an element present in this document with the provided id.
sourcepub fn unregister_element_name(&self, to_unregister: &Element, name: Atom)
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.
sourcepub fn register_element_name(&self, element: &Element, name: Atom)
pub fn register_element_name(&self, element: &Element, name: Atom)
Associate an element present in this document with the provided name.
pub fn register_form_id_listener<T: ?Sized + FormControl>( &self, id: DOMString, listener: &T, )
pub fn unregister_form_id_listener<T: ?Sized + FormControl>( &self, id: DOMString, listener: &T, )
sourcepub fn find_fragment_node(&self, fragid: &str) -> Option<Root<Dom<Element>>>
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
sourcepub fn check_and_scroll_fragment(&self, fragment: &str, can_gc: CanGc)
pub fn check_and_scroll_fragment(&self, fragment: &str, can_gc: CanGc)
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
fn get_anchor_by_name(&self, name: &str) -> Option<Root<Dom<Element>>>
pub fn set_ready_state(&self, state: DocumentReadyState, can_gc: CanGc)
sourcepub fn is_scripting_enabled(&self) -> bool
pub fn is_scripting_enabled(&self) -> bool
Return whether scripting is enabled or not
sourcepub fn get_focused_element(&self) -> Option<Root<Dom<Element>>>
pub fn get_focused_element(&self) -> Option<Root<Dom<Element>>>
Return the element that currently has focus.
sourcefn begin_focus_transaction(&self)
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.
sourcepub(crate) fn perform_focus_fixup_rule(
&self,
not_focusable: &Element,
can_gc: CanGc,
)
pub(crate) fn perform_focus_fixup_rule( &self, not_focusable: &Element, can_gc: CanGc, )
sourcepub(crate) fn request_focus(
&self,
elem: Option<&Element>,
focus_type: FocusType,
can_gc: CanGc,
)
pub(crate) fn request_focus( &self, elem: Option<&Element>, focus_type: FocusType, can_gc: CanGc, )
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.
sourcefn commit_focus_transaction(&self, focus_type: FocusType, can_gc: CanGc)
fn commit_focus_transaction(&self, focus_type: FocusType, can_gc: CanGc)
Reassign the focus context to the element that last requested focus during this transaction, or none if no elements requested it.
sourcepub fn title_changed(&self)
pub fn title_changed(&self)
Handles any updates when the document’s title has changed.
sourcefn title(&self) -> Option<DOMString>
fn title(&self) -> Option<DOMString>
Determine the title of the Document
according to the specification at:
https://html.spec.whatwg.org/multipage/#document.title. The difference
here is that when the title isn’t specified None
is returned.
sourcepub fn send_title_to_embedder(&self)
pub fn send_title_to_embedder(&self)
Sends this document’s title to the constellation.
fn send_to_embedder(&self, msg: EmbedderMsg)
pub fn dirty_all_nodes(&self)
fn maybe_fire_dblclick( &self, click_pos: Point2D<f32>, target: &Node, pressed_mouse_buttons: u16, can_gc: CanGc, )
pub fn fire_mouse_event( &self, client_point: Point2D<f32>, target: &EventTarget, event_name: FireMouseEventType, can_bubble: EventBubbles, cancelable: EventCancelable, pressed_mouse_buttons: u16, can_gc: CanGc, )
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, can_gc: CanGc, )
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, can_gc: CanGc, )
pub unsafe fn handle_wheel_event( &self, delta: WheelDelta, client_point: Point2D<f32>, node_address: Option<UntrustedNodeAddress>, can_gc: CanGc, )
pub unsafe fn handle_touch_event( &self, event_type: TouchEventType, touch_id: TouchId, point: Point2D<f32>, node_address: Option<UntrustedNodeAddress>, can_gc: CanGc, ) -> TouchEventResult
sourcepub fn dispatch_key_event(&self, keyboard_event: KeyboardEvent, can_gc: CanGc)
pub fn dispatch_key_event(&self, keyboard_event: KeyboardEvent, can_gc: CanGc)
The entry point for all key processing for web content
pub fn ime_dismissed(&self, can_gc: CanGc)
pub fn dispatch_composition_event( &self, composition_event: CompositionEvent, can_gc: CanGc, )
pub fn node_from_nodes_and_strings( &self, nodes: Vec<NodeOrString>, can_gc: CanGc, ) -> Result<Root<Dom<Node>>, Error>
pub fn get_body_attribute(&self, local_name: &LocalName) -> DOMString
pub fn set_body_attribute( &self, local_name: &LocalName, value: DOMString, can_gc: CanGc, )
pub fn set_current_script(&self, script: Option<&HTMLScriptElement>)
pub fn get_script_blocking_stylesheets_count(&self) -> u32
pub fn increment_script_blocking_stylesheet_count(&self)
pub fn decrement_script_blocking_stylesheet_count(&self)
pub fn invalidate_stylesheets(&self)
sourcepub fn request_animation_frame(&self, callback: AnimationFrameCallback) -> u32
pub fn request_animation_frame(&self, callback: AnimationFrameCallback) -> u32
sourcepub fn cancel_animation_frame(&self, ident: u32)
pub fn cancel_animation_frame(&self, ident: u32)
sourcepub fn run_the_animation_frame_callbacks(&self, can_gc: CanGc)
pub fn run_the_animation_frame_callbacks(&self, can_gc: CanGc)
pub fn policy_container(&self) -> Ref<'_, PolicyContainer>
sourcepub(crate) fn prepare_request(&self, request: RequestBuilder) -> RequestBuilder
pub(crate) fn prepare_request(&self, request: RequestBuilder) -> RequestBuilder
Add the policy container and HTTPS state to a given request.
TODO: Can this hapen for all requests that go through the document?
pub(crate) fn fetch<Listener: FetchResponseListener + PreInvoke + Send + 'static>( &self, load: LoadType, request: RequestBuilder, listener: Listener, )
pub(crate) fn fetch_background<Listener: FetchResponseListener + PreInvoke + Send + 'static>( &self, request: RequestBuilder, listener: Listener, cancel_override: Option<IpcReceiver<()>>, )
pub fn finish_load(&self, load: LoadType, can_gc: CanGc)
pub fn prompt_to_unload(&self, recursive_flag: bool, can_gc: CanGc) -> bool
pub fn unload(&self, recursive_flag: bool, can_gc: CanGc)
pub fn maybe_queue_document_completion(&self)
pub fn completely_loaded(&self) -> bool
pub fn set_pending_parsing_blocking_script( &self, script: &HTMLScriptElement, load: Option<Result<ScriptOrigin, NoTrace<NetworkError>>>, )
pub fn has_pending_parsing_blocking_script(&self) -> bool
sourcepub fn pending_parsing_blocking_script_loaded(
&self,
element: &HTMLScriptElement,
result: Result<ScriptOrigin, NoTrace<NetworkError>>,
can_gc: CanGc,
)
pub fn pending_parsing_blocking_script_loaded( &self, element: &HTMLScriptElement, result: Result<ScriptOrigin, NoTrace<NetworkError>>, can_gc: CanGc, )
fn process_pending_parsing_blocking_script(&self, can_gc: CanGc)
pub fn add_asap_script(&self, script: &HTMLScriptElement)
sourcepub fn asap_script_loaded(
&self,
element: &HTMLScriptElement,
result: Result<ScriptOrigin, NoTrace<NetworkError>>,
)
pub fn asap_script_loaded( &self, element: &HTMLScriptElement, result: Result<ScriptOrigin, NoTrace<NetworkError>>, )
pub fn push_asap_in_order_script(&self, script: &HTMLScriptElement)
sourcepub fn asap_in_order_script_loaded(
&self,
element: &HTMLScriptElement,
result: Result<ScriptOrigin, NoTrace<NetworkError>>,
)
pub fn asap_in_order_script_loaded( &self, element: &HTMLScriptElement, result: Result<ScriptOrigin, NoTrace<NetworkError>>, )
pub fn add_deferred_script(&self, script: &HTMLScriptElement)
sourcepub fn deferred_script_loaded(
&self,
element: &HTMLScriptElement,
result: Result<ScriptOrigin, NoTrace<NetworkError>>,
)
pub fn deferred_script_loaded( &self, element: &HTMLScriptElement, result: Result<ScriptOrigin, NoTrace<NetworkError>>, )
pub fn maybe_dispatch_dom_content_loaded(&self)
pub fn abort(&self, can_gc: CanGc)
pub fn notify_constellation_load(&self)
pub fn set_current_parser(&self, script: Option<&ServoParser>)
pub fn get_current_parser(&self) -> Option<Root<Dom<ServoParser>>>
sourcepub fn iter_iframes(&self) -> impl Iterator<Item = Root<Dom<HTMLIFrameElement>>>
pub fn iter_iframes(&self) -> impl Iterator<Item = Root<Dom<HTMLIFrameElement>>>
Iterate over all iframes in the document.
sourcepub fn find_iframe(
&self,
browsing_context_id: BrowsingContextId,
) -> Option<Root<Dom<HTMLIFrameElement>>>
pub fn find_iframe( &self, browsing_context_id: BrowsingContextId, ) -> Option<Root<Dom<HTMLIFrameElement>>>
Find an iframe element in the document.
pub fn get_dom_interactive(&self) -> Option<CrossProcessInstant>
pub fn get_interactive_metrics(&self) -> Ref<'_, InteractiveMetrics>
pub fn has_recorded_tti_metric(&self) -> bool
pub fn get_dom_content_loaded_event_start(&self) -> Option<CrossProcessInstant>
pub fn get_dom_content_loaded_event_end(&self) -> Option<CrossProcessInstant>
pub fn get_dom_complete(&self) -> Option<CrossProcessInstant>
pub fn get_top_level_dom_complete(&self) -> Option<CrossProcessInstant>
pub fn get_load_event_start(&self) -> Option<CrossProcessInstant>
pub fn get_load_event_end(&self) -> Option<CrossProcessInstant>
pub fn get_unload_event_start(&self) -> Option<CrossProcessInstant>
pub fn get_unload_event_end(&self) -> Option<CrossProcessInstant>
pub fn start_tti(&self)
sourcepub fn record_tti_if_necessary(&self)
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
fn fire_focus_event( &self, focus_event_type: FocusEventType, node: &Node, related_target: Option<&EventTarget>, can_gc: CanGc, )
sourcepub fn lookup_custom_element_definition(
&self,
namespace: &Namespace,
local_name: &LocalName,
is: Option<&LocalName>,
) -> Option<Rc<CustomElementDefinition>>
pub fn lookup_custom_element_definition( &self, namespace: &Namespace, local_name: &LocalName, is: Option<&LocalName>, ) -> Option<Rc<CustomElementDefinition>>
pub fn increment_throw_on_dynamic_markup_insertion_counter(&self)
pub fn decrement_throw_on_dynamic_markup_insertion_counter(&self)
pub fn react_to_environment_changes(&self)
pub fn register_responsive_image(&self, img: &HTMLImageElement)
pub fn unregister_responsive_image(&self, img: &HTMLImageElement)
pub fn register_media_controls(&self, controls: &ShadowRoot) -> String
pub fn unregister_media_controls(&self, id: &str)
pub fn add_dirty_webgl_canvas(&self, context: &WebGLRenderingContext)
pub fn flush_dirty_webgl_canvases(&self)
pub fn add_dirty_webgpu_canvas(&self, context: &GPUCanvasContext)
pub fn flush_dirty_webgpu_canvases(&self)
pub fn id_map(&self) -> Ref<'_, HashMapTracedValues<Atom, Vec<Dom<Element>>>>
pub fn name_map(&self) -> Ref<'_, HashMapTracedValues<Atom, Vec<Dom<Element>>>>
sourcepub(crate) fn add_resize_observer(&self, resize_observer: &ResizeObserver)
pub(crate) fn add_resize_observer(&self, resize_observer: &ResizeObserver)
sourcepub(crate) fn gather_active_resize_observations_at_depth(
&self,
depth: &ResizeObservationDepth,
can_gc: CanGc,
) -> bool
pub(crate) fn gather_active_resize_observations_at_depth( &self, depth: &ResizeObservationDepth, can_gc: CanGc, ) -> bool
sourcepub(crate) fn broadcast_active_resize_observations(
&self,
can_gc: CanGc,
) -> ResizeObservationDepth
pub(crate) fn broadcast_active_resize_observations( &self, can_gc: CanGc, ) -> ResizeObservationDepth
sourcepub(crate) fn has_skipped_resize_observations(&self) -> bool
pub(crate) fn has_skipped_resize_observations(&self) -> bool
sourcepub(crate) fn deliver_resize_loop_error_notification(&self, can_gc: CanGc)
pub(crate) fn deliver_resize_loop_error_notification(&self, can_gc: CanGc)
pub(crate) fn status_code(&self) -> Option<u16>
sourcepub fn encoding_parse_a_url(&self, url: &str) -> Result<ServoUrl, ParseError>
pub fn encoding_parse_a_url(&self, url: &str) -> Result<ServoUrl, ParseError>
source§impl Document
impl Document
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>, status_code: Option<u16>, canceller: FetchCanceller, ) -> Document
sourcepub fn note_pending_animation_tick(&self, tick_type: AnimationTickType)
pub fn note_pending_animation_tick(&self, tick_type: AnimationTickType)
Note a pending animation tick, to be processed at the next update_the_rendering
task.
sourcepub fn has_received_raf_tick(&self) -> bool
pub fn has_received_raf_tick(&self) -> bool
Whether this document has received an animation tick for rafs.
sourcepub fn tick_all_animations(&self, should_run_rafs: bool, can_gc: CanGc)
pub fn tick_all_animations(&self, should_run_rafs: bool, can_gc: CanGc)
As part of a update_the_rendering
task, tick all pending animations.
sourcepub fn note_pending_compositor_event(&self, event: CompositorEvent)
pub fn note_pending_compositor_event(&self, event: CompositorEvent)
Note a pending compositor event, to be processed at the next update_the_rendering
task.
sourcepub fn take_pending_compositor_events(&self) -> Vec<CompositorEvent>
pub fn take_pending_compositor_events(&self) -> Vec<CompositorEvent>
Get pending compositor events, for processing within an update_the_rendering
task.
pub fn set_csp_list(&self, csp_list: Option<CspList>)
pub fn get_csp_list(&self) -> Option<CspList>
sourcepub fn should_elements_inline_type_behavior_be_blocked(
&self,
el: &Element,
type_: InlineCheckType,
source: &str,
) -> CheckResult
pub fn should_elements_inline_type_behavior_be_blocked( &self, el: &Element, type_: InlineCheckType, source: &str, ) -> CheckResult
sourcepub fn add_script_and_layout_blocker(&self)
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.
sourcepub fn remove_script_and_layout_blocker(&self)
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.
sourcepub fn add_delayed_task<T: 'static + TaskBox>(&self, task: T)
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.
sourcepub fn ensure_safe_to_run_script_or_layout(&self)
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.
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>, status_code: Option<u16>, canceller: FetchCanceller, can_gc: CanGc, ) -> Root<Dom<Document>>
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>, status_code: Option<u16>, canceller: FetchCanceller, can_gc: CanGc, ) -> Root<Dom<Document>>
pub fn get_redirect_count(&self) -> u16
pub fn set_redirect_count(&self, count: u16)
pub fn elements_by_name_count(&self, name: &DOMString) -> u32
pub fn nth_element_by_name( &self, index: u32, name: &DOMString, ) -> Option<Root<Dom<Node>>>
fn is_element_in_get_by_name(node: &Node, name: &DOMString) -> bool
fn count_node_list<F: Fn(&Node) -> bool>(&self, callback: F) -> u32
fn nth_in_node_list<F: Fn(&Node) -> bool>( &self, index: u32, callback: F, ) -> Option<Root<Dom<Node>>>
fn get_html_element(&self) -> Option<Root<Dom<HTMLHtmlElement>>>
Return a reference to the per-document shared lock used in stylesheets.
sourcepub fn flush_stylesheets_for_reflow(&self) -> bool
pub fn flush_stylesheets_for_reflow(&self) -> bool
Flushes the stylesheet list, and returns whether any stylesheet changed.
pub fn salvageable(&self) -> bool
sourcepub fn appropriate_template_contents_owner_document(
&self,
can_gc: CanGc,
) -> Root<Dom<Document>>
pub fn appropriate_template_contents_owner_document( &self, can_gc: CanGc, ) -> Root<Dom<Document>>
pub fn get_element_by_id(&self, id: &Atom) -> Option<Root<Dom<Element>>>
pub fn ensure_pending_restyle(&self, el: &Element) -> RefMut<'_, PendingRestyle>
pub fn element_state_will_change(&self, el: &Element)
pub fn element_attr_will_change(&self, el: &Element, attr: &Attr)
pub fn set_referrer_policy(&self, policy: ReferrerPolicy)
pub fn get_referrer_policy(&self) -> ReferrerPolicy
pub fn set_target_element(&self, node: Option<&Element>, can_gc: CanGc)
pub fn incr_ignore_destructive_writes_counter(&self)
pub fn decr_ignore_destructive_writes_counter(&self)
pub fn is_prompting_or_unloading(&self) -> bool
fn incr_ignore_opens_during_unload_counter(&self)
fn decr_ignore_opens_during_unload_counter(&self)
sourcefn is_faking_animation_frames(&self) -> bool
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.
pub fn enter_fullscreen(&self, pending: &Element, can_gc: CanGc) -> Rc<Promise>
pub fn exit_fullscreen(&self, can_gc: CanGc) -> Rc<Promise>
pub fn set_fullscreen_element(&self, element: Option<&Element>)
pub fn get_allow_fullscreen(&self) -> bool
fn reset_form_owner_for_listeners(&self, id: &Atom)
pub fn register_shadow_root(&self, shadow_root: &ShadowRoot)
pub fn unregister_shadow_root(&self, shadow_root: &ShadowRoot)
pub fn invalidate_shadow_roots_stylesheets(&self)
pub fn shadow_roots_styles_changed(&self) -> bool
pub fn flush_shadow_roots_stylesheets(&self)
pub fn stylesheet_count(&self) -> usize
pub fn stylesheet_at(&self, index: usize) -> Option<Root<Dom<CSSStyleSheet>>>
sourcepub fn add_stylesheet(&self, owner: &Element, sheet: Arc<Stylesheet>)
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.
sourcepub fn load_web_fonts_from_stylesheet(&self, stylesheet: Arc<Stylesheet>)
pub fn load_web_fonts_from_stylesheet(&self, stylesheet: Arc<Stylesheet>)
Given a stylesheet, load all web fonts from it in Layout.
sourcepub fn remove_stylesheet(&self, owner: &Element, stylesheet: &Arc<Stylesheet>)
pub fn remove_stylesheet(&self, owner: &Element, stylesheet: &Arc<Stylesheet>)
Remove a stylesheet owned by owner
from the list of document sheets.
pub fn get_elements_with_id(&self, id: &Atom) -> Ref<'_, [Dom<Element>]>
pub fn get_elements_with_name(&self, name: &Atom) -> Ref<'_, [Dom<Element>]>
pub fn drain_pending_restyles( &self, ) -> Vec<(TrustedNodeAddress, PendingRestyle)>
pub(crate) fn advance_animation_timeline_for_testing(&self, delta: f64)
pub(crate) fn update_animation_timeline(&self)
pub(crate) fn maybe_mark_animating_nodes_as_dirty(&self)
pub(crate) fn current_animation_timeline_value(&self) -> f64
pub(crate) fn animations(&self) -> Ref<'_, Animations>
pub(crate) fn update_animations_post_reflow(&self)
pub(crate) fn cancel_animations_for_node(&self, node: &Node)
pub(crate) fn will_declaratively_refresh(&self) -> bool
pub(crate) fn set_declarative_refresh(&self, refresh: DeclarativeRefresh)
sourcefn update_visibility_state(
&self,
visibility_state: DocumentVisibilityState,
can_gc: CanGc,
)
fn update_visibility_state( &self, visibility_state: DocumentVisibilityState, can_gc: CanGc, )
Trait Implementations§
source§impl Castable for Document
impl Castable for Document
source§impl DocumentMethods for Document
impl DocumentMethods for Document
source§fn NamedGetter(&self, name: DOMString) -> Option<NamedPropertyValue>
fn NamedGetter(&self, name: DOMString) -> Option<NamedPropertyValue>
source§fn VisibilityState(&self) -> DocumentVisibilityState
fn VisibilityState(&self) -> DocumentVisibilityState
fn Constructor( window: &Window, proto: Option<HandleObject<'_>>, can_gc: CanGc, ) -> Result<Root<Dom<Document>>, Error>
fn QueryCommandSupported(&self, _command: DOMString) -> bool
fn StyleSheets(&self) -> Root<Dom<StyleSheetList>>
fn Implementation(&self) -> Root<Dom<DOMImplementation>>
fn URL(&self) -> USVString
fn GetActiveElement(&self) -> Option<Root<Dom<Element>>>
fn HasFocus(&self) -> bool
fn Domain(&self) -> DOMString
fn SetDomain(&self, value: DOMString) -> Result<(), Error>
fn Referrer(&self) -> DOMString
fn DocumentURI(&self) -> USVString
fn CompatMode(&self) -> DOMString
fn CharacterSet(&self) -> DOMString
fn Charset(&self) -> DOMString
fn InputEncoding(&self) -> DOMString
fn ContentType(&self) -> DOMString
fn GetDoctype(&self) -> Option<Root<Dom<DocumentType>>>
fn GetDocumentElement(&self) -> Option<Root<Dom<Element>>>
fn GetElementsByTagName( &self, qualified_name: DOMString, ) -> Root<Dom<HTMLCollection>>
fn GetElementsByTagNameNS( &self, maybe_ns: Option<DOMString>, tag_name: DOMString, ) -> Root<Dom<HTMLCollection>>
fn GetElementsByClassName( &self, classes: DOMString, ) -> Root<Dom<HTMLCollection>>
fn GetElementById(&self, id: DOMString) -> Option<Root<Dom<Element>>>
fn CreateElement( &self, local_name: DOMString, options: StringOrElementCreationOptions, can_gc: CanGc, ) -> Result<Root<Dom<Element>>, Error>
fn CreateElementNS( &self, namespace: Option<DOMString>, qualified_name: DOMString, options: StringOrElementCreationOptions, can_gc: CanGc, ) -> Result<Root<Dom<Element>>, Error>
fn CreateAttribute( &self, local_name: DOMString, can_gc: CanGc, ) -> Result<Root<Dom<Attr>>, Error>
fn CreateAttributeNS( &self, namespace: Option<DOMString>, qualified_name: DOMString, can_gc: CanGc, ) -> Result<Root<Dom<Attr>>, Error>
fn CreateDocumentFragment(&self, can_gc: CanGc) -> Root<Dom<DocumentFragment>>
fn CreateTextNode(&self, data: DOMString, can_gc: CanGc) -> Root<Dom<Text>>
fn CreateCDATASection( &self, data: DOMString, can_gc: CanGc, ) -> Result<Root<Dom<CDATASection>>, Error>
fn CreateComment(&self, data: DOMString, can_gc: CanGc) -> Root<Dom<Comment>>
fn CreateProcessingInstruction( &self, target: DOMString, data: DOMString, can_gc: CanGc, ) -> Result<Root<Dom<ProcessingInstruction>>, Error>
fn ImportNode( &self, node: &Node, deep: bool, can_gc: CanGc, ) -> Result<Root<Dom<Node>>, Error>
fn AdoptNode(&self, node: &Node) -> Result<Root<Dom<Node>>, Error>
fn CreateEvent( &self, interface: DOMString, can_gc: CanGc, ) -> Result<Root<Dom<Event>>, Error>
fn LastModified(&self) -> DOMString
fn CreateRange(&self, can_gc: CanGc) -> Root<Dom<Range>>
fn CreateNodeIterator( &self, root: &Node, what_to_show: u32, filter: Option<Rc<NodeFilter>>, ) -> Root<Dom<NodeIterator>>
fn CreateTreeWalker( &self, root: &Node, what_to_show: u32, filter: Option<Rc<NodeFilter>>, ) -> Root<Dom<TreeWalker>>
fn Title(&self) -> DOMString
fn SetTitle(&self, title: DOMString, can_gc: CanGc)
fn GetHead(&self) -> Option<Root<Dom<HTMLHeadElement>>>
fn GetCurrentScript(&self) -> Option<Root<Dom<HTMLScriptElement>>>
fn GetBody(&self) -> Option<Root<Dom<HTMLElement>>>
fn SetBody(&self, new_body: Option<&HTMLElement>) -> Result<(), Error>
fn GetElementsByName(&self, name: DOMString) -> Root<Dom<NodeList>>
fn Images(&self) -> Root<Dom<HTMLCollection>>
fn Embeds(&self) -> Root<Dom<HTMLCollection>>
fn Plugins(&self) -> Root<Dom<HTMLCollection>>
fn Links(&self) -> Root<Dom<HTMLCollection>>
fn Forms(&self) -> Root<Dom<HTMLCollection>>
fn Scripts(&self) -> Root<Dom<HTMLCollection>>
fn Anchors(&self) -> Root<Dom<HTMLCollection>>
fn Applets(&self) -> Root<Dom<HTMLCollection>>
fn GetLocation(&self) -> Option<Root<Dom<Location>>>
fn Children(&self) -> Root<Dom<HTMLCollection>>
fn GetFirstElementChild(&self) -> Option<Root<Dom<Element>>>
fn GetLastElementChild(&self) -> Option<Root<Dom<Element>>>
fn ChildElementCount(&self) -> u32
fn Prepend(&self, nodes: Vec<NodeOrString>, can_gc: CanGc) -> Result<(), Error>
fn Append(&self, nodes: Vec<NodeOrString>, can_gc: CanGc) -> Result<(), Error>
fn ReplaceChildren( &self, nodes: Vec<NodeOrString>, can_gc: CanGc, ) -> Result<(), Error>
fn QuerySelector( &self, selectors: DOMString, ) -> Result<Option<Root<Dom<Element>>>, Error>
fn QuerySelectorAll( &self, selectors: DOMString, ) -> Result<Root<Dom<NodeList>>, Error>
fn ReadyState(&self) -> DocumentReadyState
fn GetDefaultView(&self) -> Option<Root<Dom<Window>>>
fn GetCookie(&self) -> Result<DOMString, Error>
fn SetCookie(&self, cookie: DOMString) -> Result<(), Error>
fn BgColor(&self) -> DOMString
fn SetBgColor(&self, value: DOMString, can_gc: CanGc)
fn FgColor(&self) -> DOMString
fn SetFgColor(&self, value: DOMString, can_gc: CanGc)
fn SupportedPropertyNames(&self) -> Vec<DOMString>
fn Clear(&self)
fn CaptureEvents(&self)
fn ReleaseEvents(&self)
fn GetOnblur(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnblur(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnerror(&self) -> Option<Rc<OnErrorEventHandlerNonNull>>
fn SetOnerror(&self, listener: Option<Rc<OnErrorEventHandlerNonNull>>)
fn GetOnfocus(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnfocus(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnload(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnload(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnresize(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnresize(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnscroll(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnscroll(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnabort(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnabort(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnanimationend(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnanimationend(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnanimationiteration(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnanimationiteration(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOncancel(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOncancel(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOncanplay(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOncanplay(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOncanplaythrough(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOncanplaythrough(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnchange(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnchange(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnclick(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnclick(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnclose(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnclose(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOncuechange(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOncuechange(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOndblclick(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOndblclick(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOndrag(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOndrag(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOndragend(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOndragend(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOndragenter(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOndragenter(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOndragexit(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOndragexit(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOndragleave(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOndragleave(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOndragover(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOndragover(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOndragstart(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOndragstart(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOndrop(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOndrop(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOndurationchange(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOndurationchange(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnemptied(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnemptied(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnended(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnended(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnformdata(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnformdata(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOninput(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOninput(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOninvalid(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOninvalid(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnkeydown(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnkeydown(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnkeypress(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnkeypress(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnkeyup(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnkeyup(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnloadeddata(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnloadeddata(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnloadedmetadata(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnloadedmetadata(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnloadstart(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnloadstart(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnmousedown(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnmousedown(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnmouseenter(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnmouseenter(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnmouseleave(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnmouseleave(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnmousemove(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnmousemove(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnmouseout(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnmouseout(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnmouseover(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnmouseover(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnmouseup(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnmouseup(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnwheel(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnwheel(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnpause(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnpause(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnplay(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnplay(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnplaying(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnplaying(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnprogress(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnprogress(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnratechange(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnratechange(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnreset(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnreset(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnsecuritypolicyviolation(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnsecuritypolicyviolation( &self, listener: Option<Rc<EventHandlerNonNull>>, )
fn GetOnseeked(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnseeked(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnseeking(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnseeking(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnselect(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnselect(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnselectionchange(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnselectionchange(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnselectstart(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnselectstart(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnshow(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnshow(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnstalled(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnstalled(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnsubmit(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnsubmit(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnsuspend(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnsuspend(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOntimeupdate(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOntimeupdate(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOntoggle(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOntoggle(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOntransitioncancel(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOntransitioncancel(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOntransitionend(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOntransitionend(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOntransitionrun(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOntransitionrun(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnvolumechange(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnvolumechange(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnwaiting(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnwaiting(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnreadystatechange(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnreadystatechange(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn ElementFromPoint( &self, x: Finite<f64>, y: Finite<f64>, can_gc: CanGc, ) -> Option<Root<Dom<Element>>>
fn ElementsFromPoint( &self, x: Finite<f64>, y: Finite<f64>, can_gc: CanGc, ) -> Vec<Root<Dom<Element>>>
fn Open( &self, _unused1: Option<DOMString>, _unused2: Option<DOMString>, can_gc: CanGc, ) -> Result<Root<Dom<Document>>, Error>
fn Open_( &self, url: USVString, target: DOMString, features: DOMString, can_gc: CanGc, ) -> Result<Option<Root<Dom<WindowProxy>>>, Error>
fn Write(&self, text: Vec<DOMString>, can_gc: CanGc) -> Result<(), Error>
fn Writeln(&self, text: Vec<DOMString>, can_gc: CanGc) -> Result<(), Error>
fn Close(&self, can_gc: CanGc) -> Result<(), Error>
fn GetOncut(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOncut(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOncopy(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOncopy(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnpaste(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnpaste(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnfullscreenerror(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnfullscreenerror(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnfullscreenchange(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnfullscreenchange(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn FullscreenEnabled(&self) -> bool
fn Fullscreen(&self) -> bool
fn GetFullscreenElement(&self) -> Option<Root<Dom<Element>>>
fn ExitFullscreen(&self, can_gc: CanGc) -> Rc<Promise>
fn ServoGetMediaControls( &self, id: DOMString, ) -> Result<Root<Dom<ShadowRoot>>, Error>
fn GetSelection(&self) -> Option<Root<Dom<Selection>>>
fn Fonts(&self, can_gc: CanGc) -> Root<Dom<FontFaceSet>>
source§impl DomObjectWrap for Document
impl DomObjectWrap for Document
source§const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> 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>, script_runtime::CanGc) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::document::Document>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> 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>, script_runtime::CanGc) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::document::Document>>}
source§impl IDLInterface for Document
impl IDLInterface for Document
source§impl MallocSizeOf for Document
impl MallocSizeOf for Document
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl MutDomObject for Document
impl MutDomObject for Document
source§impl PartialEq for Document
impl PartialEq for Document
source§impl ProfilerMetadataFactory for Document
impl ProfilerMetadataFactory for Document
fn new_metadata(&self) -> Option<TimerMetadata>
source§impl ToJSValConvertible for Document
impl ToJSValConvertible for Document
impl DerivedFrom<Document> for Document
impl DerivedFrom<Document> for XMLDocument
impl DerivedFrom<EventTarget> for Document
impl DerivedFrom<Node> for Document
impl Eq for Document
Auto Trait Implementations§
impl !Freeze for Document
impl !RefUnwindSafe for Document
impl !Send for Document
impl !Sync for Document
impl Unpin for Document
impl !UnwindSafe for Document
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
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