Skip to content

Commit b6dd913

Browse files
authored
Explain that http-equiv has nothing to do with HTTP headers
Closes #7435. See also #2335 which discusses name="" vs. http-equiv="".
1 parent baec061 commit b6dd913

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

source

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17198,6 +17198,28 @@ interface <dfn interface>HTMLMetaElement</dfn> : <span>HTMLElement</span> {
1719817198
data-x="attr-meta-http-equiv">http-equiv</code></dfn> attribute is specified on a
1719917199
<code>meta</code> element, the element is a pragma directive.</p>
1720017200

17201+
<div class="warning" id="warning-http-equiv-unrelated-to-http-headers">
17202+
<p>Despite the name <code data-x="attr-meta-http-equiv">http-equiv</code>, pragma directives are
17203+
almost entirely unrelated to HTTP headers. Implementers and web developers are best off thinking
17204+
of them as entirely separate, and the name as being a historical accident.</p>
17205+
17206+
<p>In more detail, although the <code data-x="attr-meta-http-equiv-refresh">refresh</code>
17207+
keyword has the same processing model as the corresponding `<code>Refresh</code>` header, every
17208+
other standardized pragma directive has at least slightly different behavior than the
17209+
similarly-named header. (And usually dramatically-different behavior.)</p>
17210+
17211+
<p>Implementers or specification writers contemplating adding new document-level pragmas or HTTP
17212+
header-controlled switches should be cautious about this mismatch, and avoid perpetuating the
17213+
existing confusion by adding the same or similar behavior to both an HTTP header and an <code
17214+
data-x="attr-meta-http-equiv">http-equiv</code> pragma. Instead, consider providing only an HTTP
17215+
header, or if an in-document pragma is needed, consider adding a new attribute to
17216+
<code>meta</code> similar to the model used by the <code
17217+
data-x="attr-meta-charset">charset</code> attribute. (Note that avoiding in-document pragmas is
17218+
often the better choice, since the DOM is mutable. Thus, even in the simple case where the
17219+
developer does not add, remove, or mutate <code>meta</code> elements, the policy will go from
17220+
un-applied to applied during parsing, which can have complex implications.)</p>
17221+
</div>
17222+
1720117223
<p>The <code data-x="attr-meta-http-equiv">http-equiv</code> attribute is an <span>enumerated
1720217224
attribute</span> with the following keywords and states:</p>
1720317225

0 commit comments

Comments
 (0)