Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[c] (0) Rewrite the rules for 'transparent' so that you can't put a <…
…param> in an <ins> in an <object> (or similar things).

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=11363

git-svn-id: http://svn.whatwg.org/webapps@5732 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jan 1, 2011
1 parent 007ff0d commit 102b979
Show file tree
Hide file tree
Showing 3 changed files with 176 additions and 39 deletions.
77 changes: 62 additions & 15 deletions complete.html
Expand Up @@ -221,7 +221,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1>Web Applications 1.0</h1>
<h2 class="no-num no-toc">Draft Standard &mdash; 31 December 2010</h2>
<h2 class="no-num no-toc">Draft Standard &mdash; 1 January 2011</h2>
</hgroup><p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
<p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
<!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
Expand Down Expand Up @@ -10918,28 +10918,75 @@ <h6 id=interactive-content-0><span class=secno>3.2.5.1.7 </span>Interactive cont
<h5 id=transparent-content-models><span class=secno>3.2.5.2 </span>Transparent content models</h5>

<p>Some elements are described as <dfn id=transparent>transparent</dfn>; they have
"transparent" in the description of their content model.</p>

<p>When a content model includes a part that is "transparent", those
parts must not contain content that would not be conformant if all
transparent elements in the tree were replaced, in their parent
element, by the children in the "transparent" part of their content
model, retaining order.</p>
"transparent" in the description of their content model. The content
model of a <a href=#transparent>transparent</a> element is derived from the
content model of its parent element: the elements required in the
part of the content model that is "transparent" are the same
elements as required in the part of the content model of the parent
of the transparent element in which the transparent element finds
itself.</p>

<div class=example>

<p>For instance, an <code><a href=#the-ins-element>ins</a></code> element inside a
<code><a href=#the-ruby-element>ruby</a></code> element cannot contain an <code><a href=#the-rt-element>rt</a></code>
element, because the part of the <code><a href=#the-ruby-element>ruby</a></code> element's
content model that allows <code><a href=#the-ins-element>ins</a></code> elements is the part
that allows <a href=#phrasing-content>phrasing content</a>, and the <code><a href=#the-rt-element>rt</a></code>
element is not <a href=#phrasing-content>phrasing content</a>.</p>

</div>

<!--(as far as I can tell, there's no way to violate this requirement
without first violating the earlier requirement)
<p>Furthermore, when a content model includes a part that is
"transparent", those parts must not contain content that would not
be conformant if all transparent elements in the tree were replaced,
in their parent element, by the children in the "transparent" part
of their content model, retaining order.</p>

<div class="example">

<p>Consider the following markup fragment:</p>

<pre>&lt;p&gt;Hello &lt;a href="world.html"&gt;&lt;em&gt;wonderful&lt;/em&gt; world&lt;/a&gt;!&lt;/p&gt;</pre>
<pre>&lt;p>Hello &lt;a href="world.html">&lt;em>wonderful&lt;/em> world&lt;/a>!&lt;/p></pre>

<p>Its DOM looks like the following:</p>

<ul class=domTree><li class=t1><code><a href=#the-p-element>p</a></code><ul><li class=t3><code>#text</code>: <span title="">Hello </span><li class=t1><code><a href=#the-a-element>a</a></code> <span class=t2 title=""><code class="attribute name">href</code>="<code class="attribute value">world.html</code>"</span><ul><li class=t1><code><a href=#the-em-element>em</a></code><ul><li class=t3><code>#text</code>: <span title="">wonderful</span></ul><li class=t3><code>#text</code>: <span title=""> world</span></ul><li class=t3><code>#text</code>: <span title="">!</span></ul></ul><p>The content model of the <code><a href=#the-a-element>a</a></code> element is
<a href=#transparent>transparent</a>. To see if its contents are conforming,
<ul class="domTree"><li class="t1"><code>p</code><ul><li class="t3"><code>#text</code>: <span title="">Hello </span></li><li class="t1"><code>a</code> <span class="t2" title=""><code class="attribute name">href</code>="<code class="attribute value">world.html</code>"</span><ul><li class="t1"><code>em</code><ul><li class="t3"><code>#text</code>: <span title="">wonderful</span></li></ul></li><li class="t3"><code>#text</code>: <span title=""> world</span></li></ul></li><li class="t3"><code>#text</code>: <span title="">!</span></li></ul></li></ul>

<p>The content model of the <code>a</code> element is
<span>transparent</span>. To see if its contents are conforming,
therefore, the element is replaced by its contents:</p>

<ul class=domTree><li class=t1><code><a href=#the-p-element>p</a></code><ul><li class=t3><code>#text</code>: <span title="">Hello </span><li class=t1><code><a href=#the-em-element>em</a></code><ul><li class=t3><code>#text</code>: <span title="">wonderful</span></ul><li class=t3><code>#text</code>: <span title=""> world</span><li class=t3><code>#text</code>: <span title="">!</span></ul></ul><p>Since that is conforming, the contents of the <code><a href=#the-a-element>a</a></code> are
conforming in the original fragment.</p>
<ul class="domTree"><li class="t1"><code>p</code><ul><li class="t3"><code>#text</code>: <span title="">Hello </span></li><li class="t1"><code>em</code><ul><li class="t3"><code>#text</code>: <span title="">wonderful</span></li></ul></li><li class="t3"><code>#text</code>: <span title=""> world</span></li><li class="t3"><code>#text</code>: <span title="">!</span></li></ul></li></ul>

<p>Since that is conforming, the contents of the <code>a</code> are
conforming in the original fragment (there is no complication
regarding the various parts of the <code>p</code> element's content
model, since that element's content model has only one part).</p>

</div>
-->

<p class=note>In some cases, where transparent elements are nested
in each other, the process has to be applied iteratively.</p>

<div class=example>

<p>Consider the following markup fragment:</p>

<pre>&lt;p&gt;&lt;object&gt;&lt;param&gt;&lt;ins&gt;&lt;map&gt;&lt;a href="/"&gt;Apples&lt;/a&gt;&lt;/map&gt;&lt;/ins&gt;&lt;/object&gt;&lt;/p&gt;</pre>

<p>To check whether "Apples" is allowed inside the <code><a href=#the-a-element>a</a></code>
element, the content models are examined. The <code><a href=#the-a-element>a</a></code>
element's content model is transparent, as is the <code><a href=#the-map-element>map</a></code>
element's, as is the <code><a href=#the-ins-element>ins</a></code> element's, as is the part of
the <code><a href=#the-object-element>object</a></code> element's in which the <code><a href=#the-ins-element>ins</a></code>
element is found. The <code><a href=#the-object-element>object</a></code> element is found in the
<code><a href=#the-p-element>p</a></code> element, whose content model is <a href=#phrasing-content>phrasing
content</a>. Thus, "Apples" is allowed, as text is phrasing
content.</p>

</div>

Expand Down Expand Up @@ -89945,7 +89992,7 @@ <h3 class=no-num id=elements-1>Elements</h3>
<a href=#category-submit title=category-submit>submittable</a>;
<a href=#form-associated-element title="Form-associated element">form-associated</a></td>
<td><a href=#phrasing-content title="Phrasing content">phrasing</a></td>
<td><a href=#phrasing-content>Phrasing content</a>*</td>
<td><a href=#phrasing-content title="Phrasing content">phrasing</a>*</td>
<td><a href=#global-attributes title="global attributes">globals</a>;
<code title=attr-fe-autofocus><a href=#attr-fe-autofocus>autofocus</a></code>;
<code title=attr-fe-disabled><a href=#attr-fe-disabled>disabled</a></code>;
Expand Down Expand Up @@ -90090,7 +90137,7 @@ <h3 class=no-num id=elements-1>Elements</h3>
<td>Legend for corresponding <code><a href=#the-dd-element>dd</a></code> element(s)</td>
<td>none</td>
<td><code><a href=#the-dl-element>dl</a></code></td>
<td>varies*</td>
<td><a href=#phrasing-content title="Phrasing content">phrasing</a></td>
<td><a href=#global-attributes title="global attributes">globals</a></td>
<td><code><a href=#htmlelement>HTMLElement</a></code></td>
<tr><th><code><a href=#the-em-element>em</a></code></th>
Expand Down
77 changes: 62 additions & 15 deletions index
Expand Up @@ -225,7 +225,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1>HTML5 (including next generation additions still in development)</h1>
<h2 class="no-num no-toc">Draft Standard &mdash; 31 December 2010</h2>
<h2 class="no-num no-toc">Draft Standard &mdash; 1 January 2011</h2>
</hgroup><p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
<p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
<!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
Expand Down Expand Up @@ -10897,28 +10897,75 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0
<h5 id=transparent-content-models><span class=secno>3.2.5.2 </span>Transparent content models</h5>

<p>Some elements are described as <dfn id=transparent>transparent</dfn>; they have
"transparent" in the description of their content model.</p>

<p>When a content model includes a part that is "transparent", those
parts must not contain content that would not be conformant if all
transparent elements in the tree were replaced, in their parent
element, by the children in the "transparent" part of their content
model, retaining order.</p>
"transparent" in the description of their content model. The content
model of a <a href=#transparent>transparent</a> element is derived from the
content model of its parent element: the elements required in the
part of the content model that is "transparent" are the same
elements as required in the part of the content model of the parent
of the transparent element in which the transparent element finds
itself.</p>

<div class=example>

<p>For instance, an <code><a href=#the-ins-element>ins</a></code> element inside a
<code><a href=#the-ruby-element>ruby</a></code> element cannot contain an <code><a href=#the-rt-element>rt</a></code>
element, because the part of the <code><a href=#the-ruby-element>ruby</a></code> element's
content model that allows <code><a href=#the-ins-element>ins</a></code> elements is the part
that allows <a href=#phrasing-content>phrasing content</a>, and the <code><a href=#the-rt-element>rt</a></code>
element is not <a href=#phrasing-content>phrasing content</a>.</p>

</div>

<!--(as far as I can tell, there's no way to violate this requirement
without first violating the earlier requirement)
<p>Furthermore, when a content model includes a part that is
"transparent", those parts must not contain content that would not
be conformant if all transparent elements in the tree were replaced,
in their parent element, by the children in the "transparent" part
of their content model, retaining order.</p>

<div class="example">

<p>Consider the following markup fragment:</p>

<pre>&lt;p&gt;Hello &lt;a href="world.html"&gt;&lt;em&gt;wonderful&lt;/em&gt; world&lt;/a&gt;!&lt;/p&gt;</pre>
<pre>&lt;p>Hello &lt;a href="world.html">&lt;em>wonderful&lt;/em> world&lt;/a>!&lt;/p></pre>

<p>Its DOM looks like the following:</p>

<ul class=domTree><li class=t1><code><a href=#the-p-element>p</a></code><ul><li class=t3><code>#text</code>: <span title="">Hello </span><li class=t1><code><a href=#the-a-element>a</a></code> <span class=t2 title=""><code class="attribute name">href</code>="<code class="attribute value">world.html</code>"</span><ul><li class=t1><code><a href=#the-em-element>em</a></code><ul><li class=t3><code>#text</code>: <span title="">wonderful</span></ul><li class=t3><code>#text</code>: <span title=""> world</span></ul><li class=t3><code>#text</code>: <span title="">!</span></ul></ul><p>The content model of the <code><a href=#the-a-element>a</a></code> element is
<a href=#transparent>transparent</a>. To see if its contents are conforming,
<ul class="domTree"><li class="t1"><code>p</code><ul><li class="t3"><code>#text</code>: <span title="">Hello </span></li><li class="t1"><code>a</code> <span class="t2" title=""><code class="attribute name">href</code>="<code class="attribute value">world.html</code>"</span><ul><li class="t1"><code>em</code><ul><li class="t3"><code>#text</code>: <span title="">wonderful</span></li></ul></li><li class="t3"><code>#text</code>: <span title=""> world</span></li></ul></li><li class="t3"><code>#text</code>: <span title="">!</span></li></ul></li></ul>

<p>The content model of the <code>a</code> element is
<span>transparent</span>. To see if its contents are conforming,
therefore, the element is replaced by its contents:</p>

<ul class=domTree><li class=t1><code><a href=#the-p-element>p</a></code><ul><li class=t3><code>#text</code>: <span title="">Hello </span><li class=t1><code><a href=#the-em-element>em</a></code><ul><li class=t3><code>#text</code>: <span title="">wonderful</span></ul><li class=t3><code>#text</code>: <span title=""> world</span><li class=t3><code>#text</code>: <span title="">!</span></ul></ul><p>Since that is conforming, the contents of the <code><a href=#the-a-element>a</a></code> are
conforming in the original fragment.</p>
<ul class="domTree"><li class="t1"><code>p</code><ul><li class="t3"><code>#text</code>: <span title="">Hello </span></li><li class="t1"><code>em</code><ul><li class="t3"><code>#text</code>: <span title="">wonderful</span></li></ul></li><li class="t3"><code>#text</code>: <span title=""> world</span></li><li class="t3"><code>#text</code>: <span title="">!</span></li></ul></li></ul>

<p>Since that is conforming, the contents of the <code>a</code> are
conforming in the original fragment (there is no complication
regarding the various parts of the <code>p</code> element's content
model, since that element's content model has only one part).</p>

</div>
-->

<p class=note>In some cases, where transparent elements are nested
in each other, the process has to be applied iteratively.</p>

<div class=example>

<p>Consider the following markup fragment:</p>

<pre>&lt;p&gt;&lt;object&gt;&lt;param&gt;&lt;ins&gt;&lt;map&gt;&lt;a href="/"&gt;Apples&lt;/a&gt;&lt;/map&gt;&lt;/ins&gt;&lt;/object&gt;&lt;/p&gt;</pre>

<p>To check whether "Apples" is allowed inside the <code><a href=#the-a-element>a</a></code>
element, the content models are examined. The <code><a href=#the-a-element>a</a></code>
element's content model is transparent, as is the <code><a href=#the-map-element>map</a></code>
element's, as is the <code><a href=#the-ins-element>ins</a></code> element's, as is the part of
the <code><a href=#the-object-element>object</a></code> element's in which the <code><a href=#the-ins-element>ins</a></code>
element is found. The <code><a href=#the-object-element>object</a></code> element is found in the
<code><a href=#the-p-element>p</a></code> element, whose content model is <a href=#phrasing-content>phrasing
content</a>. Thus, "Apples" is allowed, as text is phrasing
content.</p>

</div>

Expand Down Expand Up @@ -85850,7 +85897,7 @@ interface <a href=#htmldocument>HTMLDocument</a> {
<a href=#category-submit title=category-submit>submittable</a>;
<a href=#form-associated-element title="Form-associated element">form-associated</a></td>
<td><a href=#phrasing-content title="Phrasing content">phrasing</a></td>
<td><a href=#phrasing-content>Phrasing content</a>*</td>
<td><a href=#phrasing-content title="Phrasing content">phrasing</a>*</td>
<td><a href=#global-attributes title="global attributes">globals</a>;
<code title=attr-fe-autofocus><a href=#attr-fe-autofocus>autofocus</a></code>;
<code title=attr-fe-disabled><a href=#attr-fe-disabled>disabled</a></code>;
Expand Down Expand Up @@ -85995,7 +86042,7 @@ interface <a href=#htmldocument>HTMLDocument</a> {
<td>Legend for corresponding <code><a href=#the-dd-element>dd</a></code> element(s)</td>
<td>none</td>
<td><code><a href=#the-dl-element>dl</a></code></td>
<td>varies*</td>
<td><a href=#phrasing-content title="Phrasing content">phrasing</a></td>
<td><a href=#global-attributes title="global attributes">globals</a></td>
<td><code><a href=#htmlelement>HTMLElement</a></code></td>
<tr><th><code><a href=#the-em-element>em</a></code></th>
Expand Down

0 comments on commit 102b979

Please sign in to comment.