#[repr(C)]pub(crate) struct Document {Show 111 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>,
event_handler: DocumentEventHandler,
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>,
iframes: RefCell<IFrameCollection>,
style_shared_lock: SharedRwLock,
stylesheets: DomRefCell<DocumentStylesheetSet<ServoStylesheetInDocument>>,
stylesheet_list: MutNullableDom<StyleSheetList>,
ready_state: Cell<DocumentReadyState>,
domcontentloaded_dispatched: Cell<bool>,
focus_transaction: DomRefCell<Option<FocusTransaction>>,
focused: MutNullableDom<Element>,
focus_sequence: Cell<FocusSequenceNumber>,
has_focus: Cell<bool>,
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<VecDeque<(u32, Option<AnimationFrameCallback>)>>,
running_animation_callbacks: Cell<bool>,
loader: DomRefCell<DocumentLoader>,
current_parser: MutNullableDom<ServoParser>,
base_element: MutNullableDom<HTMLBaseElement>,
appropriate_template_contents_owner_document: MutNullableDom<Document>,
pending_restyles: DomRefCell<FnvHashMap<Dom<Element>, NoTrace<PendingRestyle>>>,
needs_restyle: Cell<RestyleReason>,
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>,
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<ProgressiveWebMetrics>,
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 NonSendTaskBox>>>,
completely_loaded: Cell<bool>,
shadow_roots: DomRefCell<HashSet<Dom<ShadowRoot>>>,
shadow_roots_styles_changed: Cell<bool>,
media_controls: DomRefCell<HashMap<String, Dom<ShadowRoot>>>,
dirty_2d_contexts: DomRefCell<HashMapTracedValues<CanvasId, Dom<CanvasRenderingContext2D>>>,
dirty_webgl_contexts: DomRefCell<HashMapTracedValues<WebGLContextId, Dom<WebGLRenderingContext>>>,
webgpu_contexts: Rc<RefCell<HashMapTracedValues<WebGPUContextId, WeakRef<GPUCanvasContext>>>>,
selection: MutNullableDom<Selection>,
animation_timeline: DomRefCell<AnimationTimeline>,
animations: DomRefCell<Animations>,
image_animation_manager: DomRefCell<ImageAnimationManager>,
dirty_root: MutNullableDom<Element>,
declarative_refresh: DomRefCell<Option<DeclarativeRefresh>>,
resize_observers: DomRefCell<Vec<Dom<ResizeObserver>>>,
fonts: MutNullableDom<FontFaceSet>,
visibility_state: Cell<DocumentVisibilityState>,
status_code: Option<u16>,
is_initial_about_blank: Cell<bool>,
allow_declarative_shadow_roots: Cell<bool>,
inherited_insecure_requests_policy: Cell<Option<InsecureRequestsPolicy>>,
has_trustworthy_ancestor_origin: Cell<bool>,
intersection_observer_task_queued: Cell<bool>,
intersection_observers: DomRefCell<Vec<Dom<IntersectionObserver>>>,
highlighted_dom_node: MutNullableDom<Node>,
adopted_stylesheets: DomRefCell<Vec<Dom<CSSStyleSheet>>>,
adopted_stylesheets_frozen_types: CachedFrozenArray,
pending_scroll_event_targets: DomRefCell<Vec<Dom<EventTarget>>>,
resize_observer_started_observing_target: Cell<bool>,
}
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>
§event_handler: DocumentEventHandler
A helper used to process and store data related to input event handling.
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>
§iframes: RefCell<IFrameCollection>
Information about the <iframes>
in this Document
.
Lock use for style attributes and author-origin stylesheet objects in this document. Can be acquired once for accessing many objects.
stylesheets: DomRefCell<DocumentStylesheetSet<ServoStylesheetInDocument>>
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<Option<FocusTransaction>>
The state of this document’s focus transaction.
focused: MutNullableDom<Element>
The element that currently has the document focus context.
focus_sequence: Cell<FocusSequenceNumber>
The last sequence number sent to the constellation.
has_focus: Cell<bool>
Indicates whether the container is included in the top-level browsing
context’s focus chain (not considering system focus). Permanently true
for a top-level document.
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<VecDeque<(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.
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<FnvHashMap<Dom<Element>, NoTrace<PendingRestyle>>>
Information on elements needing restyle to ship over to layout when the time comes.
needs_restyle: Cell<RestyleReason>
A collection of reasons that the Document
needs to be restyled at the next
opportunity for a reflow. If this is empty, then the Document
does not need to
be restyled.
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>
§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<ProgressiveWebMetrics>
§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 NonSendTaskBox>>>
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_2d_contexts: DomRefCell<HashMapTracedValues<CanvasId, Dom<CanvasRenderingContext2D>>>
List of all context 2d IDs that need flushing.
dirty_webgl_contexts: DomRefCell<HashMapTracedValues<WebGLContextId, Dom<WebGLRenderingContext>>>
List of all WebGL context IDs that need flushing.
webgpu_contexts: Rc<RefCell<HashMapTracedValues<WebGPUContextId, WeakRef<GPUCanvasContext>>>>
List of all WebGPU contexts.
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
image_animation_manager: DomRefCell<ImageAnimationManager>
Image Animation Manager for this Document
dirty_root: MutNullableDom<Element>
The nearest inclusive ancestors to all the nodes that require a restyle.
declarative_refresh: DomRefCell<Option<DeclarativeRefresh>>
§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>
§is_initial_about_blank: Cell<bool>
§allow_declarative_shadow_roots: Cell<bool>
§inherited_insecure_requests_policy: Cell<Option<InsecureRequestsPolicy>>
§has_trustworthy_ancestor_origin: Cell<bool>
§intersection_observer_task_queued: Cell<bool>
§intersection_observers: DomRefCell<Vec<Dom<IntersectionObserver>>>
Active intersection observers that should be processed by this document in the update intersection observation steps. https://w3c.github.io/IntersectionObserver/#run-the-update-intersection-observations-steps
Let observer list be a list of all IntersectionObservers whose root is in the DOM tree of document. For the top-level browsing context, this includes implicit root observers.
Details of which document that should process an observers is discussed further at https://github.com/w3c/IntersectionObserver/issues/525.
The lifetime of an intersection observer is specified at https://github.com/w3c/IntersectionObserver/issues/525.
highlighted_dom_node: MutNullableDom<Node>
The node that is currently highlighted by the devtools
adopted_stylesheets: DomRefCell<Vec<Dom<CSSStyleSheet>>>
The constructed stylesheet that is adopted by this Document. https://drafts.csswg.org/cssom/#dom-documentorshadowroot-adoptedstylesheets
adopted_stylesheets_frozen_types: CachedFrozenArray
Cached frozen array of Self::adopted_stylesheets
pending_scroll_event_targets: DomRefCell<Vec<Dom<EventTarget>>>
§resize_observer_started_observing_target: Cell<bool>
When a ResizeObserver
starts observing a target, this becomes true, which in turn is a
signal to the ScriptThread
that a rendering update should happen.
Implementations§
Source§impl Document
impl Document
fn __assert_parent_type(&self)
Source§impl Document
impl Document
pub(crate) fn note_node_with_dirty_descendants(&self, node: &Node)
pub(crate) fn take_dirty_root(&self) -> Option<DomRoot<Element>>
pub(crate) fn loader(&self) -> Ref<'_, DocumentLoader>
pub(crate) fn loader_mut(&self) -> RefMut<'_, DocumentLoader>
pub(crate) fn has_browsing_context(&self) -> bool
Sourcepub(crate) fn browsing_context(&self) -> Option<DomRoot<WindowProxy>>
pub(crate) fn browsing_context(&self) -> Option<DomRoot<WindowProxy>>
pub(crate) fn webview_id(&self) -> WebViewId
pub(crate) fn window(&self) -> &Window
pub(crate) fn is_html_document(&self) -> bool
pub(crate) fn is_xhtml_document(&self) -> bool
pub(crate) fn set_https_state(&self, https_state: HttpsState)
pub(crate) fn is_fully_active(&self) -> bool
pub(crate) fn is_active(&self) -> bool
pub(crate) fn set_activity(&self, activity: DocumentActivity, can_gc: CanGc)
pub(crate) fn origin(&self) -> &MutableOrigin
pub(crate) fn set_url(&self, url: ServoUrl)
Sourcepub(crate) fn fallback_base_url(&self) -> ServoUrl
pub(crate) fn fallback_base_url(&self) -> ServoUrl
pub(crate) fn add_restyle_reason(&self, reason: RestyleReason)
pub(crate) fn clear_restyle_reasons(&self)
pub(crate) fn restyle_reason(&self) -> RestyleReason
Sourcepub(crate) fn base_element(&self) -> Option<DomRoot<HTMLBaseElement>>
pub(crate) fn base_element(&self) -> Option<DomRoot<HTMLBaseElement>>
Returns the first base
element in the DOM that has an href
attribute.
Sourcepub(crate) fn refresh_base_element(&self)
pub(crate) fn refresh_base_element(&self)
Refresh the cached first base element in the DOM. https://github.com/w3c/web-platform-tests/issues/2122
pub(crate) fn dom_count(&self) -> u32
Sourcepub(crate) fn increment_dom_count(&self)
pub(crate) 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(crate) fn decrement_dom_count(&self)
pub(crate) fn decrement_dom_count(&self)
This is called by unbind_from_tree
when a node is removed from the DOM.
pub(crate) fn quirks_mode(&self) -> QuirksMode
pub(crate) fn set_quirks_mode(&self, new_mode: QuirksMode)
pub(crate) fn encoding(&self) -> &'static Encoding
pub(crate) fn set_encoding(&self, encoding: &'static Encoding)
pub(crate) fn content_and_heritage_changed(&self, node: &Node)
Sourcepub(crate) fn unregister_element_id(
&self,
to_unregister: &Element,
id: Atom,
can_gc: CanGc,
)
pub(crate) fn unregister_element_id( &self, to_unregister: &Element, id: Atom, can_gc: CanGc, )
Remove any existing association between the provided id and any elements in this document.
Sourcepub(crate) fn register_element_id(
&self,
element: &Element,
id: Atom,
can_gc: CanGc,
)
pub(crate) fn register_element_id( &self, element: &Element, id: Atom, can_gc: CanGc, )
Associate an element present in this document with the provided id.
Sourcepub(crate) fn unregister_element_name(
&self,
to_unregister: &Element,
name: Atom,
)
pub(crate) 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(crate) fn register_element_name(&self, element: &Element, name: Atom)
pub(crate) fn register_element_name(&self, element: &Element, name: Atom)
Associate an element present in this document with the provided name.
pub(crate) fn register_form_id_listener<T: ?Sized + FormControl>( &self, id: DOMString, listener: &T, )
pub(crate) fn unregister_form_id_listener<T: ?Sized + FormControl>( &self, id: DOMString, listener: &T, )
Sourcepub(crate) fn find_fragment_node(
&self,
fragid: &str,
) -> Option<DomRoot<Element>>
pub(crate) fn find_fragment_node( &self, fragid: &str, ) -> Option<DomRoot<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(crate) fn check_and_scroll_fragment(&self, fragment: &str)
pub(crate) 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
fn get_anchor_by_name(&self, name: &str) -> Option<DomRoot<Element>>
pub(crate) fn set_ready_state(&self, state: DocumentReadyState, can_gc: CanGc)
Sourcepub(crate) fn is_scripting_enabled(&self) -> bool
pub(crate) fn is_scripting_enabled(&self) -> bool
Return whether scripting is enabled or not
Sourcepub(crate) fn scripting_enabled(&self) -> bool
pub(crate) fn scripting_enabled(&self) -> bool
Return whether scripting is enabled or not https://html.spec.whatwg.org/multipage/#concept-n-noscript
Sourcepub(crate) fn get_focused_element(&self) -> Option<DomRoot<Element>>
pub(crate) fn get_focused_element(&self) -> Option<DomRoot<Element>>
Return the element that currently has focus.
Sourcepub fn get_focus_sequence(&self) -> FocusSequenceNumber
pub fn get_focus_sequence(&self) -> FocusSequenceNumber
Get the last sequence number sent to the constellation.
Received focus-related messages with sequence numbers less than the one returned by this method must be discarded.
Sourcefn increment_fetch_focus_sequence(&self) -> FocusSequenceNumber
fn increment_fetch_focus_sequence(&self) -> FocusSequenceNumber
Generate the next sequence number for focus-related messages.
pub(crate) fn has_focus_transaction(&self) -> bool
Sourcepub(crate) fn begin_focus_transaction(&self)
pub(crate) 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_initiator: FocusInitiator,
can_gc: CanGc,
)
pub(crate) fn request_focus( &self, elem: Option<&Element>, focus_initiator: FocusInitiator, can_gc: CanGc, )
Request that the given element receive focus with default options.
See Self::request_focus_with_options
for the details.
Sourcepub(crate) fn request_focus_with_options(
&self,
elem: Option<&Element>,
focus_initiator: FocusInitiator,
focus_options: FocusOptions,
can_gc: CanGc,
)
pub(crate) fn request_focus_with_options( &self, elem: Option<&Element>, focus_initiator: FocusInitiator, focus_options: FocusOptions, can_gc: CanGc, )
Request that the given element receive focus once the current
transaction is complete. None
specifies to focus the document.
If there’s no ongoing transaction, this method automatically starts and commits an implicit transaction.
Sourcepub(crate) fn handle_container_unfocus(&self, can_gc: CanGc)
pub(crate) fn handle_container_unfocus(&self, can_gc: CanGc)
Update the local focus state accordingly after being notified that the document’s container is removed from the top-level browsing context’s focus chain (not considering system focus).
Sourcepub(crate) fn commit_focus_transaction(
&self,
focus_initiator: FocusInitiator,
can_gc: CanGc,
)
pub(crate) fn commit_focus_transaction( &self, focus_initiator: FocusInitiator, can_gc: CanGc, )
Reassign the focus context to the element that last requested focus during this transaction, or the document if no elements requested it.
Sourcepub(crate) fn title_changed(&self)
pub(crate) 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(crate) fn send_title_to_embedder(&self)
pub(crate) fn send_title_to_embedder(&self)
Sends this document’s title to the constellation.
pub(crate) fn send_to_embedder(&self, msg: EmbedderMsg)
pub(crate) fn dirty_all_nodes(&self)
Sourcepub(crate) fn run_the_scroll_steps(&self, can_gc: CanGc)
pub(crate) fn run_the_scroll_steps(&self, can_gc: CanGc)
Sourcepub(crate) fn handle_viewport_scroll_event(&self)
pub(crate) fn handle_viewport_scroll_event(&self)
Whenever a viewport gets scrolled (whether in response to user interaction or by an API), the user agent must run these steps: https://drafts.csswg.org/cssom-view/#scrolling-events
Sourcepub(crate) fn handle_element_scroll_event(&self, element: &Element)
pub(crate) fn handle_element_scroll_event(&self, element: &Element)
Whenever an element gets scrolled (whether in response to user interaction or by an API), the user agent must run these steps: https://drafts.csswg.org/cssom-view/#scrolling-events
pub(crate) fn node_from_nodes_and_strings( &self, nodes: Vec<NodeOrString<DomTypeHolder>>, can_gc: CanGc, ) -> Fallible<DomRoot<Node>>
pub(crate) fn get_body_attribute(&self, local_name: &LocalName) -> DOMString
pub(crate) fn set_body_attribute( &self, local_name: &LocalName, value: DOMString, can_gc: CanGc, )
pub(crate) fn set_current_script(&self, script: Option<&HTMLScriptElement>)
pub(crate) fn get_script_blocking_stylesheets_count(&self) -> u32
pub(crate) fn increment_script_blocking_stylesheet_count(&self)
pub(crate) fn decrement_script_blocking_stylesheet_count(&self)
pub(crate) fn invalidate_stylesheets(&self)
Sourcepub(crate) fn has_active_request_animation_frame_callbacks(&self) -> bool
pub(crate) fn has_active_request_animation_frame_callbacks(&self) -> bool
Whether or not this Document
has any active requestAnimationFrame callbacks
registered.
Sourcepub(crate) fn request_animation_frame(
&self,
callback: AnimationFrameCallback,
) -> u32
pub(crate) fn request_animation_frame( &self, callback: AnimationFrameCallback, ) -> u32
Sourcepub(crate) fn cancel_animation_frame(&self, ident: u32)
pub(crate) fn cancel_animation_frame(&self, ident: u32)
Sourcepub(crate) fn run_the_animation_frame_callbacks(&self, can_gc: CanGc)
pub(crate) fn run_the_animation_frame_callbacks(&self, can_gc: CanGc)
pub(crate) 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, )
pub(crate) fn finish_load(&self, load: LoadType, can_gc: CanGc)
pub(crate) fn prompt_to_unload( &self, recursive_flag: bool, can_gc: CanGc, ) -> bool
pub(crate) fn unload(&self, recursive_flag: bool, can_gc: CanGc)
pub(crate) fn maybe_queue_document_completion(&self)
pub(crate) fn completely_loaded(&self) -> bool
pub(crate) fn set_pending_parsing_blocking_script( &self, script: &HTMLScriptElement, load: Option<Result<ScriptOrigin, NoTrace<NetworkError>>>, )
pub(crate) fn has_pending_parsing_blocking_script(&self) -> bool
Sourcepub(crate) fn pending_parsing_blocking_script_loaded(
&self,
element: &HTMLScriptElement,
result: Result<ScriptOrigin, NoTrace<NetworkError>>,
can_gc: CanGc,
)
pub(crate) 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(crate) fn add_asap_script(&self, script: &HTMLScriptElement)
Sourcepub(crate) fn asap_script_loaded(
&self,
element: &HTMLScriptElement,
result: Result<ScriptOrigin, NoTrace<NetworkError>>,
can_gc: CanGc,
)
pub(crate) fn asap_script_loaded( &self, element: &HTMLScriptElement, result: Result<ScriptOrigin, NoTrace<NetworkError>>, can_gc: CanGc, )
pub(crate) fn push_asap_in_order_script(&self, script: &HTMLScriptElement)
Sourcepub(crate) fn asap_in_order_script_loaded(
&self,
element: &HTMLScriptElement,
result: Result<ScriptOrigin, NoTrace<NetworkError>>,
can_gc: CanGc,
)
pub(crate) fn asap_in_order_script_loaded( &self, element: &HTMLScriptElement, result: Result<ScriptOrigin, NoTrace<NetworkError>>, can_gc: CanGc, )
pub(crate) fn add_deferred_script(&self, script: &HTMLScriptElement)
Sourcepub(crate) fn deferred_script_loaded(
&self,
element: &HTMLScriptElement,
result: Result<ScriptOrigin, NoTrace<NetworkError>>,
can_gc: CanGc,
)
pub(crate) fn deferred_script_loaded( &self, element: &HTMLScriptElement, result: Result<ScriptOrigin, NoTrace<NetworkError>>, can_gc: CanGc, )
Sourcefn process_deferred_scripts(&self, can_gc: CanGc)
fn process_deferred_scripts(&self, can_gc: CanGc)
pub(crate) fn maybe_dispatch_dom_content_loaded(&self)
pub(crate) fn abort(&self, can_gc: CanGc)
pub(crate) fn notify_constellation_load(&self)
pub(crate) fn set_current_parser(&self, script: Option<&ServoParser>)
pub(crate) fn get_current_parser(&self) -> Option<DomRoot<ServoParser>>
Sourcepub(crate) fn iframes(&self) -> Ref<'_, IFrameCollection>
pub(crate) fn iframes(&self) -> Ref<'_, IFrameCollection>
A reference to the IFrameCollection
of this Document
, holding information about
<iframe>
s found within it.
Sourcepub(crate) fn iframes_mut(&self) -> RefMut<'_, IFrameCollection>
pub(crate) fn iframes_mut(&self) -> RefMut<'_, IFrameCollection>
A mutable reference to the IFrameCollection
of this Document
, holding information about
<iframe>
s found within it.
pub(crate) fn invalidate_iframes_collection(&self)
pub(crate) fn get_dom_interactive(&self) -> Option<CrossProcessInstant>
pub(crate) fn get_interactive_metrics(&self) -> Ref<'_, ProgressiveWebMetrics>
pub(crate) fn has_recorded_tti_metric(&self) -> bool
pub(crate) fn get_dom_content_loaded_event_start( &self, ) -> Option<CrossProcessInstant>
pub(crate) fn get_dom_content_loaded_event_end( &self, ) -> Option<CrossProcessInstant>
pub(crate) fn get_dom_complete(&self) -> Option<CrossProcessInstant>
pub(crate) fn get_top_level_dom_complete(&self) -> Option<CrossProcessInstant>
pub(crate) fn get_load_event_start(&self) -> Option<CrossProcessInstant>
pub(crate) fn get_load_event_end(&self) -> Option<CrossProcessInstant>
pub(crate) fn get_unload_event_start(&self) -> Option<CrossProcessInstant>
pub(crate) fn get_unload_event_end(&self) -> Option<CrossProcessInstant>
pub(crate) fn start_tti(&self)
Sourcepub(crate) fn record_tti_if_necessary(&self)
pub(crate) 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, event_target: &EventTarget, related_target: Option<&EventTarget>, can_gc: CanGc, )
Sourcepub(crate) fn lookup_custom_element_definition(
&self,
namespace: &Namespace,
local_name: &LocalName,
is: Option<&LocalName>,
) -> Option<Rc<CustomElementDefinition>>
pub(crate) fn lookup_custom_element_definition( &self, namespace: &Namespace, local_name: &LocalName, is: Option<&LocalName>, ) -> Option<Rc<CustomElementDefinition>>
pub(crate) fn increment_throw_on_dynamic_markup_insertion_counter(&self)
pub(crate) fn decrement_throw_on_dynamic_markup_insertion_counter(&self)
pub(crate) fn react_to_environment_changes(&self)
pub(crate) fn register_responsive_image(&self, img: &HTMLImageElement)
pub(crate) fn unregister_responsive_image(&self, img: &HTMLImageElement)
pub(crate) fn register_media_controls(&self, controls: &ShadowRoot) -> String
pub(crate) fn unregister_media_controls(&self, id: &str, can_gc: CanGc)
pub(crate) fn add_dirty_webgl_canvas(&self, context: &WebGLRenderingContext)
pub(crate) fn add_dirty_2d_canvas(&self, context: &CanvasRenderingContext2D)
pub(crate) fn webgpu_contexts( &self, ) -> Rc<RefCell<HashMapTracedValues<WebGPUContextId, WeakRef<GPUCanvasContext>>>>
Sourcepub(crate) fn needs_rendering_update(&self) -> bool
pub(crate) fn needs_rendering_update(&self) -> bool
Whether or not this Document
needs a rendering update, due to changed
contents or pending events. This is used to decide whether or not to schedule
a call to the “update the rendering” algorithm.
Sourcepub(crate) fn update_the_rendering(&self) -> ReflowPhasesRun
pub(crate) fn update_the_rendering(&self) -> ReflowPhasesRun
An implementation of step 22 from https://html.spec.whatwg.org/multipage/#update-the-rendering:
Sourcepub(crate) fn maybe_fulfill_font_ready_promise(&self, can_gc: CanGc) -> bool
pub(crate) fn maybe_fulfill_font_ready_promise(&self, can_gc: CanGc) -> bool
A FontFaceSet is pending on the environment if any of the following are true:
- the document is still loading
- the document has pending stylesheet requests
- the document has pending layout operations which might cause the user agent to request a font, or which depend on recently-loaded fonts
Returns true if the promise was fulfilled.
pub(crate) fn id_map( &self, ) -> Ref<'_, HashMapTracedValues<Atom, Vec<Dom<Element>>>>
pub(crate) 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 has_resize_observers(&self) -> bool
pub(crate) fn has_resize_observers(&self) -> bool
Whether or not this Document
has any active ResizeObserver
.
Sourcepub(crate) fn gather_active_resize_observations_at_depth(
&self,
depth: &ResizeObservationDepth,
) -> bool
pub(crate) fn gather_active_resize_observations_at_depth( &self, depth: &ResizeObservationDepth, ) -> 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(crate) fn encoding_parse_a_url(
&self,
url: &str,
) -> Result<ServoUrl, ParseError>
pub(crate) fn encoding_parse_a_url( &self, url: &str, ) -> Result<ServoUrl, ParseError>
Sourcepub(crate) fn allowed_to_use_feature(&self, _feature: PermissionName) -> bool
pub(crate) fn allowed_to_use_feature(&self, _feature: PermissionName) -> bool
Sourcepub(crate) fn add_intersection_observer(
&self,
intersection_observer: &IntersectionObserver,
)
pub(crate) fn add_intersection_observer( &self, intersection_observer: &IntersectionObserver, )
Add an IntersectionObserver
to the Document
, to be processed in the Document
’s event loop.
https://github.com/w3c/IntersectionObserver/issues/525
Sourcepub(crate) fn remove_intersection_observer(
&self,
intersection_observer: &IntersectionObserver,
)
pub(crate) fn remove_intersection_observer( &self, intersection_observer: &IntersectionObserver, )
Remove an IntersectionObserver
from Document
, ommiting it from the event loop.
An observer without any target, ideally should be removed to be conformant with
https://w3c.github.io/IntersectionObserver/#lifetime.
Sourcepub(crate) fn update_intersection_observer_steps(
&self,
time: CrossProcessInstant,
can_gc: CanGc,
)
pub(crate) fn update_intersection_observer_steps( &self, time: CrossProcessInstant, can_gc: CanGc, )
Sourcefn update_single_intersection_observer_steps(
&self,
intersection_observer: &IntersectionObserver,
time: CrossProcessInstant,
can_gc: CanGc,
)
fn update_single_intersection_observer_steps( &self, intersection_observer: &IntersectionObserver, time: CrossProcessInstant, can_gc: CanGc, )
Sourcepub(crate) fn notify_intersection_observers(&self, can_gc: CanGc)
pub(crate) fn notify_intersection_observers(&self, can_gc: CanGc)
Sourcepub(crate) fn queue_an_intersection_observer_task(&self)
pub(crate) fn queue_an_intersection_observer_task(&self)
pub(crate) fn handle_paint_metric( &self, metric_type: ProgressiveWebMetricType, metric_value: CrossProcessInstant, first_reflow: bool, can_gc: CanGc, )
Sourcefn write(
&self,
text: Vec<TrustedHTMLOrString<DomTypeHolder>>,
line_feed: bool,
containing_class: &str,
field: &str,
can_gc: CanGc,
) -> ErrorResult
fn write( &self, text: Vec<TrustedHTMLOrString<DomTypeHolder>>, line_feed: bool, containing_class: &str, field: &str, can_gc: CanGc, ) -> ErrorResult
Source§impl Document
impl Document
pub(crate) 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, is_initial_about_blank: bool, allow_declarative_shadow_roots: bool, inherited_insecure_requests_policy: Option<InsecureRequestsPolicy>, has_trustworthy_ancestor_origin: bool, ) -> Document
Sourcepub(crate) fn insecure_requests_policy(&self) -> InsecureRequestsPolicy
pub(crate) fn insecure_requests_policy(&self) -> InsecureRequestsPolicy
Returns a policy value that should be used for fetches initiated by this document.
Sourcepub(crate) fn event_handler(&self) -> &DocumentEventHandler
pub(crate) fn event_handler(&self) -> &DocumentEventHandler
Get the Document
’s DocumentEventHandler
.
Sourcefn has_pending_scroll_events(&self) -> bool
fn has_pending_scroll_events(&self) -> bool
Whether or not this Document
has any pending scroll events to be processed during
“update the rendering.”
pub(crate) fn set_resize_observer_started_observing_target(&self, value: bool)
pub(crate) fn set_csp_list(&self, csp_list: Option<CspList>)
pub(crate) fn get_csp_list(&self) -> Option<CspList>
Sourcepub(crate) fn add_script_and_layout_blocker(&self)
pub(crate) 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(crate) fn remove_script_and_layout_blocker(&self)
pub(crate) 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(crate) fn add_delayed_task<T: 'static + NonSendTaskBox>(&self, task: T)
pub(crate) fn add_delayed_task<T: 'static + NonSendTaskBox>(&self, task: T)
Enqueue a task to run as soon as any JS and layout blockers are removed.
Sourcepub(crate) fn ensure_safe_to_run_script_or_layout(&self)
pub(crate) 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(crate) 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, is_initial_about_blank: bool, allow_declarative_shadow_roots: bool, inherited_insecure_requests_policy: Option<InsecureRequestsPolicy>, has_trustworthy_ancestor_origin: bool, can_gc: CanGc, ) -> DomRoot<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, is_initial_about_blank: bool, allow_declarative_shadow_roots: bool, inherited_insecure_requests_policy: Option<InsecureRequestsPolicy>, has_trustworthy_ancestor_origin: bool, can_gc: CanGc, ) -> DomRoot<Document>
pub(crate) fn get_redirect_count(&self) -> u16
pub(crate) fn set_redirect_count(&self, count: u16)
pub(crate) fn elements_by_name_count(&self, name: &DOMString) -> u32
pub(crate) fn nth_element_by_name( &self, index: u32, name: &DOMString, ) -> Option<DomRoot<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<DomRoot<Node>>
fn get_html_element(&self) -> Option<DomRoot<HTMLHtmlElement>>
Return a reference to the per-document shared lock used in stylesheets.
Sourcepub(crate) fn flush_stylesheets_for_reflow(&self) -> bool
pub(crate) fn flush_stylesheets_for_reflow(&self) -> bool
Flushes the stylesheet list, and returns whether any stylesheet changed.
pub(crate) fn salvageable(&self) -> bool
Sourcepub(crate) fn appropriate_template_contents_owner_document(
&self,
can_gc: CanGc,
) -> DomRoot<Document>
pub(crate) fn appropriate_template_contents_owner_document( &self, can_gc: CanGc, ) -> DomRoot<Document>
pub(crate) fn get_element_by_id(&self, id: &Atom) -> Option<DomRoot<Element>>
pub(crate) fn ensure_pending_restyle( &self, el: &Element, ) -> RefMut<'_, PendingRestyle>
pub(crate) fn element_state_will_change(&self, element: &Element)
pub(crate) fn element_attr_will_change(&self, el: &Element, attr: &Attr)
pub(crate) fn set_referrer_policy(&self, policy: ReferrerPolicy)
pub(crate) fn get_referrer_policy(&self) -> ReferrerPolicy
pub(crate) fn set_target_element(&self, node: Option<&Element>)
pub(crate) fn incr_ignore_destructive_writes_counter(&self)
pub(crate) fn decr_ignore_destructive_writes_counter(&self)
pub(crate) fn is_prompting_or_unloading(&self) -> bool
fn incr_ignore_opens_during_unload_counter(&self)
fn decr_ignore_opens_during_unload_counter(&self)
pub(crate) fn enter_fullscreen( &self, pending: &Element, can_gc: CanGc, ) -> Rc<Promise>
pub(crate) fn exit_fullscreen(&self, can_gc: CanGc) -> Rc<Promise>
pub(crate) fn set_fullscreen_element(&self, element: Option<&Element>)
pub(crate) fn get_allow_fullscreen(&self) -> bool
fn reset_form_owner_for_listeners(&self, id: &Atom, can_gc: CanGc)
pub(crate) fn register_shadow_root(&self, shadow_root: &ShadowRoot)
pub(crate) fn unregister_shadow_root(&self, shadow_root: &ShadowRoot)
pub(crate) fn invalidate_shadow_roots_stylesheets(&self)
pub(crate) fn shadow_roots_styles_changed(&self) -> bool
pub(crate) fn flush_shadow_roots_stylesheets(&self)
pub(crate) fn stylesheet_count(&self) -> usize
pub(crate) fn stylesheet_at( &self, index: usize, ) -> Option<DomRoot<CSSStyleSheet>>
Sourcepub(crate) fn add_owned_stylesheet(
&self,
owner_node: &Element,
sheet: Arc<Stylesheet>,
)
pub(crate) fn add_owned_stylesheet( &self, owner_node: &Element, sheet: Arc<Stylesheet>, )
Add a stylesheet owned by owner_node
to the list of document sheets, in the
correct tree position. Additionally, ensure that the owned stylesheet is inserted
before any constructed stylesheet.
https://drafts.csswg.org/cssom/#documentorshadowroot-final-css-style-sheets
Sourcepub(crate) fn append_constructed_stylesheet(
&self,
cssom_stylesheet: &CSSStyleSheet,
)
pub(crate) fn append_constructed_stylesheet( &self, cssom_stylesheet: &CSSStyleSheet, )
Append a constructed stylesheet to the back of document stylesheet set. Because it would be the last element, we therefore would not mess with the ordering.
https://drafts.csswg.org/cssom/#documentorshadowroot-final-css-style-sheets
Sourcepub(crate) fn load_web_fonts_from_stylesheet(&self, stylesheet: Arc<Stylesheet>)
pub(crate) fn load_web_fonts_from_stylesheet(&self, stylesheet: Arc<Stylesheet>)
Given a stylesheet, load all web fonts from it in Layout.
Sourcepub(crate) fn remove_stylesheet(
&self,
owner: StylesheetSource,
stylesheet: &Arc<Stylesheet>,
)
pub(crate) fn remove_stylesheet( &self, owner: StylesheetSource, stylesheet: &Arc<Stylesheet>, )
Remove a stylesheet owned by owner
from the list of document sheets.
pub(crate) fn get_elements_with_id(&self, id: &Atom) -> Ref<'_, [Dom<Element>]>
pub(crate) fn get_elements_with_name( &self, name: &Atom, ) -> Ref<'_, [Dom<Element>]>
pub(crate) fn drain_pending_restyles( &self, ) -> Vec<(TrustedNodeAddress, PendingRestyle)>
pub(crate) fn advance_animation_timeline_for_testing(&self, delta: f64)
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)
Sourcepub(crate) fn update_animations_and_send_events(&self, can_gc: CanGc)
pub(crate) fn update_animations_and_send_events(&self, can_gc: CanGc)
pub(crate) fn image_animation_manager(&self) -> Ref<'_, ImageAnimationManager>
pub(crate) fn update_animating_images(&self)
fn schedule_image_animation_update(&self, next_scheduled_time: f64)
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, )
Sourcepub(crate) fn is_initial_about_blank(&self) -> bool
pub(crate) fn is_initial_about_blank(&self) -> bool
Sourcepub(crate) fn allow_declarative_shadow_roots(&self) -> bool
pub(crate) fn allow_declarative_shadow_roots(&self) -> bool
pub(crate) fn has_trustworthy_ancestor_origin(&self) -> bool
pub(crate) fn has_trustworthy_ancestor_or_current_origin(&self) -> bool
pub(crate) fn highlight_dom_node(&self, node: Option<&Node>)
pub(crate) fn highlighted_dom_node(&self) -> Option<DomRoot<Node>>
Trait Implementations§
§impl Castable for Document
impl Castable for Document
Source§impl DocumentHelpers for Document
impl DocumentHelpers for Document
Source§impl DocumentMethods<DomTypeHolder> for Document
impl DocumentMethods<DomTypeHolder> for Document
Source§fn CreateElement(
&self,
local_name: DOMString,
options: StringOrElementCreationOptions,
can_gc: CanGc,
) -> Fallible<DomRoot<Element>>
fn CreateElement( &self, local_name: DOMString, options: StringOrElementCreationOptions, can_gc: CanGc, ) -> Fallible<DomRoot<Element>>
Source§fn CreateElementNS(
&self,
namespace: Option<DOMString>,
qualified_name: DOMString,
options: StringOrElementCreationOptions,
can_gc: CanGc,
) -> Fallible<DomRoot<Element>>
fn CreateElementNS( &self, namespace: Option<DOMString>, qualified_name: DOMString, options: StringOrElementCreationOptions, can_gc: CanGc, ) -> Fallible<DomRoot<Element>>
Source§fn CreateAttribute(
&self,
local_name: DOMString,
can_gc: CanGc,
) -> Fallible<DomRoot<Attr>>
fn CreateAttribute( &self, local_name: DOMString, can_gc: CanGc, ) -> Fallible<DomRoot<Attr>>
Source§fn NamedGetter(
&self,
name: DOMString,
can_gc: CanGc,
) -> Option<NamedPropertyValue<DomTypeHolder>>
fn NamedGetter( &self, name: DOMString, can_gc: CanGc, ) -> Option<NamedPropertyValue<DomTypeHolder>>
Source§fn VisibilityState(&self) -> DocumentVisibilityState
fn VisibilityState(&self) -> DocumentVisibilityState
Source§fn AdoptedStyleSheets(
&self,
context: JSContext,
can_gc: CanGc,
retval: MutableHandleValue<'_>,
)
fn AdoptedStyleSheets( &self, context: JSContext, can_gc: CanGc, retval: MutableHandleValue<'_>, )
Source§fn SetAdoptedStyleSheets(
&self,
context: JSContext,
val: HandleValue<'_>,
) -> ErrorResult
fn SetAdoptedStyleSheets( &self, context: JSContext, val: HandleValue<'_>, ) -> ErrorResult
fn Constructor( window: &Window, proto: Option<HandleObject<'_>>, can_gc: CanGc, ) -> Fallible<DomRoot<Document>>
fn QueryCommandSupported(&self, _command: DOMString) -> bool
fn StyleSheets(&self, can_gc: CanGc) -> DomRoot<StyleSheetList>
fn Implementation(&self, can_gc: CanGc) -> DomRoot<DOMImplementation>
fn URL(&self) -> USVString
fn GetActiveElement(&self) -> Option<DomRoot<Element>>
fn HasFocus(&self) -> bool
fn Domain(&self) -> DOMString
fn SetDomain(&self, value: DOMString) -> ErrorResult
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<DomRoot<DocumentType>>
fn GetDocumentElement(&self) -> Option<DomRoot<Element>>
fn GetElementsByTagName( &self, qualified_name: DOMString, can_gc: CanGc, ) -> DomRoot<HTMLCollection>
fn GetElementsByTagNameNS( &self, maybe_ns: Option<DOMString>, tag_name: DOMString, can_gc: CanGc, ) -> DomRoot<HTMLCollection>
fn GetElementsByClassName( &self, classes: DOMString, can_gc: CanGc, ) -> DomRoot<HTMLCollection>
fn GetElementById(&self, id: DOMString) -> Option<DomRoot<Element>>
fn CreateAttributeNS( &self, namespace: Option<DOMString>, qualified_name: DOMString, can_gc: CanGc, ) -> Fallible<DomRoot<Attr>>
fn CreateDocumentFragment(&self, can_gc: CanGc) -> DomRoot<DocumentFragment>
fn CreateTextNode(&self, data: DOMString, can_gc: CanGc) -> DomRoot<Text>
fn CreateCDATASection( &self, data: DOMString, can_gc: CanGc, ) -> Fallible<DomRoot<CDATASection>>
fn CreateComment(&self, data: DOMString, can_gc: CanGc) -> DomRoot<Comment>
fn CreateProcessingInstruction( &self, target: DOMString, data: DOMString, can_gc: CanGc, ) -> Fallible<DomRoot<ProcessingInstruction>>
fn ImportNode( &self, node: &Node, deep: bool, can_gc: CanGc, ) -> Fallible<DomRoot<Node>>
fn AdoptNode(&self, node: &Node, can_gc: CanGc) -> Fallible<DomRoot<Node>>
fn CreateEvent( &self, interface: DOMString, can_gc: CanGc, ) -> Fallible<DomRoot<Event>>
fn LastModified(&self) -> DOMString
fn CreateRange(&self, can_gc: CanGc) -> DomRoot<Range>
fn CreateNodeIterator( &self, root: &Node, what_to_show: u32, filter: Option<Rc<NodeFilter<DomTypeHolder>>>, can_gc: CanGc, ) -> DomRoot<NodeIterator>
fn CreateTreeWalker( &self, root: &Node, what_to_show: u32, filter: Option<Rc<NodeFilter<DomTypeHolder>>>, ) -> DomRoot<TreeWalker>
fn Title(&self) -> DOMString
fn SetTitle(&self, title: DOMString, can_gc: CanGc)
fn GetHead(&self) -> Option<DomRoot<HTMLHeadElement>>
fn GetCurrentScript(&self) -> Option<DomRoot<HTMLScriptElement>>
fn GetBody(&self) -> Option<DomRoot<HTMLElement>>
fn SetBody(&self, new_body: Option<&HTMLElement>, can_gc: CanGc) -> ErrorResult
fn GetElementsByName(&self, name: DOMString, can_gc: CanGc) -> DomRoot<NodeList>
fn Images(&self, can_gc: CanGc) -> DomRoot<HTMLCollection>
fn Embeds(&self, can_gc: CanGc) -> DomRoot<HTMLCollection>
fn Plugins(&self, can_gc: CanGc) -> DomRoot<HTMLCollection>
fn Links(&self, can_gc: CanGc) -> DomRoot<HTMLCollection>
fn Forms(&self, can_gc: CanGc) -> DomRoot<HTMLCollection>
fn Scripts(&self, can_gc: CanGc) -> DomRoot<HTMLCollection>
fn Anchors(&self, can_gc: CanGc) -> DomRoot<HTMLCollection>
fn Applets(&self, can_gc: CanGc) -> DomRoot<HTMLCollection>
fn GetLocation(&self) -> Option<DomRoot<Location>>
fn Children(&self, can_gc: CanGc) -> DomRoot<HTMLCollection>
fn GetFirstElementChild(&self) -> Option<DomRoot<Element>>
fn GetLastElementChild(&self) -> Option<DomRoot<Element>>
fn ChildElementCount(&self) -> u32
fn Prepend( &self, nodes: Vec<NodeOrString<DomTypeHolder>>, can_gc: CanGc, ) -> ErrorResult
fn Append( &self, nodes: Vec<NodeOrString<DomTypeHolder>>, can_gc: CanGc, ) -> ErrorResult
fn ReplaceChildren( &self, nodes: Vec<NodeOrString<DomTypeHolder>>, can_gc: CanGc, ) -> ErrorResult
fn QuerySelector( &self, selectors: DOMString, ) -> Fallible<Option<DomRoot<Element>>>
fn QuerySelectorAll(&self, selectors: DOMString) -> Fallible<DomRoot<NodeList>>
fn ReadyState(&self) -> DocumentReadyState
fn GetDefaultView(&self) -> Option<DomRoot<Window>>
fn GetCookie(&self) -> Fallible<DOMString>
fn SetCookie(&self, cookie: DOMString) -> ErrorResult
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<DomTypeHolder>>>
fn SetOnblur(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnerror(&self) -> Option<Rc<OnErrorEventHandlerNonNull<DomTypeHolder>>>
fn SetOnerror( &self, listener: Option<Rc<OnErrorEventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnfocus(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnfocus(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnload(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnload(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnresize(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnresize(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnscroll(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnscroll(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnabort(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnabort(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnauxclick(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnauxclick( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnanimationstart(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnanimationstart( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnanimationiteration( &self, ) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnanimationiteration( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnanimationend(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnanimationend( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnanimationcancel(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnanimationcancel( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnbeforeinput(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnbeforeinput( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnbeforematch(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnbeforematch( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnbeforetoggle(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnbeforetoggle( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOncancel(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOncancel(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOncanplay(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOncanplay(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOncanplaythrough(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOncanplaythrough( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnchange(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnchange(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnclick(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnclick(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnclose(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnclose(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOncommand(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOncommand(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOncontextlost(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOncontextlost( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOncontextrestored(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOncontextrestored( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOncopy(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOncopy(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOncuechange(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOncuechange( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOncut(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOncut(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOndblclick(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOndblclick( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOndrag(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOndrag(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOndragend(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOndragend(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOndragenter(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOndragenter( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOndragleave(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOndragleave( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOndragover(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOndragover( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOndragstart(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOndragstart( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOndrop(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOndrop(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOndurationchange(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOndurationchange( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnemptied(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnemptied(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnended(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnended(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnformdata(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnformdata( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOninput(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOninput(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOninvalid(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOninvalid(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnkeydown(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnkeydown(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnkeypress(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnkeypress( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnkeyup(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnkeyup(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnloadeddata(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnloadeddata( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnloadedmetadata(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnloadedmetadata( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnloadstart(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnloadstart( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnmousedown(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnmousedown( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnmouseenter(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnmouseenter( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnmouseleave(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnmouseleave( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnmousemove(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnmousemove( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnmouseout(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnmouseout( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnmouseover(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnmouseover( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnmouseup(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnmouseup(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnpaste(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnpaste(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnpause(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnpause(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnplay(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnplay(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnplaying(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnplaying(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnprogress(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnprogress( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnratechange(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnratechange( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnreset(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnreset(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnscrollend(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnscrollend( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnsecuritypolicyviolation( &self, ) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnsecuritypolicyviolation( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnseeked(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnseeked(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnseeking(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnseeking(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnselect(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnselect(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnselectionchange(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnselectionchange( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnselectstart(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnselectstart( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnslotchange(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnslotchange( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnstalled(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnstalled(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnsubmit(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnsubmit(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnsuspend(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnsuspend(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOntimeupdate(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOntimeupdate( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOntoggle(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOntoggle(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOntransitioncancel( &self, ) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOntransitioncancel( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOntransitionend(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOntransitionend( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOntransitionrun(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOntransitionrun( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnvolumechange(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnvolumechange( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnwaiting(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnwaiting(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnwebkitanimationend( &self, ) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnwebkitanimationend( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnwebkitanimationiteration( &self, ) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnwebkitanimationiteration( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnwebkitanimationstart( &self, ) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnwebkitanimationstart( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnwebkittransitionend( &self, ) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnwebkittransitionend( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnwheel(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnwheel(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnreadystatechange( &self, ) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnreadystatechange( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn ElementFromPoint( &self, x: Finite<f64>, y: Finite<f64>, ) -> Option<DomRoot<Element>>
fn ElementsFromPoint( &self, x: Finite<f64>, y: Finite<f64>, ) -> Vec<DomRoot<Element>> ⓘ
fn Open( &self, _unused1: Option<DOMString>, _unused2: Option<DOMString>, can_gc: CanGc, ) -> Fallible<DomRoot<Document>>
fn Open_( &self, url: USVString, target: DOMString, features: DOMString, can_gc: CanGc, ) -> Fallible<Option<DomRoot<WindowProxy>>>
fn Write( &self, text: Vec<TrustedHTMLOrString<DomTypeHolder>>, can_gc: CanGc, ) -> ErrorResult
fn Writeln( &self, text: Vec<TrustedHTMLOrString<DomTypeHolder>>, can_gc: CanGc, ) -> ErrorResult
fn Close(&self, can_gc: CanGc) -> ErrorResult
fn GetOnfullscreenerror(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnfullscreenerror( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnfullscreenchange( &self, ) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnfullscreenchange( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn FullscreenEnabled(&self) -> bool
fn Fullscreen(&self) -> bool
fn GetFullscreenElement(&self) -> Option<DomRoot<Element>>
fn ExitFullscreen(&self, can_gc: CanGc) -> Rc<Promise>
fn ServoGetMediaControls(&self, id: DOMString) -> Fallible<DomRoot<ShadowRoot>>
fn GetSelection(&self, can_gc: CanGc) -> Option<DomRoot<Selection>>
fn Fonts(&self, can_gc: CanGc) -> DomRoot<FontFaceSet>
fn CreateExpression( &self, expression: DOMString, resolver: Option<Rc<XPathNSResolver<DomTypeHolder>>>, can_gc: CanGc, ) -> Fallible<DomRoot<XPathExpression>>
fn CreateNSResolver(&self, node_resolver: &Node, can_gc: CanGc) -> DomRoot<Node>
fn Evaluate( &self, expression: DOMString, context_node: &Node, resolver: Option<Rc<XPathNSResolver<DomTypeHolder>>>, type_: u16, result: Option<&XPathResult>, can_gc: CanGc, ) -> Fallible<DomRoot<XPathResult>>
Source§impl DomObjectWrap<DomTypeHolder> for Document
impl DomObjectWrap<DomTypeHolder> for Document
Source§const WRAP: unsafe fn(SafeJSContext, &GlobalScope, Option<HandleObject<'_>>, Box<Self>, CanGc) -> Root<Dom<Self>> = {script_bindings::codegen::GenericBindings::DocumentBinding::Wrap::<dom::bindings::codegen::DomTypeHolder::DomTypeHolder> as for<'a, 'b> unsafe fn(script_bindings::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_bindings::script_runtime::CanGc) -> script_bindings::root::Root<script_bindings::root::Dom<dom::document::Document>>}
const WRAP: unsafe fn(SafeJSContext, &GlobalScope, Option<HandleObject<'_>>, Box<Self>, CanGc) -> Root<Dom<Self>> = {script_bindings::codegen::GenericBindings::DocumentBinding::Wrap::<dom::bindings::codegen::DomTypeHolder::DomTypeHolder> as for<'a, 'b> unsafe fn(script_bindings::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_bindings::script_runtime::CanGc) -> script_bindings::root::Root<script_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 ToJSValConvertible for Document
impl ToJSValConvertible for Document
impl DerivedFrom<Document> for Document
impl DerivedFrom<Document> for HTMLDocument
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<D, T> DomGlobalGeneric<D> for T
impl<D, T> DomGlobalGeneric<D> for T
Source§fn global_(&self, realm: InRealm<'_>) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
fn global_(&self, realm: InRealm<'_>) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
GlobalScope
] of the realm that the DomObject
was created in. If this
object is a Node
, this will be different from it’s owning Document
if adopted by. For
Node
s it’s almost always better to use NodeTraits::owning_global
.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§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