<?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>27488</bug_id>
          
          <creation_ts>2014-12-03 00:09:45 +0000</creation_ts>
          <short_desc>Steps 14-5 and 17-5 of the DOM 4 Range cloning algorithm appear to be incorrect.</short_desc>
          <delta_ts>2014-12-09 08:34:51 +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>other</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>donjjordan</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>115815</commentid>
    <comment_count>0</comment_count>
    <who name="">donjjordan</who>
    <bug_when>2014-12-03 00:09:45 +0000</bug_when>
    <thetext>Step 14 reads in part:

&lt;snip&gt;
14. Otherwise, if first partially contained child is not null:
    1. Let *clone* be a clone of first partially contained child.
    2. Append *clone* to *fragment*.
    3. Let *subrange* be a new range whose start is....
    4. Let *subfragment* be the result of cloning *subrange*.
    5. Append *subfragment* to *fragment*.
&lt;/snip&gt;

And step 17 reads in part:

&lt;snip&gt;
17. Otherwise, if last partially contained child is not null:
    1. Let *clone* be a clone of last partially contained child.
    2. Append *clone* to *fragment*.
    3. Let *subrange* be a new range whose start is....
    4. Let *subfragmen*t be the result of cloning *subrange*.
    5. Append *subfragment* to *fragment*.
&lt;/snip&gt;

Shouldn&apos;t sub-step 5 in both cases read &quot;Append *subfragment* to *clone*&quot;? The subfragment needs to be appended to the clone created in steps 1 and 2.  Otherwise, the hierarchy of the cloned range is lost.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>115816</commentid>
    <comment_count>1</comment_count>
    <who name="">donjjordan</who>
    <bug_when>2014-12-03 00:21:02 +0000</bug_when>
    <thetext>I&apos;m referring specifically to these instructions:

http://w3c.github.io/dom/#concept-range-clone

Following sub-step 5 as written, makes all cloned nodes children of the root DocumentFragment rather than reproducing the tree hierarchy.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>115987</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-12-06 21:55:11 +0000</bug_when>
    <thetext>Yeah that seems correct. Could you tell me how you&apos;d like to appear in the acknowledgments section?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>115988</commentid>
    <comment_count>3</comment_count>
    <who name="">donjjordan</who>
    <bug_when>2014-12-06 22:55:33 +0000</bug_when>
    <thetext>Just use my real name: Don Jordan.  Glad I could be if some assistance.

BTW - I had a couple of questions about some other things in the DOM 4 specification. Is there a good forum or mailing list I can post the questions?  Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116006</commentid>
    <comment_count>4</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-12-08 10:33:23 +0000</bug_when>
    <thetext>This was also a problem for #concept-range-extract.

https://github.com/whatwg/dom/commit/4b102a2ba6af3b69244b551cc675dabc9fceb93e</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116027</commentid>
    <comment_count>5</comment_count>
    <who name="">donjjordan</who>
    <bug_when>2014-12-08 22:17:53 +0000</bug_when>
    <thetext>Yes. I was going to bring that up, but you beat me to it. :) 

I&apos;m in the finishing stages of writing an implementation of the DOM 4 specification, from scratch, in &quot;Modern&quot; C++ for a project at work. All the classes have a full suite of tests for them as well. I&apos;ve combed over just about every word in your new write-up of the specification. So, basically, I&apos;ve been idiot testing the document for the past 4 months. I have everything implemented except for the MutationObservers (which I am working on now) and the match method in the Element interface. I have to delve into the CSS selector queries for that. I&apos;m also planning to to make my DOM implementation thread safe.  I&apos;ve been busy.

The Range class was the only one that I had some difficulty with and I do have a couple of questions regarding it. That&apos;s why I asked about a forum or something of the same sort.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116042</commentid>
    <comment_count>6</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-12-09 08:34:51 +0000</bug_when>
    <thetext>Your implementation sounds cool. Sorry about forgetting to answer your question. http://lists.w3.org/Archives/Public/www-dom/ or the WHATWG mailing list.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>