<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>18395</bug_id>
          
          <creation_ts>2012-07-25 12:28:52 +0000</creation_ts>
          <short_desc>Encoding Sniffing Algorithm: Overrides apply to nested browsing contexts</short_desc>
          <delta_ts>2012-10-02 21:13:37 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>NEEDSINFO</resolution>
          
          
          <bug_file_loc>http://dev.w3.org/html5/spec/Overview#encoding-sniffing-algorithm</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Leif Halvard Silli">xn--mlform-iua</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>xn--mlform-iua</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>71442</commentid>
    <comment_count>0</comment_count>
    <who name="Leif Halvard Silli">xn--mlform-iua</who>
    <bug_when>2012-07-25 12:28:52 +0000</bug_when>
    <thetext>Proposal: Extend the encoding sniffing algorithm with a new
          step after the current first step (about user
          overriding), like so:

     #. If the current document lives in the &apos;nested browsing
        context&apos;[1] of a document in a &apos;parent browsing context&apos;
        whose encoding has been overridden at the request of the
        user, then return the encoding of the parent browsing
        context, and abort these steps. [My note: Doesn&apos;t apply if
        the current doc is XML, [see bug #1], or if it contains the
        BOM, confer Bug 17810/Bug 15359.]

Justification: 

    Currently, when a user agent obeys a user&apos;s request to override the 
encoding of a parent browsing context, then [NB: I did not test the 
relevant version of IE yet: IE8/IE9/IE10], unless the document of the 
child browsing context contains a BOM or [see bug #1] the document is 
an XML document, then they all apply the encoding of the parent 
browsing context to the child browsing context as well.

More data in my related blog post.[2]

[1] http://dev.w3.org/html5/spec/Overview#nested-browsing-context
[2] http://målform.no/blog/white-spots-in-html5-s-encoding-sniffing-algorithm</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75101</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-10-02 19:43:07 +0000</bug_when>
    <thetext>This seems to be already in the spec, as step 6 (&quot;Otherwise, if the Document is in a nested browsing context, return the encoding of the browsing context container&apos;s Document&apos;s character encoding, with the confidence tentative, and abort these steps&quot;). Are you saying it should be moved up? If so, do you have a test that demonstrates that specifically?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75113</commentid>
    <comment_count>2</comment_count>
    <who name="Leif Halvard Silli">xn--mlform-iua</who>
    <bug_when>2012-10-02 21:13:37 +0000</bug_when>
    <thetext>(In reply to comment #1)

Right! Formally this bug is now solved. HOWEVER, some refinement is due: Like Henri [1] and I [2] have said, some refinements are needed:

The encoding of the parent context should not apply when parent and child are of different origins and, also, not if the parent is of an ASCII-incompatible encoding (such as UTF-16).  See my at test cases. [3]

[1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=18474#c3
[2] http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-September/037226.html
[3] http://www.målform.no/blog/utf8files/locale_default_vs_doc_of_parent_browsing_context/</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>