Skip to content

Commit

Permalink
[e] (0) Try to clarify that global HTML attributes aren't global acro…
Browse files Browse the repository at this point in the history
…ss other namespaces without having to litter '...and is an HTML element' all over the spec.

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

git-svn-id: http://svn.whatwg.org/webapps@6754 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Oct 25, 2011
1 parent b20ab9b commit e75d81e
Show file tree
Hide file tree
Showing 3 changed files with 149 additions and 4 deletions.
51 changes: 49 additions & 2 deletions complete.html
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,8 @@ <h2 class="no-num no-toc">Living Standard &mdash; Last Updated 25 October 2011</
<li><a href=#items><span class=secno>5.2.2 </span>Items</a></li>
<li><a href=#names:-the-itemprop-attribute><span class=secno>5.2.3 </span>Names: the <code>itemprop</code> attribute</a></li>
<li><a href=#values><span class=secno>5.2.4 </span>Values</a></li>
<li><a href=#associating-names-with-items><span class=secno>5.2.5 </span>Associating names with items</a></ol></li>
<li><a href=#associating-names-with-items><span class=secno>5.2.5 </span>Associating names with items</a></li>
<li><a href=#microdata-and-other-namespaces><span class=secno>5.2.6 </span>Microdata and other namespaces</a></ol></li>
<li><a href=#microdata-dom-api><span class=secno>5.3 </span>Microdata DOM API</a></li>
<li><a href=#mdvocabs><span class=secno>5.4 </span>Microdata vocabularies</a>
<ol>
Expand Down Expand Up @@ -10390,7 +10391,34 @@ <h4 id=global-attributes><span class=secno>3.2.3 </span><dfn>Global attributes</
<li><code title=attr-style><a href=#the-style-attribute>style</a></code></li>
<li><code title=attr-tabindex><a href=#attr-tabindex>tabindex</a></code></li>
<li><code title=attr-title><a href=#the-title-attribute>title</a></code></li>
</ul><hr><p>The following <a href=#event-handler-content-attributes>event handler content attributes</a> may
</ul><div class=impl>

<p>These attributes are only defined by this specification as
attributes for <a href=#html-elements>HTML elements</a>. When this specification
refers to elements having these attributes, elements from namespaces
that are not defined as having these attributes must not be
considered as being elements with these attributes.</p>

<div class=example>

<p>For example, in the following XML fragment, the "<code title="">bogus</code>" element does not have a <code title=attr-dir><a href=#the-dir-attribute>dir</a></code> attribute as defined in this
specification, despite having an attribute with the literal name
"<code title="">dir</code>". Thus, <a href=#the-directionality>the directionality</a>
of the inner-most <code><a href=#the-span-element>span</a></code> element is '<a href=#concept-rtl title=concept-rtl>rtl</a>', inherited from the
<code><a href=#the-div-element>div</a></code> element indirectly through the "<code title="">bogus</code>" element.</p>

<pre class=bad>&lt;div xmlns="http://www.w3.org/1999/html" dir="rtl"&gt;
&lt;bogus xmlns="http://example.net/ns" dir="ltr"&gt;
&lt;span xmlns="http://www.w3.org/1999/html"&gt;
&lt;/span&gt;
&lt;/bogus&gt;
&lt;/div&gt;</pre>

</div>

</div>

<hr><p>The following <a href=#event-handler-content-attributes>event handler content attributes</a> may
be specified on any <a href=#html-elements title="HTML elements">HTML
element</a>:</p>

Expand Down Expand Up @@ -58316,6 +58344,25 @@ <h4 id=associating-names-with-items><span class=secno>5.2.5 </span>Associating n



<h4 id=microdata-and-other-namespaces><span class=secno>5.2.6 </span>Microdata and other namespaces</h4>

<p>Currently, the <code title=attr-itemscope><a href=#attr-itemscope>itemscope</a></code>,
<code title=attr-itemprop><a href=#names:-the-itemprop-attribute>itemprop</a></code>, and other microdata
attributes are only defined for <a href=#html-elements>HTML elements</a>. This
means that attributes with the literal names "<code title="">itemscope</code>", "<code title="">itemprop</code>", etc,
do not cause microdata processing to occur on elements in other
namespaces, such as SVG.</p>

<div class=example>

<p>Thus, in the following example there is only one item, not
two.</p>

<pre class=bad>&lt;p itemscope&gt;&lt;/p&gt; &lt;!-- this is an item (with no properties and no type) --&gt;
&lt;svg itemscope&gt;&lt;/svg&gt; &lt;!-- this is not, it's just an <code><a href=#svg>svg</a></code> element with an invalid unknown attribute --&gt;</pre>

</div>


<h3 id=microdata-dom-api><span class=secno>5.3 </span>Microdata DOM API</h3>

Expand Down
51 changes: 49 additions & 2 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,8 @@
<li><a href=#items><span class=secno>5.2.2 </span>Items</a></li>
<li><a href=#names:-the-itemprop-attribute><span class=secno>5.2.3 </span>Names: the <code>itemprop</code> attribute</a></li>
<li><a href=#values><span class=secno>5.2.4 </span>Values</a></li>
<li><a href=#associating-names-with-items><span class=secno>5.2.5 </span>Associating names with items</a></ol></li>
<li><a href=#associating-names-with-items><span class=secno>5.2.5 </span>Associating names with items</a></li>
<li><a href=#microdata-and-other-namespaces><span class=secno>5.2.6 </span>Microdata and other namespaces</a></ol></li>
<li><a href=#microdata-dom-api><span class=secno>5.3 </span>Microdata DOM API</a></li>
<li><a href=#mdvocabs><span class=secno>5.4 </span>Microdata vocabularies</a>
<ol>
Expand Down Expand Up @@ -10390,7 +10391,34 @@ interface <dfn id=htmlunknownelement>HTMLUnknownElement</dfn> : <a href=#htmlele
<li><code title=attr-style><a href=#the-style-attribute>style</a></code></li>
<li><code title=attr-tabindex><a href=#attr-tabindex>tabindex</a></code></li>
<li><code title=attr-title><a href=#the-title-attribute>title</a></code></li>
</ul><hr><p>The following <a href=#event-handler-content-attributes>event handler content attributes</a> may
</ul><div class=impl>

<p>These attributes are only defined by this specification as
attributes for <a href=#html-elements>HTML elements</a>. When this specification
refers to elements having these attributes, elements from namespaces
that are not defined as having these attributes must not be
considered as being elements with these attributes.</p>

<div class=example>

<p>For example, in the following XML fragment, the "<code title="">bogus</code>" element does not have a <code title=attr-dir><a href=#the-dir-attribute>dir</a></code> attribute as defined in this
specification, despite having an attribute with the literal name
"<code title="">dir</code>". Thus, <a href=#the-directionality>the directionality</a>
of the inner-most <code><a href=#the-span-element>span</a></code> element is '<a href=#concept-rtl title=concept-rtl>rtl</a>', inherited from the
<code><a href=#the-div-element>div</a></code> element indirectly through the "<code title="">bogus</code>" element.</p>

<pre class=bad>&lt;div xmlns="http://www.w3.org/1999/html" dir="rtl"&gt;
&lt;bogus xmlns="http://example.net/ns" dir="ltr"&gt;
&lt;span xmlns="http://www.w3.org/1999/html"&gt;
&lt;/span&gt;
&lt;/bogus&gt;
&lt;/div&gt;</pre>

</div>

</div>

<hr><p>The following <a href=#event-handler-content-attributes>event handler content attributes</a> may
be specified on any <a href=#html-elements title="HTML elements">HTML
element</a>:</p>

Expand Down Expand Up @@ -58316,6 +58344,25 @@ document.body.appendChild(outer);</pre>



<h4 id=microdata-and-other-namespaces><span class=secno>5.2.6 </span>Microdata and other namespaces</h4>

<p>Currently, the <code title=attr-itemscope><a href=#attr-itemscope>itemscope</a></code>,
<code title=attr-itemprop><a href=#names:-the-itemprop-attribute>itemprop</a></code>, and other microdata
attributes are only defined for <a href=#html-elements>HTML elements</a>. This
means that attributes with the literal names "<code title="">itemscope</code>", "<code title="">itemprop</code>", etc,
do not cause microdata processing to occur on elements in other
namespaces, such as SVG.</p>

<div class=example>

<p>Thus, in the following example there is only one item, not
two.</p>

<pre class=bad>&lt;p itemscope&gt;&lt;/p&gt; &lt;!-- this is an item (with no properties and no type) --&gt;
&lt;svg itemscope&gt;&lt;/svg&gt; &lt;!-- this is not, it's just an <code><a href=#svg>svg</a></code> element with an invalid unknown attribute --&gt;</pre>

</div>


<h3 id=microdata-dom-api><span class=secno>5.3 </span>Microdata DOM API</h3>

Expand Down
51 changes: 51 additions & 0 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -10592,6 +10592,37 @@ interface <dfn>HTMLUnknownElement</dfn> : <span>HTMLElement</span> { };</pre>
<li><code title="attr-title">title</code></li>
</ul>

<div class="impl">

<p>These attributes are only defined by this specification as
attributes for <span>HTML elements</span>. When this specification
refers to elements having these attributes, elements from namespaces
that are not defined as having these attributes must not be
considered as being elements with these attributes.</p>

<div class="example">

<p>For example, in the following XML fragment, the "<code
title="">bogus</code>" element does not have a <code
title="attr-dir">dir</code> attribute as defined in this
specification, despite having an attribute with the literal name
"<code title="">dir</code>". Thus, <span>the directionality</span>
of the inner-most <code>span</code> element is '<span
title="concept-rtl">rtl</span>', inherited from the
<code>div</code> element indirectly through the "<code
title="">bogus</code>" element.</p>

<pre class="bad">&lt;div xmlns="http://www.w3.org/1999/html" dir="rtl">
&lt;bogus xmlns="http://example.net/ns" dir="ltr">
&lt;span xmlns="http://www.w3.org/1999/html">
&lt;/span>
&lt;/bogus>
&lt;/div></pre>

</div>

</div>

<hr>

<p>The following <span>event handler content attributes</span> may
Expand Down Expand Up @@ -65768,6 +65799,26 @@ document.body.appendChild(outer);</pre>
<!--START w3c-html-->


<h4>Microdata and other namespaces</h4>

<p>Currently, the <code title="attr-itemscope">itemscope</code>,
<code title="attr-itemprop">itemprop</code>, and other microdata
attributes are only defined for <span>HTML elements</span>. This
means that attributes with the literal names "<code
title="">itemscope</code>", "<code title="">itemprop</code>", etc,
do not cause microdata processing to occur on elements in other
namespaces, such as SVG.</p>

<div class="example">

<p>Thus, in the following example there is only one item, not
two.</p>

<pre class="bad">&lt;p itemscope>&lt;/p> &lt;!-- this is an item (with no properties and no type) -->
&lt;svg itemscope>&lt;/svg> &lt;!-- this is not, it's just an <code>svg</code> element with an invalid unknown attribute --></pre>

</div>


<h3>Microdata DOM API</h3>

Expand Down

0 comments on commit e75d81e

Please sign in to comment.