HTML Concepts: Unstyled Documents
Published on Nov 22, 2022, filed under development, html, css. (Share this post, e.g., on Mastodon.)
Welcome back!
What is an unstyled document? (What is your expectation?) When I thought about this question, my immediate response was “a document without styling information, but styled according to user agent styles.”
For us used to working with CSS, that probably is “unstyled.” But the HTML specification has a special section about unstyled documents. Under Unstyled XML documents it describes what, precisely, a “fully” unstyled document is.
An unstyled document is a document that:
- has no author style sheets,
- has no (meaning none of its elements has any) presentational hints,
- has no style attributes,
- is not in the HTML, SVG, or MathML namespace,
- has no focusable area (other than the viewport),
- has no hyperlinks,
- doesn’t have a
Windowobject, and - has no registered event listeners.
How does this look like?
Such a document would not be rendered according to CSS—and could therefore “just result in a wall of text.”
However, it could be displayed in other forms, and the HTML specification puts developers first here: Such an unstyled document—which should be something that the browser represents using a DOM—could be “rendered in a manner that is useful for a developer,” as with syntax highlighting or a visualization of the respective document tree.
But… is this an HTML document, and therefore concept?
No, it’s not—but I thought it may be of interest to look at fully unstyled documents 😬 (Next time it’s fully about HTML again.)
Many thanks to Simon Pieters for reviewing and sharing feedback on this post!
About Me
I’m Jens (long: Jens Oliver Meiert), and I’m an engineering lead, guerrilla philosopher, and indie publisher. I’ve worked as a technical lead and engineering manager at various companies (e.g., Google); I’m an active web and tool developer (code optimization, digital defense), a contributor to web standards (like HTML, CSS, WCAG), and a book author (O’Reilly, Frontend Dogma).
I love trying things—in web development and engineering management, but also in politics and philosophy, where I hold to one idea in particular: that we can only be well if we take good care of everyone. Here on meiert.com I talk about some of my perspectives and experiences. (Interpret charitably but be critical—and share feedback and advice that makes my work better.)
