Debian Codegraph @

rfc2854.html

raw
1 <pre>Network Working Group D. Connolly
2 Request for Comments: 2854 World Wide Web Consortium (W3C)
3 Obsoletes: <a href="./rfc2070">2070</a>, <a href="./rfc1980">1980</a>, <a href="./rfc1942">1942</a>, <a href="./rfc1867">1867</a>, <a href="./rfc1866">1866</a> L. Masinter
4 Category: Informational AT&amp;T
5 June 2000
6
7
8 <span class="h1">The 'text/html' Media Type</span>
9
10 Status of this Memo
11
12 This memo provides information for the Internet community. It does
13 not specify an Internet standard of any kind. Distribution of this
14 memo is unlimited.
15
16 Copyright Notice
17
18 Copyright (C) The Internet Society (2000). All Rights Reserved.
19
20 Abstract
21
22 This document summarizes the history of HTML development, and defines
23 the "text/html" MIME type by pointing to the relevant W3C
24 recommendations; it is intended to obsolete the previous IETF
25 documents defining HTML, including <a href="./rfc1866">RFC 1866</a>, <a href="./rfc1867">RFC 1867</a>, <a href="./rfc1980">RFC 1980</a>, <a href="./rfc1942">RFC</a>
26 <a href="./rfc1942">1942</a> and <a href="./rfc2070">RFC 2070</a>, and to remove HTML from IETF Standards Track.
27
28 This document was prepared at the request of the W3C HTML working
29 group. Please send comments to [email protected], a public mailing list
30 with archive at &lt;<a href="http://lists.w3.org/Archives/Public/www-html/">http://lists.w3.org/Archives/Public/www-html/</a>&gt;.
31
32 <span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction and background</span>
33
34 HTML has been in use in the World Wide Web information infrastructure
35 since 1990, and specified in various informal documents. The
36 text/html media type was first officially defined by the IETF HTML
37 working group in 1995 in [<a href="#ref-HTML20" title="&quot;Hypertext Markup Language - 2.0&quot;">HTML20</a>]. Extensions to HTML were proposed
38 in [<a href="#ref-HTML30" title="&quot;HyperText Markup Language Specification Version 3.0&quot;">HTML30</a>], [<a href="#ref-UPLOAD" title="&quot;Form-based File Upload in HTML&quot;">UPLOAD</a>], [<a href="#ref-TABLES" title="&quot;HTML Tables&quot;">TABLES</a>], [<a href="#ref-CLIMAPS" title="&quot;A Proposed Extension to HTML: Client-Side Image Maps&quot;">CLIMAPS</a>], and [<a href="#ref-I18N" title="&quot;Internationalization of the Hypertext Markup Language&quot;">I18N</a>].
39
40 The IETF HTML working group closed Sep 1996, and work on defining
41 HTML moved to the World Wide Web Consortium (W3C). The proposed
42 extensions were incorporated to some extent in [<a href="#ref-HTML32" title="&quot;HTML 3.2 Reference Specification&quot;">HTML32</a>], and to a
43 larger extent in [<a href="#ref-HTML40" title="&quot;HTML 4.0 Specification&quot;">HTML40</a>]. The definition of multipart/form-data from
44 [<a href="#ref-UPLOAD" title="&quot;Form-based File Upload in HTML&quot;">UPLOAD</a>] was described in [<a href="#ref-FORMDATA" title="&quot;Returning Values from Forms: multipart/form-data&quot;">FORMDATA</a>]. In addition, a reformulation of
45 HTML 4.0 in XML 1.0[XHTML1] was developed.
46
47
48
49
50
51
52 <span class="grey">Connolly &amp; Masinter Informational [Page 1]</span></pre>
53 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
54 <span class="grey"><a href="./rfc2854">RFC 2854</a> The 'text/html' Media Type June 2000</span>
55
56
57 [<a id="ref-HTML32">HTML32</a>] notes "This specification defines HTML version 3.2. HTML 3.2
58 aims to capture recommended practice as of early '96 and as such to
59 be used as a replacement for HTML 2.0 (<a href="./rfc1866">RFC 1866</a>)." Subsequent
60 specifications for HTML describe the differences in each version.
61
62 In addition to the development of standards, a wide variety of
63 additional extensions, restrictions, and modifications to HTML were
64 popularized by NCSA's Mosaic system and subsequently by the
65 competitive implementations of Netscape Navigator and Microsoft
66 Internet Explorer; these extensions are documented in numerous books
67 and online guides.
68
69 <span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Registration of MIME media type text/html</span>
70
71 MIME media type name: text
72 MIME subtype name: html
73 Required parameters: none
74 Optional parameters:
75
76 charset
77 The optional parameter "charset" refers to the character
78 encoding used to represent the HTML document as a sequence of
79 bytes. Any registered IANA charset may be used, but UTF-8 is
80 preferred. Although this parameter is optional, it is strongly
81 recommended that it always be present. See <a href="#section-6">Section 6</a> below for
82 a discussion of charset default rules.
83
84 Note that [<a href="#ref-HTML20" title="&quot;Hypertext Markup Language - 2.0&quot;">HTML20</a>] included an optional "level" parameter; in
85 practice, this parameter was never used and has been removed from
86 this specification. [<a href="#ref-HTML30" title="&quot;HyperText Markup Language Specification Version 3.0&quot;">HTML30</a>] also suggested a "version"
87 parameter; in practice, this parameter also was never used and has
88 been removed from this specification.
89
90 Encoding considerations:
91 See <a href="#section-4">Section 4</a> of this document.
92
93 Security considerations:
94 See <a href="#section-7">Section 7</a> of this document.
95
96 Interoperability considerations:
97 HTML is designed to be interoperable across the widest possible
98 range of platforms and devices of varying capabilities. However,
99 there are contexts (platforms of limited display capability, for
100 example) where not all of the capabilities of the full HTML
101 definition are feasible. There is ongoing work to develop both a
102 modularization of HTML and a set of profiling capabilities to
103 identify and negotiate restricted (and extended) capabilities.
104
105
106
107
108 <span class="grey">Connolly &amp; Masinter Informational [Page 2]</span></pre>
109 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
110 <span class="grey"><a href="./rfc2854">RFC 2854</a> The 'text/html' Media Type June 2000</span>
111
112
113 Due to the long and distributed development of HTML, current
114 practice on the Internet includes a wide variety of HTML variants.
115 Implementors of text/html interpreters must be prepared to be
116 "bug-compatible" with popular browsers in order to work with many
117 HTML documents available the Internet.
118
119 Typically, different versions are distinguishable by the DOCTYPE
120 declaration contained within them, although the DOCTYPE
121 declaration itself is sometimes omitted or incorrect.
122
123 Published specification:
124 The text/html media type is now defined by W3C Recommendations;
125 the latest published version is [<a href="#ref-HTML401" title="&quot;HTML 4.01 Specification&quot;">HTML401</a>]. In addition, [<a href="#ref-XHTML1" title="&quot;XHTML 1.0: The Extensible HyperText Markup Language: A Reformulation of HTML 4 in XML 1.0&quot;">XHTML1</a>]
126 defines a profile of use of XHTML which is compatible with HTML
127 4.01 and which may also be labeled as text/html.
128
129 Applications which use this media type:
130 The first and most common application of HTML is the World Wide
131 Web; commonly, HTML documents contain URI references [<a href="#ref-URI" title="&quot;Uniform Resource Identifiers (URI): Generic Syntax&quot;">URI</a>] to
132 other documents and media to be retrieved using the HTTP protocol
133 [<a href="#ref-HTTP" title="&quot;Hypertext Transfer Protocol -- HTTP/1.1&quot;">HTTP</a>]. Many gateway applications provide HTML-based interfaces to
134 other underlying complex services. Numerous other applications now
135 also use HTML as a convenient platform-independent multimedia
136 document representation.
137
138 Additional information:
139
140 Magic number:
141 There is no single initial string that is always present for
142 HTML files. However, <a href="#section-5">Section 5</a> below gives some guidelines for
143 recognizing HTML files.
144
145 File extension:
146 The file extensions 'html' or 'htm' are commonly used, but
147 other extensions denoting file formats for preprocessing are
148 also common.
149
150 Macintosh File Type code: TEXT
151
152 Person &amp; email address to contact for further information:
153 Dan Connolly &lt;[email protected]&gt;
154 Larry Masinter &lt;[email protected]&gt;
155
156
157
158
159
160
161
162
163
164 <span class="grey">Connolly &amp; Masinter Informational [Page 3]</span></pre>
165 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
166 <span class="grey"><a href="./rfc2854">RFC 2854</a> The 'text/html' Media Type June 2000</span>
167
168
169 Intended usage: COMMON
170
171 Author/Change controller:
172 The HTML specification is a work product of the World Wide Web
173 Consortium's HTML Working Group. The W3C has change control over
174 the HTML specification.
175
176 Further information:
177 HTML has a means of including, by reference via URI, additional
178 resources (image, video clip, applet) within the base document. In
179 order to transfer a complete HTML object and the included
180 resources in a single MIME object, the mechanisms of [<a href="#ref-MHTML" title="&quot;MIME Encapsulation of Aggregate Documents, such as HTML (MHTML)&quot;">MHTML</a>] may
181 be used.
182
183 <span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. Fragment Identifiers</span>
184
185 The URI specification [<a href="#ref-URI" title="&quot;Uniform Resource Identifiers (URI): Generic Syntax&quot;">URI</a>] notes that the semantics of a fragment
186 identifier (part of a URI after a "#") is a property of the data
187 resulting from a retrieval action, and that the format and
188 interpretation of fragment identifiers is dependent on the media type
189 of the retrieval result.
190
191 For documents labeled as text/html, the fragment identifier
192 designates the correspondingly named element; any element may be
193 named with the "id" attribute, and A, APPLET, FRAME, IFRAME, IMG and
194 MAP elements may be named with a "name" attribute. This is described
195 in detail in [<a href="#ref-HTML40" title="&quot;HTML 4.0 Specification&quot;">HTML40</a>] <a href="#section-12">section 12</a>.
196
197 <span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. Encoding considerations</span>
198
199 Because of the availability within HTML itself for using character
200 entity references, documents that use a wide repertoire of characters
201 may still be represented using the US-ASCII charset and transported
202 without encoding. However, transport of text/html using a charset
203 other than US-ASCII may require base64 or quoted-printable encoding
204 for 7-bit channels.
205
206 As with all MIME text subtypes, the canonical form of "text/html"
207 must always represent a line break as a sequence of a CR byte value
208 (0x0D) followed by an LF (0x0A) byte value. Similarly, any
209 occurrence of such a CRLF sequence in "text/html" must represent a
210 line break. Use of CR byte values and LF byte values outside of line
211 break sequences is also forbidden. This rule applies regardless of
212 the character encoding ('charset') involved.
213
214
215
216
217
218
219
220 <span class="grey">Connolly &amp; Masinter Informational [Page 4]</span></pre>
221 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
222 <span class="grey"><a href="./rfc2854">RFC 2854</a> The 'text/html' Media Type June 2000</span>
223
224
225 Note, however, that the HTTP protocol allows the transport of data
226 not in canonical form, and, in particular, with other end-of-line
227 conventions; see [<a href="#ref-HTTP" title="&quot;Hypertext Transfer Protocol -- HTTP/1.1&quot;">HTTP</a>] <a href="#section-3.7.1">section 3.7.1</a>. This exception is commonly
228 used for HTML.
229
230 HTML sent via email is still subject to the MIME restrictions; this
231 is discussed fully in [<a href="#ref-MHTML" title="&quot;MIME Encapsulation of Aggregate Documents, such as HTML (MHTML)&quot;">MHTML</a>] <a href="#section-10">Section 10</a>.
232
233 <span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. Recognizing HTML files</span>
234
235 Almost all HTML files have the string "&lt;html" or "&lt;HTML" near the
236 beginning of the file.
237
238 Documents conformant to HTML 2.0, HTML 3.2 and HTML 4.0 will start
239 with a DOCTYPE declaration "&lt;!DOCTYPE HTML" near the beginning,
240 before the "&lt;html". These dialects are case insensitive. Files may
241 start with white space, comments (introduced by "&lt;!--" ), or
242 processing instructions (introduced by "&lt;?") prior to the DOCTYPE
243 declaration.
244
245 XHTML documents (optionally) start with an XML declaration which
246 begins with "&lt;?xml" and are required to have a DOCTYPE declaration
247 "&lt;!DOCTYPE html".
248
249 <span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. Charset default rules</span>
250
251 The use of an explicit charset parameter is strongly recommended.
252 While [<a href="#ref-MIME" title="&quot;Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types&quot;">MIME</a>] specifies "The default character set, which must be
253 assumed in the absence of a charset parameter, is US-ASCII." [<a href="#ref-HTTP" title="&quot;Hypertext Transfer Protocol -- HTTP/1.1&quot;">HTTP</a>]
254 <a href="#section-3.7.1">Section 3.7.1</a>, defines that "media subtypes of the 'text' type are
255 defined to have a default charset value of 'ISO-8859-1'". <a href="#section-19.3">Section</a>
256 <a href="#section-19.3">19.3</a> of [<a href="#ref-HTTP" title="&quot;Hypertext Transfer Protocol -- HTTP/1.1&quot;">HTTP</a>] gives additional guidelines. Using an explicit
257 charset parameter will help avoid confusion.
258
259 Using an explicit charset parameter also takes into account that the
260 overwhelming majority of deployed browsers are set to use something
261 else than 'ISO-8859-1' as the default; the actual default is either a
262 corporate character encoding or character encodings widely deployed
263 in a certain national or regional community. For further
264 considerations, please also see Section 5.2 of [<a href="#ref-HTML40" title="&quot;HTML 4.0 Specification&quot;">HTML40</a>].
265
266
267
268
269
270
271
272
273
274
275
276 <span class="grey">Connolly &amp; Masinter Informational [Page 5]</span></pre>
277 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
278 <span class="grey"><a href="./rfc2854">RFC 2854</a> The 'text/html' Media Type June 2000</span>
279
280
281 <span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. Security Considerations</span>
282
283 [<a href="#ref-HTML401" title="&quot;HTML 4.01 Specification&quot;">HTML401</a>], section B.10, notes various security issues with
284 interpreting anchors and forms in HTML documents.
285
286 In addition, the introduction of scripting languages and interactive
287 capabilities in HTML 4.0 introduced a number of security risks
288 associated with the automatic execution of programs written by the
289 sender but interpreted by the recipient. User agents executing such
290 scripts or programs must be extremely careful to insure that
291 untrusted software is executed in a protected environment.
292
293 <span class="h2"><a class="selflink" id="section-8" href="#section-8">8</a>. Authors' Addresses</span>
294
295 Daniel W. Connolly
296 World Wide Web Consortium (W3C)
297 MIT Laboratory for Computer Science
298 545 Technology Square
299 Cambridge, MA 02139, U.S.A.
300
301 EMail: [email protected]
302 <a href="http://www.w3.org/People/Connolly/">http://www.w3.org/People/Connolly/</a>
303
304
305 Larry Masinter
306 AT&amp;T
307 75 Willow Road
308 Menlo Park, CA 94025
309
310 EMail: [email protected]
311 <a href="http://larry.masinter.net">http://larry.masinter.net</a>
312
313 <span class="h2"><a class="selflink" id="section-9" href="#section-9">9</a>. References</span>
314
315 [<a id="ref-CLIMAPS">CLIMAPS</a>] Seidman, J., "A Proposed Extension to HTML: Client-Side
316 Image Maps", <a href="./rfc1980">RFC 1980</a>, August 1996.
317
318 [<a id="ref-FORMDATA">FORMDATA</a>] Masinter, L., "Returning Values from Forms:
319 multipart/form-data", <a href="./rfc2388">RFC 2388</a>, August 1998.
320
321 [<a id="ref-HTML20">HTML20</a>] Berners-Lee, T. and D. Connolly, "Hypertext Markup
322 Language - 2.0", <a href="./rfc1866">RFC 1866</a>, November 1995.
323
324 [<a id="ref-HTML30">HTML30</a>] Raggett, D., "HyperText Markup Language Specification
325 Version 3.0", September 1995. (Available at
326 &lt;<a href="http://www.w3.org/MarkUp/html3/CoverPage">http://www.w3.org/MarkUp/html3/CoverPage</a>&gt;).
327
328
329
330
331
332 <span class="grey">Connolly &amp; Masinter Informational [Page 6]</span></pre>
333 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
334 <span class="grey"><a href="./rfc2854">RFC 2854</a> The 'text/html' Media Type June 2000</span>
335
336
337 [<a id="ref-HTML32">HTML32</a>] Raggett, D., "HTML 3.2 Reference Specification", W3C
338 Recomendation, January 1997.
339 Available at &lt;<a href="http://www.w3.org/TR/REC-html32">http://www.w3.org/TR/REC-html32</a>&gt;.
340
341 [<a id="ref-HTML40">HTML40</a>] Raggett, D., et al., "HTML 4.0 Specification", W3C
342 Recommendation, December 1997.
343 Available at &lt;<a href="http://www.w3.org/TR/1998/REC-html40-19980424">http://www.w3.org/TR/1998/REC-html40-</a>
344 <a href="http://www.w3.org/TR/1998/REC-html40-19980424">19980424</a>&gt;
345
346 [<a id="ref-HTML401">HTML401</a>] Raggett, D., et al., "HTML 4.01 Specification", W3C
347 Recommendation, December 1999.
348 Available at &lt;<a href="http://www.w3.org/TR/html401">http://www.w3.org/TR/html401</a>&gt;.
349
350 [<a id="ref-HTTP">HTTP</a>] Gettys, J., Fielding, R., Mogul, J., Frystyk, H.,
351 Masinter, L., Leach, P. and T. Berners-Lee, "Hypertext
352 Transfer Protocol -- HTTP/1.1", <a href="./rfc2616">RFC 2616</a>, June 1999.
353
354 [<a id="ref-I18N">I18N</a>] Yergeau, F., Nicol, G. and M. Duerst,
355 "Internationalization of the Hypertext Markup Language",
356 <a href="./rfc2070">RFC 2070</a>, January 1997.
357
358 [<a id="ref-MHTML">MHTML</a>] Palme, J., Hotmann, A. and N. Shelness, "MIME
359 Encapsulation of Aggregate Documents, such as HTML
360 (MHTML)", <a href="./rfc2557">RFC 2557</a>, March 1999.
361
362 [<a id="ref-MIME">MIME</a>] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
363 Extensions (MIME) Part Two: Media Types", <a href="./rfc2046">RFC 2046</a>,
364 November 1996.
365
366 [<a id="ref-TABLES">TABLES</a>] Raggett, D., "HTML Tables", <a href="./rfc1942">RFC 1942</a>, May 1996.
367
368 [<a id="ref-UPLOAD">UPLOAD</a>] Nebel, E. and L. Masinter, "Form-based File Upload in
369 HTML", <a href="./rfc1867">RFC 1867</a>, November 1995.
370
371 [<a id="ref-URI">URI</a>] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform
372 Resource Identifiers (URI): Generic Syntax", <a href="./rfc2396">RFC 2396</a>,
373 August 1998.
374
375 [<a id="ref-XHTML1">XHTML1</a>] "XHTML 1.0: The Extensible HyperText Markup Language: A
376 Reformulation of HTML 4 in XML 1.0", W3C Recommendation,
377 January 2000. Available at &lt;<a href="http://www.w3.org/TR/xhtml1">http://www.w3.org/TR/xhtml1</a>&gt;.
378
379
380
381
382
383
384
385
386
387
388 <span class="grey">Connolly &amp; Masinter Informational [Page 7]</span></pre>
389 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
390 <span class="grey"><a href="./rfc2854">RFC 2854</a> The 'text/html' Media Type June 2000</span>
391
392
393 <span class="h2"><a class="selflink" id="section-10" href="#section-10">10</a>. Full Copyright Statement</span>
394
395 Copyright (C) The Internet Society (2000). All Rights Reserved.
396
397 This document and translations of it may be copied and furnished to
398 others, and derivative works that comment on or otherwise explain it
399 or assist in its implementation may be prepared, copied, published
400 and distributed, in whole or in part, without restriction of any
401 kind, provided that the above copyright notice and this paragraph are
402 included on all such copies and derivative works. However, this
403 document itself may not be modified in any way, such as by removing
404 the copyright notice or references to the Internet Society or other
405 Internet organizations, except as needed for the purpose of
406 developing Internet standards in which case the procedures for
407 copyrights defined in the Internet Standards process must be
408 followed, or as required to translate it into languages other than
409 English.
410
411 The limited permissions granted above are perpetual and will not be
412 revoked by the Internet Society or its successors or assigns.
413
414 This document and the information contained herein is provided on an
415 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
416 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
417 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
418 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
419 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
420
421 Acknowledgement
422
423 Funding for the RFC Editor function is currently provided by the
424 Internet Society.
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444 Connolly &amp; Masinter Informational [Page 8]
445 </pre>