<?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>16635</bug_id>
          
          <creation_ts>2012-04-04 10:58:52 +0000</creation_ts>
          <short_desc>Setting innerHTML on an SVG element will parse into HTML elements. Since innerHTML is available on Element now, we should check if the context element is an SVG element (or MathML element) other than foreignObject (etc) and use the foreign lands insertion</short_desc>
          <delta_ts>2013-06-07 22:10:24 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#parsing-html-fragments</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Robin Berjon">robin</assigned_to>
          <cc>annevk</cc>
    
    <cc>cam</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>robin</cc>
    
    <cc>silviapfeiffer1</cc>
    
    <cc>travil</cc>
    
    <cc>zcorpan</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>66418</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-04-04 10:58:52 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html
Multipage: http://www.whatwg.org/C#parsing-html-fragments
Complete: http://www.whatwg.org/c#parsing-html-fragments

Comment:
Setting innerHTML on an SVG element will parse into HTML elements. Since
innerHTML is available on Element now, we should check if the context element
is an SVG element (or MathML element) other than foreignObject (etc) and use
the foreign lands insertion mode.

Posted from: 88.131.66.80 by simonp@opera.com
User agent: Opera/9.80 (Macintosh; Intel Mac OS X 10.7.2; U; en) Presto/2.10.229 Version/11.62</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66419</commentid>
    <comment_count>1</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2012-04-04 11:19:56 +0000</bug_when>
    <thetext>That&apos;d be awesome if it could work, yeah.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66430</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-04-05 07:11:43 +0000</bug_when>
    <thetext>Cases to consider:

context element is one of the following

&lt;svg&gt;&lt;g/&gt;&lt;foreignobject/&gt;&lt;desc/&gt;&lt;title/&gt;&lt;/svg&gt;
&lt;math&gt;&lt;mrow/&gt;&lt;mi/&gt;&lt;mo/&gt;&lt;mn/&gt;&lt;ms/&gt;&lt;mtext/&gt;&lt;annotation-xml/&gt;&lt;annotatoin-xml encoding=text/html /&gt;&lt;/math&gt;

markup is one of the following

&quot;&lt;b&gt;x&quot;
&quot;&lt;svg&gt;&quot;
&quot;&lt;p&gt;&quot;
&quot;&lt;/svg&gt;&quot;
&quot;&lt;mglyph&gt;&quot;
&quot;&lt;malignmark&gt;&quot;
...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66431</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-04-05 07:38:07 +0000</bug_when>
    <thetext>http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1451</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66439</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-04-05 12:53:12 +0000</bug_when>
    <thetext>Desired outcome, I think (using html5lib test syntax to indicate namespace):

&lt;math math&gt;.innerHTML = &apos;&lt;b&gt;x&apos;;
| &lt;math math&gt;
|   &lt;b&gt;
|     &quot;x&quot;

&lt;math math&gt;.innerHTML = &apos;&lt;foo&gt;&lt;b&gt;x&apos;;
| &lt;math math&gt;
|   &lt;math foo&gt;
| &lt;b&gt;
|   &quot;x&quot;

i.e. the &quot;break out&quot; step needs to be changed to not pop the current element if that&apos;s an html element (fragment case), but should otherwise work like normal.

&lt;math mi&gt;.innerHTML = &apos;&lt;b&gt;x&apos;;
| &lt;math mi&gt;
|   &lt;b&gt;
|     &quot;x&quot;

&lt;math mi&gt;.innerHTML = &apos;&lt;foo&gt;&lt;b&gt;x&apos;;
| &lt;math mi&gt;
|   &lt;foo&gt;
|     &lt;b&gt;
|       &quot;x&quot;

&lt;math mi&gt;.innerHTML = &apos;&lt;mglyph&gt;&apos;;
| &lt;math mi&gt;
|   &lt;math mglyph&gt;

&lt;math mi&gt;.innerHTML = &apos;&lt;malignmark&gt;&apos;;
| &lt;math mi&gt;
|   &lt;math malignmark&gt;

&lt;math mi&gt;.innerHTML = &apos;&lt;svg&gt;&apos;;
| &lt;math mi&gt;
|   &lt;svg svg&gt;

&lt;math annotation-xml&gt;.innerHTML = &apos;&lt;svg&gt;&apos;;
| &lt;math annotation-xml&gt;
|   &lt;svg svg&gt;

&lt;math annotation-xml&gt;.innerHTML = &apos;&lt;foo&gt;&apos;;
| &lt;math annotation-xml&gt;
|   &lt;math foo&gt;

&lt;math annotation-xml encoding=&quot;text/html&quot;&gt;.innerHTML = &apos;&lt;foo&gt;&apos;;
| &lt;math annotation-xml&gt;
|   encoding=&quot;text/html&quot;
|   &lt;foo&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66440</commentid>
    <comment_count>5</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-04-05 12:53:13 +0000</bug_when>
    <thetext>Desired outcome, I think (using html5lib test syntax to indicate namespace):

&lt;math math&gt;.innerHTML = &apos;&lt;b&gt;x&apos;;
| &lt;math math&gt;
|   &lt;b&gt;
|     &quot;x&quot;

&lt;math math&gt;.innerHTML = &apos;&lt;foo&gt;&lt;b&gt;x&apos;;
| &lt;math math&gt;
|   &lt;math foo&gt;
| &lt;b&gt;
|   &quot;x&quot;

i.e. the &quot;break out&quot; step needs to be changed to not pop the current element if that&apos;s an html element (fragment case), but should otherwise work like normal.

&lt;math mi&gt;.innerHTML = &apos;&lt;b&gt;x&apos;;
| &lt;math mi&gt;
|   &lt;b&gt;
|     &quot;x&quot;

&lt;math mi&gt;.innerHTML = &apos;&lt;foo&gt;&lt;b&gt;x&apos;;
| &lt;math mi&gt;
|   &lt;foo&gt;
|     &lt;b&gt;
|       &quot;x&quot;

&lt;math mi&gt;.innerHTML = &apos;&lt;mglyph&gt;&apos;;
| &lt;math mi&gt;
|   &lt;math mglyph&gt;

&lt;math mi&gt;.innerHTML = &apos;&lt;malignmark&gt;&apos;;
| &lt;math mi&gt;
|   &lt;math malignmark&gt;

&lt;math mi&gt;.innerHTML = &apos;&lt;svg&gt;&apos;;
| &lt;math mi&gt;
|   &lt;svg svg&gt;

&lt;math annotation-xml&gt;.innerHTML = &apos;&lt;svg&gt;&apos;;
| &lt;math annotation-xml&gt;
|   &lt;svg svg&gt;

&lt;math annotation-xml&gt;.innerHTML = &apos;&lt;foo&gt;&apos;;
| &lt;math annotation-xml&gt;
|   &lt;math foo&gt;

&lt;math annotation-xml encoding=&quot;text/html&quot;&gt;.innerHTML = &apos;&lt;foo&gt;&apos;;
| &lt;math annotation-xml&gt;
|   encoding=&quot;text/html&quot;
|   &lt;foo&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66441</commentid>
    <comment_count>6</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-04-05 12:55:59 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; &lt;math math&gt;.innerHTML = &apos;&lt;foo&gt;&lt;b&gt;x&apos;;
&gt; | &lt;math math&gt;
&gt; |   &lt;math foo&gt;
&gt; | &lt;b&gt;
&gt; |   &quot;x&quot;

Oops. I meant this:

&lt;math math&gt;.innerHTML = &apos;&lt;foo&gt;&lt;b&gt;x&apos;;
| &lt;math math&gt;
|   &lt;math foo&gt;
|   &lt;b&gt;
|     &quot;x&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70310</commentid>
    <comment_count>7</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-07-18 07:18:01 +0000</bug_when>
    <thetext>This bug was cloned to create bug 17924 as part of operation convergence.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72219</commentid>
    <comment_count>8</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2012-08-15 17:13:21 +0000</bug_when>
    <thetext>Filter on [Idon&apos;tcareaboutHTMLWGbugspam].</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85755</commentid>
    <comment_count>9</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2013-04-08 22:43:14 +0000</bug_when>
    <thetext>Added WHATWG patch for this, which addresses part of the bug but breaks a test, see bug 17924.

Applied:
https://github.com/w3c/html/commit/033f3a69ce7b47d0445917869916b1177e4461cd</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88927</commentid>
    <comment_count>10</comment_count>
    <who name="Travis Leithead [MSFT]">travil</who>
    <bug_when>2013-06-07 22:10:24 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are
satisfied with this response, please change the state of this bug to CLOSED. If
you have additional information and would like the Editor to reconsider, please
reopen this bug. If you would like to escalate the issue to the full HTML
Working Group, please add the TrackerRequest keyword to this bug, and suggest
title and text for the Tracker Issue; or you may create a Tracker Issue
yourself, if you are able to do so. For more details, see this document:


   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: Applied WHATWG Patch that fixes this issue to W3C spec

See: https://github.com/w3c/html/commit/9c5293d8c754cbe69fdcbaccd7bb1e3616f4de1d</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>