[Bug 12073] New: Permit restricted use of <?xml version="1.0" encoding="UTF-8" ?>

http://www.w3.org/Bugs/Public/show_bug.cgi?id=12073

           Summary: Permit restricted use of <?xml version="1.0"
                    encoding="UTF-8" ?>
           Product: HTML WG
           Version: unspecified
          Platform: PC
               URL: http://dev.w3.org/html5/spec/semantics#charset
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: HTML5 spec (editor: Ian Hickson)
        AssignedTo: ian@hixie.ch
        ReportedBy: xn--mlform-iua@xn--mlform-iua.no
         QAContact: public-html-bugzilla@w3.org
                CC: mike@w3.org, public-html-wg-issue-tracking@w3.org,
                    public-html@w3.org


HTML5 should permit the XML declaration as conforming or conforming but
obsolete, provided ALL the following 3 conditions are met:

1) Regardless of whether the declaration contains the encoding declaration:
   a) It can be used both with an without the encoding declaration;
   b) It is only permitted for UTF-8 or UTF-16 encoded pages;
   c) It may only be used when the page has a page-internal encoding
declaration in a META element or in a BOM;

2) If the XML declaration's encoding declaratation is present, then:
   a) it  can only have the value "UTF-8" or "UTF-16";
   b) it MUST EITHER reflect the encoding value of the META
charset/content-type element, if present;
   c) OR it MUST reflect the encoding declaration of the BOM, if present;

3) comments before DOCTYPE become forbidden;  See bug 12072;
    (And X-UA-Compatible remains forbidden in legal HTML5 syntax.)

JUSTIFICATION - argumetns:

(A) Polyglot Authoring: most XML/XHTML editors out there will auto-insert the
XML declaration, and it is often not so straight forward for authors to make
the editor not do so. The more IE6 disappears, the less purpose is there in
using energy on removing such auto inserted XML declarations.

(B) Same justification as for why HTML5 permits <meta charset="UTF-8"/> in
XHTML5 documents: it makes it easier to move back and forth between XML and
HTML.

(C) the conditions for its use promotes use of UTF-8, which is a strong benefit
that partly outweighs the disadvantages;

(D) It would provide a legal way to trigger quirks-mode in IE6 (and IE6 only!). 
      The XML declaration is already a often adviced method which authors use.
See:
http://www.gunlaug.no/contents/wd_additions_16.html and
http://www.456bereastreet.com/archive/200904/using_an_xml_declaration_triggers_quirks_mode_in_ie_6/
http://css-discuss.incutio.com/wiki/Rendering_Mode
     This, of course, also has a disadvantage: A version of IE could be set in
quirksmode through use of legal HTML5 syntax.
     However, 
     a) It would still be non-conforming of IE6 do go in to quirksmode because
of the XML declaration
     b) the proposal to completely forbid comments before the DOCTYPE  - see
bug 12072 - is far more important and, to a great deal, outweighs the possible
disadvantages to alowing this, restricted, use of the XML declaration.

DISADVANTAGES - discussion:

* A permission to use <?xml version="1.0" encoding="UTF-8" ?> provides a legal
way to offer quirks-mode in IE6. 
   This of course can be seen as a disadvantage. 
    OTOH, it is a behaviour specific to IE6, which is a disappearing browser
and, for whic it is sometimes {but not anymore?} recommended to use
quirks-mode.

ADVANTAGES - discussion:

* if comments before the DOCTYPE are forbidden (see bug 12072),  then the
   proprietary X-UA-COMPATIBLE meta element is largely prevented from 
   having effect in legal HTML5 syntax.  
   See http://www.w3.org/Bugs/Public/show_bug.cgi?id=12072#c1
    Thereby, it is also impossible to use X-UA-Compatible to trigger IE5-mode
in IE8 (and IE9, I assume). (Which could otherwise be a temptation, if the XML
declaration is permitted.)

* one avoids that authors have to invent other means than the XML declartion
for triggering quirks mode in IE6

* the condiditions for its use promotes UTF-8 - you may call it sweetened pill.

CONSIDERATIONS - conforming but obsolete?

* Another option would be to make it conforming but obsolete and with a warning
that it triggers quirks-mode in some legacy UAs. On balance, conforming but
obsoleete is the option that I would prefer.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Tuesday, 15 February 2011 05:05:49 UTC