Mechanical ComparisonThe Accessibility Tree and WAI-ARIA Semantics: Baseline · WidelyCustom Elements Lifecycle and Upgrade Reactions: Baseline · Widely

The Accessibility Tree and WAI-ARIA Semantics vs Custom Elements Lifecycle and Upgrade Reactions

Mechanical Verdict

Native elements expose built-in ARIA semantics, whereas autonomous custom elements require ElementInternals to wire roles.

Try The Accessibility Tree and WAI-ARIA Semantics LabTry Custom Elements Lifecycle and Upgrade Reactions LabRead The Accessibility Tree and WAI-ARIA Semantics DissectionRead Custom Elements Lifecycle and Upgrade Reactions Dissection

Structured Comparison Matrix

DimensionThe Accessibility Tree and WAI-ARIA SemanticsCustom Elements Lifecycle and Upgrade Reactions
Mental ModelParallel OS-exposed tree derived from the DOM and CSSOM that computes each element's Role, Accessible Name, States, and Properties for assistive technologies.Build framework-agnostic UI primitives without hydration races—customElements.define() upgrades existing DOM nodes via deterministic lifecycle reaction queues.
Maturity & DomainBaseline · Widely · Security & Accessibility
Chrome Full Accessibility Tree · Firefox Full Accessibility Tree · Safari VoiceOver / NSAccessibility
Baseline · Widely · DOM & Events
Chrome 67+ · Firefox 63+ · Safari 10.1+
Prerequisites
When Not to UseWhen not to use ARIA: Whenever a native HTML element (<button>, <a href>, <input>, <dialog>) already carries the required role and keyboard behavior, omit redundant role attributes; for Custom Elements, expose roles via ElementInternals instead of mutating host aria-* attributes.When not to use Custom Elements: Avoid wrapping every leaf UI primitive in a custom element if your app already compiles single-framework SSR templates, use them for cross-framework widgets or design-system leaves.

Engine Mechanics & Trade-Offs

The Accessibility Tree and WAI-ARIA SemanticsBaseline · Widely

The browser builds a parallel Accessibility Tree from semantic HTML and ARIA attributes, filtering display:none/aria-hidden nodes and computing Accessible Names for OS screen readers.

Key Pitfalls: First Rule of ARIA violation: Replacing <button> with <div role="button"> drops keyboard activation, form submission, and disabled semantics for zero gain. aria-hidden="true" on focusable elements: Leaves the button reachable via Tab while hiding its announcement from screen readers ("ghost focus"); use the inert attri

Custom Elements Lifecycle and Upgrade ReactionsBaseline · Widely

Custom Elements upgrade DOM nodes via CustomElementRegistry, queuing constructor, connectedCallback, and attributeChangedCallback reactions deterministically.

Key Pitfalls: DOM Mutations in constructor(): Calling this.setAttribute() in constructor() throws NotSupportedError during HTML parsing. Safari Built-in Rejection: Extending <button is="my-btn"> (extends: 'button') is unsupported in Safari; always use autonomous tags.