<?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>15350</bug_id>
          
          <creation_ts>2011-12-27 20:25:43 +0000</creation_ts>
          <short_desc>Range.insertNode() into the middle of a comment</short_desc>
          <delta_ts>2011-12-28 17:15:17 +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>All</rep_platform>
          <op_sys>All</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="Aryeh Gregor">ayg</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>62060</commentid>
    <comment_count>0</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2011-12-27 20:25:43 +0000</bug_when>
    <thetext>Test-case:

data:text/html,&lt;!DOCTYPE html&gt;
&lt;script&gt;
var range = document.createRange();
document.head.appendChild(document.createComment(&quot;abc&quot;));
range.setStart(document.head.lastChild, 2);
range.insertNode(document.createTextNode(&quot;def&quot;));
&lt;/script&gt;

Firefox 12.0a1 and Chrome 17 dev throw HierarchyRequestError.  Opera Next 12.00 alpha splits the comment node, like &lt;!--ab--&gt;def&lt;!--c--&gt;.  I don&apos;t have IE handy to test -- could someone tell me what it does?  The spec says to insert the new text node immediately before the comment node, so you get something like def&lt;!--abc--&gt;.

Throwing seems much saner than what the spec says.  is there any reason not to change the spec to require that, like Gecko/WebKit (and maybe IE too for all I know)?  I don&apos;t know why I specced it this way to start with . . .</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62092</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2011-12-28 09:25:23 +0000</bug_when>
    <thetext>IE9 throws an exception too (the same).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62106</commentid>
    <comment_count>2</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2011-12-28 17:15:17 +0000</bug_when>
    <thetext>Thanks for verifying.

http://dvcs.w3.org/hg/domcore/rev/2bab24def8d9
http://dvcs.w3.org/hg/webapps/rev/0bb9d2672bdd</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>