Skip to main content

Element Index

This page lists every HTML element type recognized by wgpu-html. Each element is parsed into a typed Rust struct with per-element attribute parsing. Unknown tags are silently dropped.

Total: 98 element types (plus Text for text nodes). <script> and <noscript> are parsed but entirely ignored at runtime.

Document Structure

ElementDescriptionCategoryNotes
htmlRoot elementDocumentStores xmlns attribute
headDocument metadata containerDocumentdisplay: none in UA
bodyDocument bodyDocumentDefault margin: 8px in UA
titleDocument titleDocumentRaw-text element; content captured
linkExternal resource linkDocument<link rel="stylesheet"> parsed but not auto-fetched — host must call tree.register_linked_stylesheet()
metaDocument metadataDocumentname, content, charset, http-equiv parsed
styleEmbedded CSS stylesheetDocumentRaw-text element; CSS parsed by stylesheet parser

Sections & Structure

ElementDescriptionCategoryNotes
h1h6Headings (1–6)SectionUA defaults: h1=2em bold, h2=1.5em bold, h3=1.17em bold, h4=1em bold, h5=0.83em bold, h6=0.67em bold; all have margin-block: 0.67em
headerIntroductory contentSectionBlock element
footerFooter contentSectionBlock element
navNavigation sectionSectionBlock element
mainMain content areaSectionBlock element
sectionGeneric document sectionSectionBlock element
articleSelf-contained compositionSectionBlock element
asideTangential contentSectionBlock element
divGeneric containerSectionBlock element
spanGeneric inline containerSectionInline element

Text & Block Content

ElementDescriptionCategoryNotes
pParagraphBlock textAuto-close on next p, div, heading, etc.
brLine breakInlineVoid element
hrThematic break / horizontal ruleBlock textVoid element; painted as a line
prePreformatted textBlock textPreserves whitespace
blockquoteBlock quotationBlock textUA margin: 1em 40px
addressContact informationBlock textUsually italic

Lists

ElementDescriptionCategoryNotes
ulUnordered listListBlock; UA margin: 1em 0, padding-left: 40px
olOrdered listListBlock; same UA margins as ul
liList itemListAuto-close on next li
dlDescription listListBlock
dtDescription termListAuto-close on next dt/dd
ddDescription detailsListAuto-close on next dt/dd

Tables

ElementDescriptionCategoryNotes
tableTable rootTableParsed; falls through to block layout (no table layout yet)
captionTable captionTable
colgroupColumn groupTable
colColumn definitionTableVoid element
theadTable header groupTableAuto-close on tbody/tfoot
tbodyTable body groupTableAuto-close on thead/tfoot
tfootTable footer groupTableAuto-close on tbody
trTable rowTableAuto-close on next tr
thTable header cellTableAuto-close on next th/td
tdTable data cellTableAuto-close on next th/td

Forms

ElementDescriptionCategoryNotes
formForm containerFormname, action, method, target attributes; no submission yet
inputForm input (22 types)FormVoid element; type, value, placeholder, name, checked, disabled, readonly, required, min, max, step, pattern, multiple, autofocus parsed. Types: text, password, email, url, tel, search, number, range, date, time, datetime-local, month, week, color, checkbox, radio, file, hidden, image, submit, reset, button
textareaMulti-line text inputFormRaw-text element; full text editing with caret
selectDropdown selectFormname, disabled, required, multiple, autofocus; no dropdown UI yet
optionSelect optionFormvalue, selected, disabled
optgroupOption groupFormdisabled
labelLabel for form controlFormfor attribute
buttonButtonFormtype (button/submit/reset), value, name, disabled, autofocus; focusable
fieldsetForm control groupFormname, disabled
legendFieldset captionForm
datalistPredefined input optionsForm
outputCalculation outputFormname, for
progressProgress barFormvalue parsed as f32
meterScalar measurementFormvalue parsed as f32

Media

ElementDescriptionCategoryNotes
imgImageMediasrc, alt, width, height; async loading with HTTP(S)/file/data-URI; GIF/WebP animation; two-level cache with TTL
svgInline SVGMediaRasterized via resvg to a GPU texture
sourceMedia sourceMediaVoid element; src, type
pictureResponsive image containerMedia
figureFigure with captionMedia
figcaptionFigure captionMedia
areaImage map areaMedia
mapImage mapMedia
canvasBitmap canvasMediaGPU-backed via wgpu texture
videoVideo elementMediasrc; not rendered
audioAudio elementMediasrc; not rendered
trackMedia text trackMediaVoid element; src
iframeNested browsing contextMediasrc, name; not rendered

Interactive

ElementDescriptionCategoryNotes
aHyperlink / anchorInteractivehref, type; focusable when href is set; inline element
detailsDisclosure widgetInteractivename
summaryDetails summary/legendInteractiveFocusable; triggers details open/close
dialogDialog boxInteractive

Inline Text Semantics

ElementDescriptionCategoryNotes
strongStrong importanceInlineUA: font-weight: bold
bBring attentionInlineUA: font-weight: bold
emStress emphasisInlineUA: font-style: italic
iIdiomatic textInlineUA: font-style: italic
uUnarticulated annotationInlineUA: text-decoration: underline
sStrikethroughInlineUA: text-decoration: line-through
delDeleted textInlineUA: text-decoration: line-through
insInserted textInlineUA: text-decoration: underline
codeInline codeInlineUA: font-family: monospace
kbdKeyboard inputInlineUA: font-family: monospace
sampSample outputInlineUA: font-family: monospace
varVariableInlineUsually italic
markMarked/highlighted textInline
smallSmall printInlineUA: font-size: smaller
subSubscriptInlineUA: vertical-align: sub, font-size: smaller
supSuperscriptInlineUA: vertical-align: super, font-size: smaller
abbrAbbreviationInline
citeCitationInlineUA: font-style: italic
qInline quotationInlineDisplays with quotes
dfnDefining instanceInlineUsually italic
timeDate/timeInline
wbrLine break opportunityInlineVoid element
bdiBidirectional isolateInline
bdoBidirectional overrideInline
dataMachine-readable dataInlinevalue attribute
rubyRuby annotationInline
rtRuby textInlineAuto-close on next rt/rp
rpRuby fallback parenthesisInlineAuto-close on next rt/rp

Ignored Elements

ElementDescriptionNotes
scriptJavaScriptParsed but entirely ignored; raw-text element
noscriptFallback for no-scriptParsed but ignored
templateContent templateParsed inertly; content clonable via tree.clone_template_content_by_id()
slotShadow DOM slotParsed; name attribute

Global Attributes

All elements (except Text) support these global attributes:

AttributeTypeDescription
idOption<String>Element identifier; used by #id selectors and get_element_by_id()
classOption<String>Whitespace-separated CSS class list
styleOption<String>Inline CSS declarations
titleOption<String>Advisory tooltip text
langOption<String>Language code
dirOption<HtmlDirection>Text direction (ltr / rtl / auto)
hiddenOption<bool>Hide element (display: none semantics via UA cascade)
tabindexOption<i32>Tab order; >=0 makes focusable via keyboard
contenteditable(parsed, not consumed)
draggable(parsed, not consumed)
spellcheck(parsed, not consumed)
translate(parsed, not consumed)
accesskey(parsed, not consumed)
roleOption<String>ARIA role
aria-*HashMap<String, String>ARIA attributes
data-*HashMap<String, String>Custom data attributes