Day 56 of 100DaysOfSpec, 4.2.5 The meta element, contd.
I am reading and taking notes on the HTML specifications for 100 days as part of #The100DayProject. Read the initial intent/backstory. I am a Microsoft employee but all opinions, comments, etc on this site are my own. I do not speak on behalf of my employer, and thus no comments should be taken as representative of Microsoft's official opinion of the spec. Subsections not listed below were read without comment.
Currently reading in 4.2.5 The meta element
4.2.5.3 Pragma directives
“When the http-equiv attribute is specified on a meta element, the element is a pragma directive.”
http-equiv
takes one of a defined set of values:
content-language
(non-conforming)content-type
default-style
refresh
set-cookie
(non-conforming)
content-language
“This pragma is almost, but not quite, entirely unlike the HTTP Content-Language header of the same name.” Uh, ok? How? shrug
content-type
This character encoding declaration is an alternative means of setting the charset
attribute, which means your document shouldn’t have both a meta element with this http-equiv
attribute value, and a meta with the charset
set. It’s formatted like: text/html; charset=
with a character encoding label at the end. The character encoding name is case-insensitive.
default-style
“This pragma sets the name of the default alternative style sheet set.” Curious who’s using this and why.
refresh
A timed redirect. Only the first meta element with http-equiv="refresh"
will be run. The algorithm to parse this attribute value is the longest of the pragmas. Still, some aspects of the design of this interface are up to the UA: how they want to surface the time left to redirect, whether they want to show the URL the user will be directed to, how (and maybe if? not quite sure) they want to allow the user to cancel the redirect, etc.
The formatting of this pragma: content="300; URL=nextpage.html"
, where 300 is any positive integer, denoting seconds. You can drop off the URL bit and the page will simply refresh; if you include a new URL, the page will, after first loading, redirect to that new page.
set-cookie
“It is non-conforming. Real HTTP headers should be used instead.”
4.2.5.4 Other pragma directives
Like the default metadata names, pragma directives can be extended; that is, added to the WHATWG Wiki PragmaExtensions page. Where metadata names can be used to accomplish the same goal as a potential new pragma...you should do that.
Anyone can update the page, and each new entry needs:
- keyword
- brief description
- specification
There is less direction about this process than the metadata names, and when you look at the extensions page, you see why: between allowed and proposed extensions, there’s a grand total of 3 pragma directives.
4.2.5.5 Specifying the document's character encoding
There’s a whole of bunch of rules here. I’m not going to lie to you, I’m feeling too lazy to read this right now when I don’t need it. If I ever need anything besides utf-8, I’ll give this section a glance. #lifelonglearning