Home / File/ document.js — svelte Source File

document.js — svelte Source File

Architecture documentation for document.js, a javascript file in the svelte codebase. 2 imports, 0 dependents.

File javascript ClientRuntime Hydration 2 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  bb75dac7_8bcf_2d4b_80fd_684f4431a04c["document.js"]
  af7441d2_339a_2db1_88df_90dba2875c10["shared.js"]
  bb75dac7_8bcf_2d4b_80fd_684f4431a04c --> af7441d2_339a_2db1_88df_90dba2875c10
  da178604_a1e6_1104_9d60_daf043f014c9["listen"]
  bb75dac7_8bcf_2d4b_80fd_684f4431a04c --> da178604_a1e6_1104_9d60_daf043f014c9
  style bb75dac7_8bcf_2d4b_80fd_684f4431a04c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { listen } from './shared.js';

/**
 * @param {(activeElement: Element | null) => void} update
 * @returns {void}
 */
export function bind_active_element(update) {
	listen(document, ['focusin', 'focusout'], (event) => {
		if (event && event.type === 'focusout' && /** @type {FocusEvent} */ (event).relatedTarget) {
			// The tests still pass if we remove this, because of JSDOM limitations, but it is necessary
			// to avoid temporarily resetting to `document.body`
			return;
		}

		update(document.activeElement);
	});
}

Domain

Subdomains

Dependencies

Frequently Asked Questions

What does document.js do?
document.js is a source file in the svelte codebase, written in javascript. It belongs to the ClientRuntime domain, Hydration subdomain.
What functions are defined in document.js?
document.js defines 1 function(s): bind_active_element.
What does document.js depend on?
document.js imports 2 module(s): listen, shared.js.
Where is document.js in the architecture?
document.js is located at packages/svelte/src/internal/client/dom/elements/bindings/document.js (domain: ClientRuntime, subdomain: Hydration, directory: packages/svelte/src/internal/client/dom/elements/bindings).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free