Skip to content

Commit

Permalink
[ac] (1) <figcaption> should only be used as a caption of a no-alt <i…
Browse files Browse the repository at this point in the history
…mg> if there's no other content in the <figure>

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

git-svn-id: http://svn.whatwg.org/webapps@5517 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 26, 2010
1 parent e8cf661 commit f86a9da
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 46 deletions.
43 changes: 28 additions & 15 deletions complete.html
Expand Up @@ -9939,10 +9939,14 @@ <h4 id=content-models><span class=secno>3.2.5 </span><dfn>Content models</dfn></
not, and must be ignored when following algorithms that define
document and element semantics.</p>

<p>An element <var title="">A</var> is said to be <dfn id=preceded-or-followed>preceded or
followed</dfn> by a second element <var title="">B</var> if <var title="">A</var> and <var title="">B</var> have the same parent node
and there are no other element nodes or text nodes (other than
<a href=#inter-element-whitespace>inter-element whitespace</a>) between them.</p>
<p class=note>Thus, an element <var title="">A</var> is said to be
<i>preceded or followed</i> by a second element <var title="">B</var> if <var title="">A</var> and <var title="">B</var>
have the same parent node and there are no other element nodes or
text nodes (other than <a href=#inter-element-whitespace>inter-element whitespace</a>)
between them. Similarly, a node is the <i>only child</i> of an
element if that element contains no other nodes other than
<a href=#inter-element-whitespace>inter-element whitespace</a>, comment nodes, and processing
instruction nodes.</p>

<p>Authors must not use <a href=#html-elements>HTML elements</a> anywhere except
where they are explicitly allowed, as defined for each element, or
Expand Down Expand Up @@ -20582,10 +20586,15 @@ <h4 id=the-img-element><span class=secno>4.8.1 </span>The <dfn><code>img</code><
that attribute is the caption information; abort these
steps.</li>

<li><p>If the image is the child of a <code><a href=#the-figure-element>figure</a></code> element
that has a child <code><a href=#the-figcaption-element>figcaption</a></code> element, then the
contents of the first such <code><a href=#the-figcaption-element>figcaption</a></code> element are
the caption information; abort these steps.</li>
<li><p>If the image is a descendant of a <code><a href=#the-figure-element>figure</a></code>
element that has a child <code><a href=#the-figcaption-element>figcaption</a></code> element, and,
ignoring the <code><a href=#the-figcaption-element>figcaption</a></code> element and its descendants,
the <code><a href=#the-figure-element>figure</a></code> element has no text node descendants
other than <a href=#inter-element-whitespace>inter-element whitespace</a>, and no
<a href=#embedded-content>embedded content</a> descendant other than the
<code><a href=#the-img-element>img</a></code> element, then the contents of the first such
<code><a href=#the-figcaption-element>figcaption</a></code> element are the caption information;
abort these steps.</li>

</ol></dd>

Expand Down Expand Up @@ -21510,10 +21519,15 @@ <h6 id=a-key-part-of-the-content><span class=secno>4.8.1.1.10 </span>A key part
of 'critical-no-alt' --><li>The <code title=attr-title><a href=#the-title-attribute>title</a></code> attribute is
present and has a non-empty value.</li>

<li>The <code><a href=#the-img-element>img</a></code> element is in a <code><a href=#the-figure-element>figure</a></code>
element that contains a <code><a href=#the-figcaption-element>figcaption</a></code> element that
contains content other than <a href=#inter-element-whitespace>inter-element
whitespace</a>.</li>
<li id=figcaption-as-alt-condition>The <code><a href=#the-img-element>img</a></code> element
is in a <code><a href=#the-figure-element>figure</a></code> element that contains a
<code><a href=#the-figcaption-element>figcaption</a></code> element that contains content other than
<a href=#inter-element-whitespace>inter-element whitespace</a>, and, ignoring the
<code><a href=#the-figcaption-element>figcaption</a></code> element and its descendants, the
<code><a href=#the-figure-element>figure</a></code> element has no text node descendants other
than <a href=#inter-element-whitespace>inter-element whitespace</a>, and no <a href=#embedded-content>embedded
content</a> descendant other than the <code><a href=#the-img-element>img</a></code>
element.</li>

</ul><p class=note>Such cases are to be kept to an absolute
minimum. If there is even the slightest possibility of the author
Expand Down Expand Up @@ -21706,9 +21720,8 @@ <h6 id=guidance-for-conformance-checkers><span class=secno>4.8.1.1.14 </span>Gui
above</a>).</li>

<li>The <code><a href=#the-img-element>img</a></code> element is in a <code><a href=#the-figure-element>figure</a></code>
element that contains a <code><a href=#the-figcaption-element>figcaption</a></code> element that
contains content other than <a href=#inter-element-whitespace>inter-element whitespace</a>
(as <a href=#unknown-images>described above</a>).</li>
element that satisfies <a href=#figcaption-as-alt-condition>the
conditions described above</a>.</li>

<!-- the following are additional entries not included in the
aforementioned list, as they apply only to conformance checkers -->
Expand Down
43 changes: 28 additions & 15 deletions index
Expand Up @@ -9916,10 +9916,14 @@ background: transparent"&gt;blue&lt;/span&gt;.&lt;/p&gt;</pre>
not, and must be ignored when following algorithms that define
document and element semantics.</p>

<p>An element <var title="">A</var> is said to be <dfn id=preceded-or-followed>preceded or
followed</dfn> by a second element <var title="">B</var> if <var title="">A</var> and <var title="">B</var> have the same parent node
and there are no other element nodes or text nodes (other than
<a href=#inter-element-whitespace>inter-element whitespace</a>) between them.</p>
<p class=note>Thus, an element <var title="">A</var> is said to be
<i>preceded or followed</i> by a second element <var title="">B</var> if <var title="">A</var> and <var title="">B</var>
have the same parent node and there are no other element nodes or
text nodes (other than <a href=#inter-element-whitespace>inter-element whitespace</a>)
between them. Similarly, a node is the <i>only child</i> of an
element if that element contains no other nodes other than
<a href=#inter-element-whitespace>inter-element whitespace</a>, comment nodes, and processing
instruction nodes.</p>

<p>Authors must not use <a href=#html-elements>HTML elements</a> anywhere except
where they are explicitly allowed, as defined for each element, or
Expand Down Expand Up @@ -20559,10 +20563,15 @@ interface <dfn id=htmlimageelement>HTMLImageElement</dfn> : <a href=#htmlelement
that attribute is the caption information; abort these
steps.</li>

<li><p>If the image is the child of a <code><a href=#the-figure-element>figure</a></code> element
that has a child <code><a href=#the-figcaption-element>figcaption</a></code> element, then the
contents of the first such <code><a href=#the-figcaption-element>figcaption</a></code> element are
the caption information; abort these steps.</li>
<li><p>If the image is a descendant of a <code><a href=#the-figure-element>figure</a></code>
element that has a child <code><a href=#the-figcaption-element>figcaption</a></code> element, and,
ignoring the <code><a href=#the-figcaption-element>figcaption</a></code> element and its descendants,
the <code><a href=#the-figure-element>figure</a></code> element has no text node descendants
other than <a href=#inter-element-whitespace>inter-element whitespace</a>, and no
<a href=#embedded-content>embedded content</a> descendant other than the
<code><a href=#the-img-element>img</a></code> element, then the contents of the first such
<code><a href=#the-figcaption-element>figcaption</a></code> element are the caption information;
abort these steps.</li>

</ol></dd>

Expand Down Expand Up @@ -21487,10 +21496,15 @@ of various sizes."&gt;</strong></pre>
of 'critical-no-alt' --><li>The <code title=attr-title><a href=#the-title-attribute>title</a></code> attribute is
present and has a non-empty value.</li>

<li>The <code><a href=#the-img-element>img</a></code> element is in a <code><a href=#the-figure-element>figure</a></code>
element that contains a <code><a href=#the-figcaption-element>figcaption</a></code> element that
contains content other than <a href=#inter-element-whitespace>inter-element
whitespace</a>.</li>
<li id=figcaption-as-alt-condition>The <code><a href=#the-img-element>img</a></code> element
is in a <code><a href=#the-figure-element>figure</a></code> element that contains a
<code><a href=#the-figcaption-element>figcaption</a></code> element that contains content other than
<a href=#inter-element-whitespace>inter-element whitespace</a>, and, ignoring the
<code><a href=#the-figcaption-element>figcaption</a></code> element and its descendants, the
<code><a href=#the-figure-element>figure</a></code> element has no text node descendants other
than <a href=#inter-element-whitespace>inter-element whitespace</a>, and no <a href=#embedded-content>embedded
content</a> descendant other than the <code><a href=#the-img-element>img</a></code>
element.</li>

</ul><p class=note>Such cases are to be kept to an absolute
minimum. If there is even the slightest possibility of the author
Expand Down Expand Up @@ -21683,9 +21697,8 @@ href="?audio"&gt;audio&lt;/a&gt; test instead.)&lt;/p&gt;</pre>
above</a>).</li>

<li>The <code><a href=#the-img-element>img</a></code> element is in a <code><a href=#the-figure-element>figure</a></code>
element that contains a <code><a href=#the-figcaption-element>figcaption</a></code> element that
contains content other than <a href=#inter-element-whitespace>inter-element whitespace</a>
(as <a href=#unknown-images>described above</a>).</li>
element that satisfies <a href=#figcaption-as-alt-condition>the
conditions described above</a>.</li>

<!-- the following are additional entries not included in the
aforementioned list, as they apply only to conformance checkers -->
Expand Down
45 changes: 29 additions & 16 deletions source
Expand Up @@ -10113,11 +10113,15 @@ background: transparent">blue&lt;/span>.&lt;/p></pre>
not, and must be ignored when following algorithms that define
document and element semantics.</p>

<p>An element <var title="">A</var> is said to be <dfn>preceded or
followed</dfn> by a second element <var title="">B</var> if <var
title="">A</var> and <var title="">B</var> have the same parent node
and there are no other element nodes or text nodes (other than
<span>inter-element whitespace</span>) between them.</p>
<p class="note">Thus, an element <var title="">A</var> is said to be
<i>preceded or followed</i> by a second element <var
title="">B</var> if <var title="">A</var> and <var title="">B</var>
have the same parent node and there are no other element nodes or
text nodes (other than <span>inter-element whitespace</span>)
between them. Similarly, a node is the <i>only child</i> of an
element if that element contains no other nodes other than
<span>inter-element whitespace</span>, comment nodes, and processing
instruction nodes.</p>

<p>Authors must not use <span>HTML elements</span> anywhere except
where they are explicitly allowed, as defined for each element, or
Expand Down Expand Up @@ -21981,10 +21985,15 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
that attribute is the caption information; abort these
steps.</p></li>

<li><p>If the image is the child of a <code>figure</code> element
that has a child <code>figcaption</code> element, then the
contents of the first such <code>figcaption</code> element are
the caption information; abort these steps.</p></li>
<li><p>If the image is a descendant of a <code>figure</code>
element that has a child <code>figcaption</code> element, and,
ignoring the <code>figcaption</code> element and its descendants,
the <code>figure</code> element has no text node descendants
other than <span>inter-element whitespace</span>, and no
<span>embedded content</span> descendant other than the
<code>img</code> element, then the contents of the first such
<code>figcaption</code> element are the caption information;
abort these steps.</p></li>

</ol>

Expand Down Expand Up @@ -22966,10 +22975,15 @@ of various sizes."></strong></pre>
<li>The <code title="attr-title">title</code> attribute is
present and has a non-empty value.</li>

<li>The <code>img</code> element is in a <code>figure</code>
element that contains a <code>figcaption</code> element that
contains content other than <span>inter-element
whitespace</span>.</li>
<li id="figcaption-as-alt-condition">The <code>img</code> element
is in a <code>figure</code> element that contains a
<code>figcaption</code> element that contains content other than
<span>inter-element whitespace</span>, and, ignoring the
<code>figcaption</code> element and its descendants, the
<code>figure</code> element has no text node descendants other
than <span>inter-element whitespace</span>, and no <span>embedded
content</span> descendant other than the <code>img</code>
element.</p></li>

</ul>

Expand Down Expand Up @@ -23177,9 +23191,8 @@ href="?audio">audio&lt;/a> test instead.)&lt;/p></pre>
above</a>).</li>

<li>The <code>img</code> element is in a <code>figure</code>
element that contains a <code>figcaption</code> element that
contains content other than <span>inter-element whitespace</span>
(as <a href="#unknown-images">described above</a>).</li>
element that satisfies <a href="#figcaption-as-alt-condition">the
conditions described above</a>.</li>

<!-- the following are additional entries not included in the
aforementioned list, as they apply only to conformance checkers -->
Expand Down

0 comments on commit f86a9da

Please sign in to comment.