For compatibility with WebKit and Blink, honor the character encoding
declared using the XML declaration syntax in text/html.
For reasons explained in https://hsivonen.fi/utf-8-detection/
other encodings, UTF-8 isn't detected from content, so with the demise
of Trident and EdgeHTML (which don't honor the XML declaration syntax
in text/html), <?xml version="1.0" encoding="UTF-8"?> has become a
more notable Web compat problem for us. With non-Latin scripts, the
failure mode is particularly bad for a Web compat problem: The text is
That is, this isn't a feature for Web authors to use. This is to
address a push factor for users when authors do use this feature.
# Platform coverage
To be enabled unconditionally.
# DevTools bug
No integration needed.
# Other browsers
WebKit has had this behavior for a very long time and didn't remove it
when HTML parsing was standardized.
Blink inherited this from WebKit upon forking.
Trident and EdgeHTML don't have this; their demise changed the balance
for this feature.
contains tests which are
wrapped for WPT as part of the Gecko patch.