The same page can be inspected through several representations. Each answers a different question.
- The Document Object Model (DOM) is the browser’s in-memory representation of the document as a tree of nodes. Scripts can read and change it. It is not simply a screenshot or always identical to the original HTML source. See MDN’s DOM introduction.
- The accessibility tree exposes information used by assistive technologies, including roles, names, and states when provided. It is derived from the page and browser’s interpretation; it need not contain every DOM node. See MDN’s accessibility tree explanation.
- A screenshot records rendered pixels at a particular moment and viewport. It can reveal clipping, overlap, spacing, or an unexpected image that a semantic snapshot does not describe.
One control, three views
For an imagined library search page, a simplified accessibility snapshot could be:
heading: Library search
textbox: Search titles
button: Search
The DOM might contain a label, an input, and a button; the accessibility view summarizes their meaning. A browser tool that supports targeting by role and accessible name can try to identify the Search button without guessing its coordinates. The name may be absent, duplicated, or incorrect, so verify the target and result. A screenshot might instead show that the button is clipped at a narrow width. The tree alone cannot establish that the button is visually usable.
A vision model accepts image input, but may misread small text, miss content outside the image, or confidently describe a detail incorrectly. An image-capable model and a means to pass it the screenshot are both needed. Coordinate clicks can hit the wrong control after scrolling or resizing; prefer a unique semantic target where possible, and observe the result either way. Screenshots do not establish keyboard support, screen-reader behavior, contrast compliance, or all responsive states. Use human inspection and suitable accessibility testing in addition to automation.