<?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>25303</bug_id>
          
          <creation_ts>2014-04-10 01:37:26 +0000</creation_ts>
          <short_desc>Small bugs in the descriptions</short_desc>
          <delta_ts>2014-04-17 17:44:00 +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 Parsing and Serialization</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="Arkadiusz Michalski (Spirit)">crimsteam</reporter>
          <assigned_to name="Travis Leithead [MSFT]">travil</assigned_to>
          <cc>art.barstow</cc>
    
    <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>103648</commentid>
    <comment_count>0</comment_count>
    <who name="Arkadiusz Michalski (Spirit)">crimsteam</who>
    <bug_when>2014-04-10 01:37:26 +0000</bug_when>
    <thetext>Hi, I gathered together a few minor bugs:

-----------
https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#dfn-dom-element-insertadjacenthtml
Algorithm for insertAdjacentHTML(position, text) method, step 3:

[3. Let fragment be the result of invoking the fragment parsing
algorithm with text as markup, and parent as the context element.]

We have &quot;parent&quot; but don&apos;t know what exactly it is. We jump to other algo (parameter is context element).

-----------
https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#h3_parsing
In Parsing, first line we have:

[The following steps form the fragment parsing algorithm, whose
arguments are a markup string and a context element.]

Dot (.) at the end should be replaced by a colon (:).

And the same for:
[The following steps form the fragment serializing algorithm, whose arguments are a Node node and a flag require well-formed.]


In the same Parsing algo, but step 5:
[5. Append each node in new children to fragment (in order).]

and some other place (like &quot;XML serialization algorithm&quot;, &quot;produce a DocumentType serialization&quot;, &quot;record the namespace information&quot;)

&quot;in order&quot; should be replaced by &quot;tree order&quot; and linked to DOM spec:
http://dom.spec.whatwg.org/#concept-tree-order. This term is used in
DOM and HTML5 spec.[1]

-----------
DOM in some IDL fragment use extended attributes (like [NewObject] and
[SameObject]):

[Constructor]
interface Document : Node {
 [NewObject] DocumentFragment createDocumentFragment();
}

So, you can do the same for some method:

[Constructor]
interface DOMParser {
    [NewObject] Document parseFromString (DOMString str, SupportedType type);
};

partial interface Range {
 [NewObject] DocumentFragment createContextualFragment(DOMString fragment);
};

-----------
https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#widl-DOMParser-parseFromString-Document-DOMString-str-SupportedType-type
In parseFromString method step 2:

[2. If the previous step didn&apos;t return an error, return the newly
created document and terminate these steps.]

Phrase &quot;and terminate these steps&quot; can be omitted because term
&quot;return/throw&quot; is unambiguous (leave algorithm). This convention is used in
DOM spec.

The same in outerHTML step 3:
[3. If parent is a Document, throw a NoModificationAllowedError
exception and terminate these steps.]

and insertAdjacentHTML step 1:
[1....If context is null or a document, throw a
NoModificationAllowedError and terminate these steps....]

So when we return something or throw error writing &quot;terminate these
steps&quot; is unnecessary. Link to changelog in DOM about this: https://github.com/whatwg/dom/commit/d621e7e595e05808c6c54ea1cf4930cbfcc6316b

-----------
In DOM all error names are written in quotes, so in this spec you can
do similarly:

NoModificationAllowedError =&gt;  &quot;NoModificationAllowedError&quot;
SyntaxError =&gt; &quot;SyntaxError&quot;

and all other case. This names may be linked exactly to some place in error names table (http://dom.spec.whatwg.org/#error-names-0) &lt;&lt; ale names have id.[1]

-----------
https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#h2_extensions-to-the-range-interface
In chapter &quot;8 Extensions to the Range interface&quot;, we have this code in green box:

fragment = range . createContextualFragment(fragment)

Will be better if use &quot;var&quot; at the beginning and different name for
the variable and argument, now we have &quot;fragment&quot;. Just something like
this:

var documentFragment = range . createContextualFragment(fragment)

or without &quot;var&quot; but different name.

-----------
Probably I will fine more small things but first I must jump from WHATWG spec (
continuously developed?) to W3C.

[1] Of course all suggestions linking to a new DOM can be make for W3C spec version.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103765</commentid>
    <comment_count>1</comment_count>
    <who name="Travis Leithead [MSFT]">travil</who>
    <bug_when>2014-04-11 16:28:05 +0000</bug_when>
    <thetext>Thanks for the close inspection of the algorithms. I will attempt to clarify these.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104031</commentid>
    <comment_count>2</comment_count>
    <who name="Arthur Barstow">art.barstow</who>
    <bug_when>2014-04-17 12:20:46 +0000</bug_when>
    <thetext>Travis - I&apos;m going to block a CfC for LC until this bug is fixed. Are there any other open issues or areas of contention (that should) block LC?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104036</commentid>
    <comment_count>3</comment_count>
    <who name="Travis Leithead [MSFT]">travil</who>
    <bug_when>2014-04-17 17:19:14 +0000</bug_when>
    <thetext>(In reply to spiritRKS1910 from comment #0)
&gt; Hi, I gathered together a few minor bugs:
&gt; 
&gt; -----------
&gt; https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#dfn-dom-element-
&gt; insertadjacenthtml
&gt; Algorithm for insertAdjacentHTML(position, text) method, step 3:
&gt; 
&gt; [3. Let fragment be the result of invoking the fragment parsing
&gt; algorithm with text as markup, and parent as the context element.]
&gt; 
&gt; We have &quot;parent&quot; but don&apos;t know what exactly it is. We jump to other algo
&gt; (parameter is context element).

I think &quot;parent&quot; is supposed to be &quot;context&quot;. Context gets the parent under some of the conditions in step 1.


&gt; -----------
&gt; https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#h3_parsing
&gt; In Parsing, first line we have:
&gt; 
&gt; [The following steps form the fragment parsing algorithm, whose
&gt; arguments are a markup string and a context element.]
&gt; 
&gt; Dot (.) at the end should be replaced by a colon (:).
&gt; 
&gt; And the same for:
&gt; [The following steps form the fragment serializing algorithm, whose
&gt; arguments are a Node node and a flag require well-formed.]

Good catch.

 
&gt; In the same Parsing algo, but step 5:
&gt; [5. Append each node in new children to fragment (in order).]
&gt; 
&gt; and some other place (like &quot;XML serialization algorithm&quot;, &quot;produce a
&gt; DocumentType serialization&quot;, &quot;record the namespace information&quot;)
&gt; 
&gt; &quot;in order&quot; should be replaced by &quot;tree order&quot; and linked to DOM spec:
&gt; http://dom.spec.whatwg.org/#concept-tree-order. This term is used in
&gt; DOM and HTML5 spec.[1]

Sounds good. I counted 14 occurrences of &quot;in order&quot; but many of these are referring to following a sequence of steps in order. Two require a link to DOM&apos;s &quot;attribute list&quot; concept. I&apos;ll fix-up the prose to make all occurrences more clear.

&gt; -----------
&gt; DOM in some IDL fragment use extended attributes (like [NewObject] and
&gt; [SameObject]):
&gt; 
&gt; [Constructor]
&gt; interface Document : Node {
&gt;  [NewObject] DocumentFragment createDocumentFragment();
&gt; }
&gt; 
&gt; So, you can do the same for some method:
&gt; 
&gt; [Constructor]
&gt; interface DOMParser {
&gt;     [NewObject] Document parseFromString (DOMString str, SupportedType type);
&gt; };
&gt; 
&gt; partial interface Range {
&gt;  [NewObject] DocumentFragment createContextualFragment(DOMString fragment);
&gt; };

Super. Will do.

&gt; -----------
&gt; https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#widl-DOMParser-
&gt; parseFromString-Document-DOMString-str-SupportedType-type
&gt; In parseFromString method step 2:
&gt; 
&gt; [2. If the previous step didn&apos;t return an error, return the newly
&gt; created document and terminate these steps.]
&gt; 
&gt; Phrase &quot;and terminate these steps&quot; can be omitted because term
&gt; &quot;return/throw&quot; is unambiguous (leave algorithm). This convention is used in
&gt; DOM spec.
&gt; 
&gt; The same in outerHTML step 3:
&gt; [3. If parent is a Document, throw a NoModificationAllowedError
&gt; exception and terminate these steps.]
&gt; 
&gt; and insertAdjacentHTML step 1:
&gt; [1....If context is null or a document, throw a
&gt; NoModificationAllowedError and terminate these steps....]
&gt; 
&gt; So when we return something or throw error writing &quot;terminate these
&gt; steps&quot; is unnecessary. Link to changelog in DOM about this:
&gt; https://github.com/whatwg/dom/commit/d621e7e595e05808c6c54ea1cf4930cbfcc6316b

OK. After removing this phrase it only occurs once in the conformance section, and once in an algorithm which does not involve a return/throw condition. Thanks for the pointer.


&gt; -----------
&gt; In DOM all error names are written in quotes, so in this spec you can
&gt; do similarly:
&gt; 
&gt; NoModificationAllowedError =&gt;  &quot;NoModificationAllowedError&quot;
&gt; SyntaxError =&gt; &quot;SyntaxError&quot;
&gt; 
&gt; and all other case. This names may be linked exactly to some place in error
&gt; names table (http://dom.spec.whatwg.org/#error-names-0) &lt;&lt; ale names have
&gt; id.[1]

Nice cross-linking. Sounds good.

 
&gt; -----------
&gt; https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#h2_extensions-to-
&gt; the-range-interface
&gt; In chapter &quot;8 Extensions to the Range interface&quot;, we have this code in green
&gt; box:
&gt; 
&gt; fragment = range . createContextualFragment(fragment)
&gt; 
&gt; Will be better if use &quot;var&quot; at the beginning and different name for
&gt; the variable and argument, now we have &quot;fragment&quot;. Just something like
&gt; this:
&gt; 
&gt; var documentFragment = range . createContextualFragment(fragment)
&gt; 
&gt; or without &quot;var&quot; but different name.

Agree that this explanatory usage isn&apos;t as good as it could be. I&apos;ll change the name of the variable receiving the return value and the parameter to be less ambiguous.

&gt; -----------
&gt; Probably I will fine more small things but first I must jump from WHATWG
&gt; spec (
&gt; continuously developed?) to W3C.
&gt; 
&gt; [1] Of course all suggestions linking to a new DOM can be make for W3C spec
&gt; version.

Thanks</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104041</commentid>
    <comment_count>4</comment_count>
    <who name="Travis Leithead [MSFT]">travil</who>
    <bug_when>2014-04-17 17:42:50 +0000</bug_when>
    <thetext>Fix committed in the latest editor&apos;s draft:

https://dvcs.w3.org/hg/innerhtml/rev/97f9c81f0990</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104042</commentid>
    <comment_count>5</comment_count>
    <who name="Travis Leithead [MSFT]">travil</who>
    <bug_when>2014-04-17 17:44:00 +0000</bug_when>
    <thetext>(In reply to Art Barstow from comment #2)
&gt; Travis - I&apos;m going to block a CfC for LC until this bug is fixed. Are there
&gt; any other open issues or areas of contention (that should) block LC?

OK, unblocked :-)

No other issues I&apos;m aware of.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>