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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>60316</bug_id>
          
          <creation_ts>2011-05-05 16:57:24 -0700</creation_ts>
          <short_desc>Implement document.innerHTML</short_desc>
          <delta_ts>2012-05-17 11:33:21 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andy Estes">aestes</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>aestes</cc>
    
    <cc>ap</cc>
    
    <cc>darin</cc>
    
    <cc>eric</cc>
    
    <cc>ian</cc>
    
    <cc>mathias</cc>
    
    <cc>rafaelw</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>399195</commentid>
    <comment_count>0</comment_count>
    <who name="Andy Estes">aestes</who>
    <bug_when>2011-05-05 16:57:24 -0700</bug_when>
    <thetext>HTML5 includes an innerHTML attribute in the HTMLDocument interface definition, which should basically behave like the innerHTML on Element. See &lt;http://www.whatwg.org/specs/web-apps/current-work/multipage/apis-in-html-documents.html#dom-innerhtml&gt; for details.

The most interesting difference between Document&apos;s innerHTML and Element&apos;s innerHTML is that the Document case is the only time when parsing a fragment should have no context element. This is important since we have implemented several optimizations to fragment parsing that assume there is always a context element, but there won&apos;t be in this case.

In a W3C bug discussing context-less fragments, it was mentioned that document.innerHTML is prescriptive, rather than descriptive of existing web content. See &lt;http://www.w3.org/Bugs/Public/show_bug.cgi?id=12031&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>399207</commentid>
    <comment_count>1</comment_count>
      <attachid>92505</attachid>
    <who name="Andy Estes">aestes</who>
    <bug_when>2011-05-05 17:10:05 -0700</bug_when>
    <thetext>Created attachment 92505
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>399209</commentid>
    <comment_count>2</comment_count>
      <attachid>92505</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2011-05-05 17:11:00 -0700</bug_when>
    <thetext>Comment on attachment 92505
Patch

OK.  I would have said &quot;if&quot;.  I&apos;m not sure we want to implement document.innerHTML.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>399210</commentid>
    <comment_count>3</comment_count>
    <who name="Andy Estes">aestes</who>
    <bug_when>2011-05-05 17:11:19 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; (From update of attachment 92505 [details])
&gt; OK.  I would have said &quot;if&quot;.  I&apos;m not sure we want to implement document.innerHTML.

Sure, I&apos;ll change that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>399215</commentid>
    <comment_count>4</comment_count>
    <who name="Andy Estes">aestes</who>
    <bug_when>2011-05-05 17:12:52 -0700</bug_when>
    <thetext>Committed r85903: &lt;http://trac.webkit.org/changeset/85903&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>399323</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-05-05 22:16:00 -0700</bug_when>
    <thetext>A read-only document.innerHTML would be a handy shortcut for (new XMLSerializer).serializeToString(document).

What&apos;s the difference between parsing for document.innerHTML setter and DOMParser.parseFromString()? Do we really want them to be different?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>399326</commentid>
    <comment_count>6</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2011-05-05 22:22:33 -0700</bug_when>
    <thetext>Sounds like a question for Hixie (probably in the w3c bug).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>399338</commentid>
    <comment_count>7</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-05-05 22:41:54 -0700</bug_when>
    <thetext>Note that HTML5 doesn&apos;t specify DOMParser and XMLSerializer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>399649</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-05-06 11:11:12 -0700</bug_when>
    <thetext>It&apos;s just a convenience accessor so you can replace the contents of an existing document more easily.

DOMParser and company are being specced here, FWIW:
   http://html5.org/specs/dom-parsing.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>423159</commentid>
    <comment_count>9</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-06-18 12:15:04 -0700</bug_when>
    <thetext>Only a FIXME has been landed, and this bug is still unresolved.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>423168</commentid>
    <comment_count>10</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-06-18 12:22:12 -0700</bug_when>
    <thetext>The reason why I&apos;m asking about DOMParser here is that it works without triggering this assertion. If document.innerHTML is going to trigger it, then maybe its specification is incorrect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>552086</commentid>
    <comment_count>11</comment_count>
    <who name="Mathias Bynens">mathias</who>
    <bug_when>2012-02-08 06:46:29 -0800</bug_when>
    <thetext>The spec has moved to http://html5.org/specs/dom-parsing.html#innerhtml, and sadly, `document.innerHTML` has been removed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>552160</commentid>
    <comment_count>12</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-02-08 08:46:09 -0800</bug_when>
    <thetext>Yay!  So you&apos;re saying we can remove this support from the parser. :)  (Which should simplify things again.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>626691</commentid>
    <comment_count>13</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-05-17 10:34:55 -0700</bug_when>
    <thetext>What&apos;s the status of this bug now, given bug 84646?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>626716</commentid>
    <comment_count>14</comment_count>
    <who name="Rafael Weinstein">rafaelw</who>
    <bug_when>2012-05-17 10:52:22 -0700</bug_when>
    <thetext>I&apos;d say it&apos;s safe to close it. Document.parse() is now the consensus recommendation for contextless parsing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>626740</commentid>
    <comment_count>15</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-05-17 11:14:03 -0700</bug_when>
    <thetext>Let&apos;s close it then!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>626758</commentid>
    <comment_count>16</comment_count>
    <who name="Rafael Weinstein">rafaelw</who>
    <bug_when>2012-05-17 11:33:21 -0700</bug_when>
    <thetext>Hazzah!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>92505</attachid>
            <date>2011-05-05 17:10:05 -0700</date>
            <delta_ts>2011-06-18 12:15:11 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-60316-20110505171004.patch</filename>
            <type>text/plain</type>
            <size>1783</size>
            <attacher name="Andy Estes">aestes</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogODU4OTgKZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwppbmRleCBhOTM1MmU3NmRmY2E2Mjdh
ZDE2OTllMThhMzE2ZGEwMWU3MTc0Mjc0Li5mYjllMzU2Nzk1N2QwMGM4Nj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