W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2012

Re: Implied Context Parsing (DocumentFragment.innerHTML, or similar) proposal details to be sorted out

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 16 May 2012 16:54:33 -0700
Message-ID: <CAAWBYDCcq3X6C=WY_5XAHtWuXLRqqpa6Eb2-MYOo4YPQU4WF6Q@mail.gmail.com>
To: Jonas Sicking <jonas@sicking.cc>
Cc: Rafael Weinstein <rafaelw@google.com>, Yehuda Katz <wycats@gmail.com>, Henri Sivonen <hsivonen@iki.fi>, Webapps WG <public-webapps@w3.org>, Scott González <scott.gonzalez@gmail.com>
On Wed, May 16, 2012 at 4:49 PM, Jonas Sicking <jonas@sicking.cc> wrote:
> So if I understand things correctly, that would mean that:
>
> document.parse("parsed as text<script>parsed as script
> content</script><tr><td>table content</td></tr>");
>
> would return a fragment like:
> #fragment
>  #text "parsed as text"
>  script
>    #text parsed as script content
>  tr
>    td
>      #text table content
>
> Is this correct? The important part here is that the contents of the
> <script> element is parsed according to the rules which normally apply
> when parsing scripts?

Yes.  The initial new contextless parsing mode would just emit the
text at the beginning, process the <script> as if it was in-head,
switch back to the contextless mode, then finally see the <tr> and
switch to "in-table-body".  From then on it's normal HTML processing.

~TJ
Received on Wednesday, 16 May 2012 23:55:22 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:52 GMT