Skip to content
Marcos Caceres edited this page Mar 27, 2026 · 11 revisions

data-dfn-type

Applies to: <dfn>

Declares the type of a definition. Used by the xref system to enable type-specific linking with [= =], {{ }}, and data-link-type.

In most cases you do not need this attribute — ReSpec infers the type automatically. IDL types (interface, method, attribute, etc.) are set automatically when a <dfn> is inside a <pre class="idl"> block.

Usage

<p>To <dfn data-dfn-type="abstract-op">process a widget</dfn>, run these steps:</p>
<p>The <dfn data-dfn-type="http-header">Widget-Policy</dfn> response header...</p>

Valid values for manual use

Value Use for
dfn General concepts and prose definitions (default when no type is set)
abstract-op Abstract operations (algorithm steps)
element HTML/SVG/MathML element names
element-attr Content attributes of HTML/SVG elements
attr-value Values of element attributes
element-state States of elements (e.g. checkbox states)
event DOM event types
http-header HTTP header names
media-type MIME types
scheme URL schemes
permission Permission strings (e.g. for the Permissions API)

IDL types (set automatically)

When <dfn> elements are inside a <pre class="idl"> WebIDL block, ReSpec automatically sets the dfn type from the IDL declaration. You don't set these manually:

interface, attribute, method, dictionary, dict-member, enum, enum-value, callback, typedef, namespace, constructor

Notes

  • The [= term =] shorthand links to dfn or abstract-op type definitions
  • The {{ term }} shorthand links to IDL type definitions
  • When data-dfn-for is set, type defaults to IDL unless explicitly overridden
  • If unsure, omit data-dfn-type and let ReSpec infer it

Guides

Configuration options

W3C Configuration options

Linting rules

Internal properties

Handled by ReSpec for you.

Special <section> IDs

HTML elements

Custom Elements

HTML attributes

CSS Classes

Special properties

Clone this wiki locally