<?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>27743</bug_id>
          
          <creation_ts>2015-01-05 00:18:35 +0000</creation_ts>
          <short_desc>It would be clearer if Documents had mode and type explicitly included in their list of &quot;internal slots&quot;</short_desc>
          <delta_ts>2015-08-03 10:08:22 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>DOM</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></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="Domenic Denicola">d</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>mike</cc>
    
    <cc>www-dom</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>116773</commentid>
    <comment_count>0</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2015-01-05 00:18:35 +0000</bug_when>
    <thetext>https://dom.spec.whatwg.org/#interface-document

[[
A document is assumed to be an XML document unless it is flagged as being an HTML document. Whether a document is an HTML document or an XML document affects the behavior of certain APIs. 

A document is always set to one of three modes: no-quirks mode, the default; quirks mode, used typically for legacy documents; and limited-quirks mode. Unless stated otherwise, a document must be in no-quirks mode. 
]]

It would be good to include these &quot;type&quot; and &quot;mode&quot; variables in the list of things associated to a document, viz. &quot;Each document has an associated encoding, content type, and URL.&quot;

They are later referenced in https://dom.spec.whatwg.org/#concept-node-clone in a way that encourages them to be thought of the same way.

From an ES perspective, I&apos;d say that mode/type are internal slots, just as encoding, content type, and URL are. I am working to bring jsdom up to spec in this regard and I found myself assigning doc._mode and doc._type properties alongside doc._encoding, doc._contentType, and doc._url. (I&apos;m not suggesting switching to internal slot notation, but just using it as a point of view that might be helpful.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116779</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-01-05 07:43:43 +0000</bug_when>
    <thetext>Can you convince Ian this is a good idea? This would mainly impact the HTML specification at this point (from which these concepts originate).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116790</commentid>
    <comment_count>2</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2015-01-05 16:37:06 +0000</bug_when>
    <thetext>I am mainly just suggesting a minor editorial tweak. Namely, replace the current text with:

[[

Each document has an associated encoding, content type, URL, type, and mode.

Unless stated otherwise, a document&apos;s encoding is the utf-8 encoding, its content type is &quot;application/xml&quot;, and its URL is &quot;about:blank&quot;.

A document&apos;s type is either XML or HTML; we say it is an &quot;XML document&quot; or &quot;HTML document&quot; respectively. A document is assumed to be an XML document unless it is flagged as being an HTML document. Whether a document is an HTML document or an XML document affects the behavior of certain APIs.

A document&apos;s mode is one of: no-quirks mode, the default; quirks mode, used typically for legacy documents; and limited-quirks mode. Unless stated otherwise, a document must be in no-quirks mode.
]]

Then you could amend the concept-node-clone to say

&gt; Its encoding, content type, URL, its mode, and its type

instead of the current

&gt; Its encoding, content type, URL, its mode (quirks mode, limited quirks mode, or no-quirks mode), and its type (XML document or HTML document).

The main benefit here is that saying &quot;Each document has an associated encoding, content type, URL, type, and mode&quot; instead of &quot;Each document has an associated encoding, content type, and URL&quot; seems more honest.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116791</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-01-05 16:43:27 +0000</bug_when>
    <thetext>Mkay, I guess we could add slots and keep the existing phrases for compatibility...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122383</commentid>
    <comment_count>4</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-08-03 10:08:22 +0000</bug_when>
    <thetext>https://github.com/whatwg/dom/commit/8f812e6b16ba31270ba60568fb0bdbb78949348e

Thank you for this suggestion.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>