<?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>5815</bug_id>
          
          <creation_ts>2008-06-27 11:59:53 +0000</creation_ts>
          <short_desc>foreignObject in the SVG namespace should be scoping</short_desc>
          <delta_ts>2010-10-04 13:54:45 +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>pre-LC1 HTML5 spec (editor: Ian Hickson)</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>NoReply</keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Henri Sivonen">hsivonen</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</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>20958</commentid>
    <comment_count>0</comment_count>
    <who name="Henri Sivonen">hsivonen</who>
    <bug_when>2008-06-27 11:59:53 +0000</bug_when>
    <thetext>(This bug pertains to XXXSVG comments in the Editor&apos;s Draft.)

First consider:
&lt;!DOCTYPE html&gt;&lt;body&gt;foo&lt;math&gt;&lt;mtext&gt;&lt;i&gt;baz&lt;/i&gt;&lt;/mtext&gt;&lt;annotation-xml&gt;&lt;svg&gt;&lt;desc&gt;&lt;b&gt;eggs&lt;/b&gt;&lt;/desc&gt;&lt;g&gt;&lt;foreignObject&gt;&lt;P&gt;spam&lt;TABLE&gt;&lt;tr&gt;&lt;td&gt;&lt;img&gt;&lt;/td&gt;&lt;/table&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;g&gt;quux&lt;/g&gt;&lt;/svg&gt;&lt;/annotation-xml&gt;&lt;/math&gt;bar

This parses sanely to:
| &lt;!DOCTYPE html&gt;
| &lt;html&gt;
|   &lt;head&gt;
|   &lt;body&gt;
|     &quot;foo&quot;
|     &lt;math math&gt;
|       &lt;math mtext&gt;
|         &lt;i&gt;
|           &quot;baz&quot;
|       &lt;math annotation-xml&gt;
|         &lt;svg svg&gt;
|           &lt;svg desc&gt;
|             &lt;b&gt;
|               &quot;eggs&quot;
|           &lt;svg g&gt;
|             &lt;svg foreignObject&gt;
|               &lt;p&gt;
|                 &quot;spam&quot;
|               &lt;table&gt;
|                 &lt;tbody&gt;
|                   &lt;tr&gt;
|                     &lt;td&gt;
|                       &lt;img&gt;
|           &lt;svg g&gt;
|             &quot;quux&quot;
|     &quot;bar&quot;


Now consider:
&lt;!DOCTYPE html&gt;&lt;body&gt;&lt;p&gt;foo&lt;math&gt;&lt;mtext&gt;&lt;i&gt;baz&lt;/i&gt;&lt;/mtext&gt;&lt;annotation-xml&gt;&lt;svg&gt;&lt;desc&gt;&lt;b&gt;eggs&lt;/b&gt;&lt;/desc&gt;&lt;g&gt;&lt;foreignObject&gt;&lt;P&gt;spam&lt;TABLE&gt;&lt;tr&gt;&lt;td&gt;&lt;img&gt;&lt;/td&gt;&lt;/table&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;g&gt;quux&lt;/g&gt;&lt;/svg&gt;&lt;/annotation-xml&gt;&lt;/math&gt;bar

This parses to:
#document
| &lt;!DOCTYPE html&gt;
| &lt;html&gt;
|   &lt;head&gt;
|   &lt;body&gt;
|     &lt;p&gt;
|       &quot;foo&quot;
|       &lt;math math&gt;
|         &lt;math mtext&gt;
|           &lt;i&gt;
|             &quot;baz&quot;
|         &lt;math annotation-xml&gt;
|           &lt;svg svg&gt;
|             &lt;svg desc&gt;
|               &lt;b&gt;
|                 &quot;eggs&quot;
|             &lt;svg g&gt;
|               &lt;svg foreignObject&gt;
|     &lt;p&gt;
|       &quot;spam&quot;
|     &lt;table&gt;
|       &lt;tbody&gt;
|         &lt;tr&gt;
|           &lt;td&gt;
|             &lt;img&gt;
|     &lt;g&gt;
|       &quot;quux&quot;
|     &quot;bar&quot;

This is badness. The reasonable way to fix is the make foreignObject scoping when it has been assigned to the SVG namespace. I know this violates a design axiom, but not making foreignObject scoping has too counter-intuitive consequences.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20959</commentid>
    <comment_count>1</comment_count>
    <who name="Henri Sivonen">hsivonen</who>
    <bug_when>2008-06-27 12:43:14 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; The reasonable way to fix is the make foreignObject scoping
&gt; when it has been assigned to the SVG namespace. 

I deployed this fix at http://parsetree.validator.nu/ to allow experimentation with the effects of this change.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20969</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2008-06-27 19:26:22 +0000</bug_when>
    <thetext>I don&apos;t know that it&apos;s that bad... do we want to allow nested paragraphs like that? The semantics seem dubious.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20974</commentid>
    <comment_count>3</comment_count>
    <who name="Henri Sivonen">hsivonen</who>
    <bug_when>2008-06-28 12:28:22 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; I don&apos;t know that it&apos;s that bad...

It&apos;s bad because it spectacularly fails to adhere to the principle of least surprise. It is reasonable to assume that you can put an SVG subtree anywhere that an &lt;img&gt; could go. It is also reasonable to assume that the kind of things you can do in a &lt;td&gt; you can also do in a &lt;foreignObject&gt;. Currently, it appears like this is the case for some things, but then if you change things a little bit, the parse tree becomes fundamentally different in a very rendering-relevant way.

&gt; do we want to allow nested paragraphs like that? 

Yes. :-)

&gt; The semantics seem dubious.

As far as I can tell, given how paragraphs have been defined since December, the semantics are the same with an explicit outer &lt;p&gt; or without. :-)

Anyway, I don&apos;t buy semantic arguments: The rule for where you can put an SVG subtree should be simple. The rule for what you can put in a foreignObject should be simple (and intuitively, it would be really weird not to be able to use &lt;p&gt; in there). The two rules should be composable without counter-intuitive consequences.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20975</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2008-06-29 08:00:13 +0000</bug_when>
    <thetext>How about:

   &lt;table&gt;
     &lt;tr&gt;
       &lt;td&gt;
         &lt;math&gt; &lt;mi&gt; x
       &lt;td&gt;
          ...
   &lt;/table&gt;

Should that &lt;td&gt; close the &lt;mi&gt; and &lt;math&gt; elements?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20980</commentid>
    <comment_count>5</comment_count>
    <who name="Henri Sivonen">hsivonen</who>
    <bug_when>2008-06-29 09:52:33 +0000</bug_when>
    <thetext>It probably should. The expectations for mi and foreignObject are different. The expectation (well, mine at least) for mi is that it takes inline/phrase-level content. The expectation for foregeignObject is that a whole subworld lives in there.

As for SVG desc, the expectations aren&apos;t so clear.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20981</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2008-06-29 10:11:23 +0000</bug_when>
    <thetext>So in:
   &lt;table&gt;
    &lt;td&gt;
     &lt;svg&gt;
      &lt;foreignObject&gt;
    &lt;td&gt;

...you want the second &lt;td&gt; to not have any effect?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20982</commentid>
    <comment_count>7</comment_count>
    <who name="Henri Sivonen">hsivonen</who>
    <bug_when>2008-06-29 11:01:29 +0000</bug_when>
    <thetext>(In reply to comment #6)
&gt; So in:
&gt;    &lt;table&gt;
&gt;     &lt;td&gt;
&gt;      &lt;svg&gt;
&gt;       &lt;foreignObject&gt;
&gt;     &lt;td&gt;
&gt; 
&gt; ...you want the second &lt;td&gt; to not have any effect?

That&apos;s not what I want:
http://parsetree.validator.nu/?parser=html5&amp;content=%3Ctable%3E%3Ctd%3E%3Csvg%3E%3CforeignObject%3E%3Ctd%3E%0D%0A

What I&apos;m suggesting is making &quot;have element in scope&quot; sensitive to foreignObject in the SVG namespace. I am not suggesting changes to the &quot;have element in table scope&quot; variant.

Specifically, I am suggesting that the list in step 4 under &apos;have an element in scope&apos; be amended with the item &quot;foreignObject in the SVG namespace&quot;.

(Aside: It would be an editorial improvement to write the &quot;have element in scope&quot; and &quot;have element in table scope&quot; algorithms separately.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20983</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2008-06-29 21:22:41 +0000</bug_when>
    <thetext>Interesting. Ok, I&apos;ll look into it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21004</commentid>
    <comment_count>9</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2008-07-01 00:24:15 +0000</bug_when>
    <thetext>r1837; commented out in r1838.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32966</commentid>
    <comment_count>10</comment_count>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2010-03-14 13:14:46 +0000</bug_when>
    <thetext>This bug predates the HTML Working Group Decision Policy.

If you are satisfied with the resolution of this bug, 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

This bug is now being moved to VERIFIED. Please respond within two weeks. If this bug is not closed, reopened or escalated within two weeks, it may be marked as NoReply and will no longer be considered a pending comment.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>