diff --git a/source b/source
index 8a4dc573e05..7a2887da57c 100644
--- a/source
+++ b/source
@@ -13646,15 +13646,14 @@ interface HTMLMetaElement : HTMLElement {
specified, then the content
attribute must also be
specified. Otherwise, it must be omitted.
The charset
attribute specifies the character
- encoding used by the document. This is a character encoding declaration. If the
- attribute is present in an XML document, its value must be an
- ASCII case-insensitive match for the string "utf-8
" (and the
- document is therefore forced to use UTF-8 as its encoding).
The charset
attribute specifies the character encoding used by the document. This is a character
+ encoding declaration. If the attribute is present, its value must be an ASCII
+ case-insensitive match for the string "utf-8
".
The charset
attribute on the
- meta
element has no effect in XML documents, and is only allowed in order to
- facilitate migration to and from XML.
meta
element has no effect in XML documents, but is allowed in XML documents in order
+ to facilitate migration to and from XML.
There must not be more than one meta
element with a charset
attribute per document.
content
attribute must have a value
that is an ASCII case-insensitive match for a string that consists of: the literal
string "text/html;
", optionally followed by any number of ASCII
- whitespace, followed by the literal string "charset=
", followed by
- one of the labels of the character
- encoding of the character encoding declaration.
+ whitespace, followed by the literal string "charset=utf-8
".
A document must not contain both a meta
element with an http-equiv
attribute in the A character encoding declaration is a mechanism by which the character encoding used to store or transmit a document is specified.
The following restrictions apply to character - encoding declarations:
+The Encoding standard requires use of the UTF-8 character
+ encoding and requires use of the "utf-8
" encoding label
+ to identify it. Those requirements necessitate that the document's character encoding
+ declaration, if it exists, specify an encoding label using an ASCII
+ case-insensitive match for the string "utf-8
". Regardless of whether
+ a character encoding declaration is present or not, the actual character encoding used to store or transmit the
+ document must be UTF-8.
To enforce the above rules, authoring tools must default to using UTF-8 + for newly-created documents.
-The following restrictions also apply:
+In addition, due to a number of restrictions on meta
elements, there can only be
@@ -14759,50 +14761,27 @@ people expect to have work and what is necessary.
If an HTML document does not start with a BOM, and its
encoding is not explicitly given by Content-Type
metadata, and the document is not an iframe
srcdoc
document, then the character encoding used must be
- an ASCII-compatible encoding, and the encoding must be specified using a
- meta
element with a charset
attribute or a
- meta
element with an http-equiv
attribute
- in the Encoding declaration state.
meta
element with a charset
attribute
+ or a meta
element with an http-equiv
+ attribute in the Encoding declaration
+ state.
- A character encoding declaration is required (either in the Content-Type metadata or explicitly in the file) even when all - characters are in the ASCII range, because a character encoding is needed to process non-ASCII - characters entered by the user in forms, in URLs generated by scripts, and so forth.
+A character encoding declaration is required (either in the Content-Type metadata or explicitly in the file) even when all + characters are in the ASCII range, because a character encoding is needed to process non-ASCII + characters entered by the user in forms, in URLs generated by scripts, and so forth.
+ +Using non-UTF-8 encodings can have unexpected results on form submission and URL encodings, + which use the document's character encoding by default.
+If the document is an iframe
srcdoc
document, the document must not have a character encoding declaration. (In
this case, the source is already decoded, since it is part of the document that contained the
iframe
.)
If an HTML document contains a meta
element
- with a charset
attribute or a meta
element
- with an http-equiv
attribute in the Encoding declaration state, then the character
- encoding used must be an ASCII-compatible encoding.
Authors should use UTF-8. Conformance checkers may advise authors against using - legacy encodings.
- - - -Authors must not use encodings that are not defined in the WHATWG Encoding standard. - Additionally, authors should not use ISO-2022-JP.
- -Some encodings that are not defined in the WHATWG Encoding standard use bytes in - the range 0x20 to 0x7E, inclusive, to encode characters other than the corresponding characters in - the range U+0020 to U+007E, inclusive, and represent a potential security vulnerability: a user - agent might end up interpreting supposedly benign plain text content as HTML tags and - JavaScript.
- -Using non-UTF-8 encodings can have unexpected results on form submission and URL - encodings, which use the document's character encoding by default.
-In XML, the XML declaration should be used for inline character encoding information, if necessary.
@@ -57251,7 +57230,6 @@ interface HTMLScriptElement : HTMLElement { [CEReactions] attribute USVString src; [CEReactions] attribute DOMString type; [CEReactions] attribute boolean noModule; - [CEReactions] attribute DOMString charset; [CEReactions] attribute boolean async; [CEReactions] attribute boolean defer; [CEReactions] attribute DOMString? crossOrigin; @@ -57276,16 +57254,16 @@ interface HTMLScriptElement : HTMLElement { case-insensitive match for a JavaScript MIME type, means that the script is a classic script, to be interpreted according to the JavaScript Script top-level production. Classic scripts are affected by the -charset
, async
, and defer
- attributes. Authors should omit the attribute instead of redundantly setting it.
+ async
and defer
+ attributes (as well as the legacy charset
attribute).
+ Authors should omit the attribute instead of redundantly setting it.
Setting the attribute to an ASCII case-insensitive match for the string
"module
" means that the script is a module script, to be
interpreted according to the JavaScript Module top-level
- production. Module scripts are not affected by the charset
and defer
- attributes.
defer
+ attribute (or by the legacy charset
+ attribute).
Setting the attribute to any other value means that the script is a data
block, which is not processed. None of the script
attributes (except HTMLScriptElement : HTMLElement {
spec="JAVASCRIPT">
When used to include data blocks, the data must be embedded
- inline, the format of the data must be given using the type
attribute, and the contents of the script
- element must conform to the requirements defined for the format used. The src
, charset
, type
+ attribute, and the contents of the script
element must conform to the requirements
+ defined for the format used. The src
, async
, nomodule
,
defer
, crossorigin
, nonce
@@ -57334,16 +57311,6 @@ interface HTMLScriptElement : HTMLElement {
specified on module scripts (and will be ignored if it
is).
The charset
attribute gives the character
- encoding of the external script resource. The attribute must not be specified if the src
attribute is not present, or if the script is not a
- classic script. (Module scripts are always
- interpreted as UTF-8.) If the attribute is set, its value must be an ASCII
- case-insensitive match for one of the labels of an
- encoding, and must specify the same encoding as the charset
parameter of the Content-Type
- metadata of the external file, if any.
The Changing the async
and defer
attributes are boolean attributes that indicate how the script should be evaluated. HTMLScriptElement : HTMLElement {
src
, type
, charset
, nomodule
, type
, nomodule
, async
, defer
, crossorigin
, nonce
- and integrity
attributes dynamically has no direct
- effect; these attributes are only used at specific times described below.integrity
attributes dynamically has no direct effect;
+ these attributes are only used at specific times described below. (The same is true for the legacy
+ charset
attribute.
The IDL attributes src
, type
, charset
, defer
, integrity
, and nonce
, must each reflect the respective
@@ -112784,6 +112750,12 @@ if (s = prompt('What is your name?')) {
img
element. If the attribute is present, its value must be the string "0
". CSS should be used instead.
Authors should not specify a charset
attribute on a
+ script
element. If the attribute is present, its value must be an ASCII
+ case-insensitive match for "utf-8
". (This has no effect in a
+ document that conforms to the requirements elsewhere in this standard of being encoded as
+ UTF-8.)
Authors should not specify a language
attribute on a
script
element. If the attribute is present, its value must be an ASCII
case-insensitive match for the string "JavaScript
" and either the
@@ -112843,6 +112815,10 @@ if (s = prompt('What is your name?')) {
The presence of a border
attribute on an
img
element if its value is the string "0
".
The presence of a charset
attribute on a
+ script
element if its value is an ASCII case-insensitive match for
+ "utf-8
".
The presence of a Use an HTTP ` Omit the attribute. Both documents and scripts are required to use UTF-8,
+ so it is redundant to specify it on the Use The The The The language
attribute on a
script
element if its value is an ASCII case-insensitive match for the
string "JavaScript
" and if there is no charset
on link
elements
Content-Type
` header on the linked resource instead.charset
on script
+ elements (except as noted in the previous section)script
element since it inherits from the
+ document.coords
on a
elementsshape
on a
elementsarea
instead of a
for image maps.
partial interface HTMLScriptElement {
+ [CEReactions] attribute DOMString charset;
[CEReactions] attribute DOMString event;
[CEReactions] attribute DOMString htmlFor;
};
- event
IDL attribute of the
- script
element must reflect the element's
- event
content attribute.event
and charset
IDL attributes of the script
element
+ must reflect the respective content attributes of the same name.htmlFor
IDL attribute of the
script
element must reflect the element's
@@ -114373,10 +114356,9 @@ interface External {
charset
parameter may be provided to specify the
document's character encoding, overriding any character encoding declarations in the document other than a Byte Order Mark (BOM). The parameter's value
- must be one of the labels of the character encoding used to serialize the file. utf-8
".
charset
meta
charset
- script
- utf-8
"
checked
input