Document Object Model
The live tree of objects a browser builds from a document, and the surface every UI framework writes to.
The Document Object Model is the in-memory tree a browser constructs from an HTML document, exposed to scripts as objects that can be read and mutated. Changing it changes what is rendered. Every user-interface framework on the web is ultimately a strategy for producing DOM mutations.
Three characteristics drive most practical difficulty.
It is stateful in ways the source does not describe. Focus, selection, scroll position, form values, and media playback live in the DOM, not in the markup that produced it. Replacing a subtree destroys all of them, which is why remounting a component silently loses the caret or the scroll offset.
Reading it can be expensive. Geometry queries force the browser to complete pending layout work, so interleaving reads and writes produces layout thrashing.
Text has more than one representation. The property giving rendered text differs from the one giving raw content: a field displayed in uppercase by a style rule reads back as uppercase through one and in its authored case through the other. Saving the wrong one silently rewrites data — see contenteditable.
Frameworks that keep a virtual model of the tree add a fourth: the framework's picture and the real tree can diverge, and any mutation made outside the framework's knowledge will be diffed against a stale model. See Hydration.
See also9
Semantic HTML
Using elements for their meaning, so the document conveys structure without extra description.
Design & Interface24 connections
Portal
Rendering an element into a different part of the document than its logical parent.
Web Platform18 connections
Focus Management
Deliberately controlling which element receives keyboard focus as an interface changes.
Design & Interface28 connections
Progressive Enhancement
Building so the core experience works without scripts, with richer behavior layered on top.
Web Platform26 connections
Keyboard Navigation
Making every interactive affordance reachable and operable without a pointer.
Design & Interface34 connections
Headless Component
A component supplying behavior and accessibility with no styling of its own.
Design & Interface16 connections
Accessibility
Designing so that people with disabilities can use a thing, and the standards that make it checkable.
Design & Interface44 connections
HTML
The markup language every web page is written in, invented at CERN around 1990 as a simple way to tag documents and link them, and grown by thirty years of browser competition into an application platform.
Web Platform12 connections
Virtual Scrolling
Rendering only the rows of a long list that are on screen and recycling them as the user scrolls, so a list of a million items costs about as much to display as a list of thirty.
Web Platform12 connections
Linked from26
- AccessibilityDesign & Interface
Designing so that people with disabilities can use a thing, and the standards that make it checkable.
- Accessibility TestingTesting & Verification
Checking that people using screen readers, keyboards, magnification, or other assistive technology can actually use an interface, through a mix of automated scans and hands-on testing.
- ARIADesign & Interface
Attributes that describe roles, states, and relationships to assistive technology when HTML cannot.
- Browser ExtensionWeb Platform
Small programs that modify the browser and the pages it shows, from bookmarklets and userscripts to ad blockers, with access broad enough to make them a standing security risk.
- contenteditableWeb Platform
The HTML attribute that makes an element directly editable, and the surface behind most rich-text editors.
- Cross-Site ScriptingWeb Platform
Injecting attacker-controlled script into a page that a victim's browser then executes with the victim's own privileges.
- Focus ManagementDesign & Interface
Deliberately controlling which element receives keyboard focus as an interface changes.
- Focus TrapDesign & Interface
Confining keyboard focus inside a modal surface so it cannot wander behind it.
- HTMLWeb Platform
The markup language every web page is written in, invented at CERN around 1990 as a simple way to tag documents and link them, and grown by thirty years of browser competition into an application platform.
- HydrationWeb Platform
Attaching client-side behavior to server-rendered markup without rebuilding it.
- IframeWeb Platform
A whole web page embedded inside another, the web's main isolation boundary for ads, payments, and widgets, and the messaging and sandboxing rules that govern it.
- Keyboard NavigationDesign & Interface
Making every interactive affordance reachable and operable without a pointer.
- Long TaskWeb Platform
Any stretch of main-thread work over 50 milliseconds, during which the page can't respond to input, and the techniques for breaking such work up.
- PortalWeb Platform
Rendering an element into a different part of the document than its logical parent.
- Progressive EnhancementWeb Platform
Building so the core experience works without scripts, with richer behavior layered on top.
- Screen ReaderDesign & Interface
Software that turns an interface into speech or braille for people who can't see the screen, which navigates by structure rather than reading top to bottom, and exposes every shortcut a sighted design took.
- Semantic HTMLDesign & Interface
Using elements for their meaning, so the document conveys structure without extra description.
- Service WorkerWeb Platform
A background script the browser runs between a page and the network, able to intercept requests even when no page is open.
- Shadow DOMWeb Platform
An encapsulated DOM subtree whose styles and structure are isolated from the rest of the page.
- Stacking ContextDesign & Interface
The nested coordinate system that decides what paints above what, and why z-index often does nothing.
- State ManagementWeb Platform
How a front-end application keeps track of the data that changes as people use it, and decides where each piece lives, from local component state to global stores to server caches.
- View TransitionsWeb Platform
A browser API that animates between two states of a page, or between two pages, by snapshotting the old and new views and morphing between them.
- Virtual DOMWeb Platform
An in-memory representation of the UI that a framework diffs against the previous version to compute minimal real DOM updates.
- Virtual ScrollingWeb Platform
Rendering only the rows of a long list that are on screen and recycling them as the user scrolls, so a list of a million items costs about as much to display as a list of thirty.
- Web ComponentsWeb Platform
A set of browser-native APIs for building reusable, encapsulated HTML elements without a framework.
- Web WorkerWeb Platform
A background thread for running JavaScript off the main thread, with no access to the DOM.