Skip to content
Permalink
Browse files

[giow] (2) Change how document[name] works to be compatible with both…

… IE (which typically are targetted with <object>) and other UAs (which typically are targetted with <embed>).

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

git-svn-id: http://svn.whatwg.org/webapps@6115 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed May 6, 2011
1 parent 8e2a785 commit 499f375f6ed400dcb6cde815c317e549bdf3166b
Showing with 84 additions and 69 deletions.
  1. +26 −22 complete.html
  2. +26 −22 index
  3. +32 −25 source
named properties">supports named properties</span>. The
<a href=#supported-property-names>supported property names</a> at any moment consist of the
values of the <code title=attr-name>name</code> content attributes
of all the <code><a href=#the-applet-element>applet</a></code>, <code><a href=#the-embed-element>embed</a></code>,
<code><a href=#the-form-element>form</a></code>, <code><a href=#the-iframe-element>iframe</a></code>, <code><a href=#the-img-element>img</a></code>, and
<a href=#fallback-free>fallback-free</a> <code><a href=#the-object-element>object</a></code> elements in the
<code><a href=#document>Document</a></code> that have <code title=attr-name>name</code>
content attributes, and the values of the <code title=attr-id><a href=#the-id-attribute>id</a></code> content attributes of all the
<code><a href=#the-applet-element>applet</a></code> and <a href=#fallback-free>fallback-free</a>
<code><a href=#the-object-element>object</a></code> elements in the <code><a href=#document>Document</a></code> that have
<code title=attr-id><a href=#the-id-attribute>id</a></code> content attributes, and the values
of the <code title=attr-id><a href=#the-id-attribute>id</a></code> content attributes of all the
<code><a href=#the-img-element>img</a></code> elements in the <code><a href=#document>Document</a></code> that have
both <code title=attr-name>name</code> content attributes and
<code title=attr-id><a href=#the-id-attribute>id</a></code> content attributes.</p>
of all the
<code><a href=#the-applet-element>applet</a></code>,
<a href=#exposed>exposed</a> <code><a href=#the-embed-element>embed</a></code>,
<code><a href=#the-form-element>form</a></code>,
<code><a href=#the-iframe-element>iframe</a></code>,
<code><a href=#the-img-element>img</a></code>, and
<a href=#exposed>exposed</a> <code><a href=#the-object-element>object</a></code>
elements in the <code><a href=#document>Document</a></code> that have <code title=attr-name>name</code> content attributes, and the values of
the <code title=attr-id><a href=#the-id-attribute>id</a></code> content attributes of all the
<code><a href=#the-applet-element>applet</a></code> and
<a href=#exposed>exposed</a> <code><a href=#the-object-element>object</a></code>
elements in the <code><a href=#document>Document</a></code> that have <code title=attr-id><a href=#the-id-attribute>id</a></code> content attributes, and the values of the
<code title=attr-id><a href=#the-id-attribute>id</a></code> content attributes of all the
<code><a href=#the-img-element>img</a></code>
elements in the <code><a href=#document>Document</a></code> that have both <code title=attr-name>name</code> content attributes and <code title=attr-id><a href=#the-id-attribute>id</a></code> content attributes.</p>

<p>When <dfn id=dom-document-nameditem title=dom-document-namedItem>the
<code>HTMLDocument</code> object is indexed for property
with the name <var title="">name</var>, for the purposes of the
above algorithm, are those that are either:</p>

<ul><li><code><a href=#the-applet-element>applet</a></code>, <code><a href=#the-embed-element>embed</a></code>, <code><a href=#the-form-element>form</a></code>,
<code><a href=#the-iframe-element>iframe</a></code>, <code><a href=#the-img-element>img</a></code>, or
<a href=#fallback-free>fallback-free</a> <code><a href=#the-object-element>object</a></code> elements that have a
<code title=attr-name>name</code> content attribute whose value
is <var title="">name</var>, or</li>
<ul><li><code><a href=#the-applet-element>applet</a></code>, <a href=#exposed>exposed</a> <code><a href=#the-embed-element>embed</a></code>,
<code><a href=#the-form-element>form</a></code>, <code><a href=#the-iframe-element>iframe</a></code>, <code><a href=#the-img-element>img</a></code>, or
<a href=#exposed>exposed</a> <code><a href=#the-object-element>object</a></code> elements that have a <code title=attr-name>name</code> content attribute whose value is <var title="">name</var>, or</li>

<li><code><a href=#the-applet-element>applet</a></code> or <a href=#fallback-free>fallback-free</a>
<code><a href=#the-object-element>object</a></code> elements that have an <code title=attr-id><a href=#the-id-attribute>id</a></code> content attribute whose value is <var title="">name</var>, or</li>
<li><code><a href=#the-applet-element>applet</a></code> or <a href=#exposed>exposed</a> <code><a href=#the-object-element>object</a></code>
elements that have an <code title=attr-id><a href=#the-id-attribute>id</a></code> content
attribute whose value is <var title="">name</var>, or</li>

<li><code><a href=#the-img-element>img</a></code> elements that have an <code title=attr-id><a href=#the-id-attribute>id</a></code> content attribute whose value is <var title="">name</var>, and that have a <code title=attr-name>name</code> content attribute present also.</li>

</ul><p>An <code><a href=#the-object-element>object</a></code> element is said to be
<dfn id=fallback-free>fallback-free</dfn> if it has no <code><a href=#the-object-element>object</a></code> or
<code><a href=#the-embed-element>embed</a></code> descendants.</p>
</ul><p>An <code><a href=#the-embed-element>embed</a></code> or <code><a href=#the-object-element>object</a></code> element is said to
be <dfn id=exposed>exposed</dfn> if it has no <a href=#exposed>exposed</a>
<code><a href=#the-object-element>object</a></code> ancestor, and, for <code><a href=#the-object-element>object</a></code> elements,
is additionally either not showing its <a href=#fallback-content>fallback content</a>
or has no <code><a href=#the-object-element>object</a></code> or <code><a href=#the-embed-element>embed</a></code> descendants.</p>

</div>

48 index
named properties">supports named properties</span>. The
<a href=#supported-property-names>supported property names</a> at any moment consist of the
values of the <code title=attr-name>name</code> content attributes
of all the <code><a href=#the-applet-element>applet</a></code>, <code><a href=#the-embed-element>embed</a></code>,
<code><a href=#the-form-element>form</a></code>, <code><a href=#the-iframe-element>iframe</a></code>, <code><a href=#the-img-element>img</a></code>, and
<a href=#fallback-free>fallback-free</a> <code><a href=#the-object-element>object</a></code> elements in the
<code><a href=#document>Document</a></code> that have <code title=attr-name>name</code>
content attributes, and the values of the <code title=attr-id><a href=#the-id-attribute>id</a></code> content attributes of all the
<code><a href=#the-applet-element>applet</a></code> and <a href=#fallback-free>fallback-free</a>
<code><a href=#the-object-element>object</a></code> elements in the <code><a href=#document>Document</a></code> that have
<code title=attr-id><a href=#the-id-attribute>id</a></code> content attributes, and the values
of the <code title=attr-id><a href=#the-id-attribute>id</a></code> content attributes of all the
<code><a href=#the-img-element>img</a></code> elements in the <code><a href=#document>Document</a></code> that have
both <code title=attr-name>name</code> content attributes and
<code title=attr-id><a href=#the-id-attribute>id</a></code> content attributes.</p>
of all the
<code><a href=#the-applet-element>applet</a></code>,
<a href=#exposed>exposed</a> <code><a href=#the-embed-element>embed</a></code>,
<code><a href=#the-form-element>form</a></code>,
<code><a href=#the-iframe-element>iframe</a></code>,
<code><a href=#the-img-element>img</a></code>, and
<a href=#exposed>exposed</a> <code><a href=#the-object-element>object</a></code>
elements in the <code><a href=#document>Document</a></code> that have <code title=attr-name>name</code> content attributes, and the values of
the <code title=attr-id><a href=#the-id-attribute>id</a></code> content attributes of all the
<code><a href=#the-applet-element>applet</a></code> and
<a href=#exposed>exposed</a> <code><a href=#the-object-element>object</a></code>
elements in the <code><a href=#document>Document</a></code> that have <code title=attr-id><a href=#the-id-attribute>id</a></code> content attributes, and the values of the
<code title=attr-id><a href=#the-id-attribute>id</a></code> content attributes of all the
<code><a href=#the-img-element>img</a></code>
elements in the <code><a href=#document>Document</a></code> that have both <code title=attr-name>name</code> content attributes and <code title=attr-id><a href=#the-id-attribute>id</a></code> content attributes.</p>

<p>When <dfn id=dom-document-nameditem title=dom-document-namedItem>the
<code>HTMLDocument</code> object is indexed for property
with the name <var title="">name</var>, for the purposes of the
above algorithm, are those that are either:</p>

<ul><li><code><a href=#the-applet-element>applet</a></code>, <code><a href=#the-embed-element>embed</a></code>, <code><a href=#the-form-element>form</a></code>,
<code><a href=#the-iframe-element>iframe</a></code>, <code><a href=#the-img-element>img</a></code>, or
<a href=#fallback-free>fallback-free</a> <code><a href=#the-object-element>object</a></code> elements that have a
<code title=attr-name>name</code> content attribute whose value
is <var title="">name</var>, or</li>
<ul><li><code><a href=#the-applet-element>applet</a></code>, <a href=#exposed>exposed</a> <code><a href=#the-embed-element>embed</a></code>,
<code><a href=#the-form-element>form</a></code>, <code><a href=#the-iframe-element>iframe</a></code>, <code><a href=#the-img-element>img</a></code>, or
<a href=#exposed>exposed</a> <code><a href=#the-object-element>object</a></code> elements that have a <code title=attr-name>name</code> content attribute whose value is <var title="">name</var>, or</li>

<li><code><a href=#the-applet-element>applet</a></code> or <a href=#fallback-free>fallback-free</a>
<code><a href=#the-object-element>object</a></code> elements that have an <code title=attr-id><a href=#the-id-attribute>id</a></code> content attribute whose value is <var title="">name</var>, or</li>
<li><code><a href=#the-applet-element>applet</a></code> or <a href=#exposed>exposed</a> <code><a href=#the-object-element>object</a></code>
elements that have an <code title=attr-id><a href=#the-id-attribute>id</a></code> content
attribute whose value is <var title="">name</var>, or</li>

<li><code><a href=#the-img-element>img</a></code> elements that have an <code title=attr-id><a href=#the-id-attribute>id</a></code> content attribute whose value is <var title="">name</var>, and that have a <code title=attr-name>name</code> content attribute present also.</li>

</ul><p>An <code><a href=#the-object-element>object</a></code> element is said to be
<dfn id=fallback-free>fallback-free</dfn> if it has no <code><a href=#the-object-element>object</a></code> or
<code><a href=#the-embed-element>embed</a></code> descendants.</p>
</ul><p>An <code><a href=#the-embed-element>embed</a></code> or <code><a href=#the-object-element>object</a></code> element is said to
be <dfn id=exposed>exposed</dfn> if it has no <a href=#exposed>exposed</a>
<code><a href=#the-object-element>object</a></code> ancestor, and, for <code><a href=#the-object-element>object</a></code> elements,
is additionally either not showing its <a href=#fallback-content>fallback content</a>
or has no <code><a href=#the-object-element>object</a></code> or <code><a href=#the-embed-element>embed</a></code> descendants.</p>

</div>

57 source
@@ -9694,19 +9694,25 @@ interface <dfn>HTMLDocument</dfn> {
named properties">supports named properties</span>. The
<span>supported property names</span> at any moment consist of the
values of the <code title="attr-name">name</code> content attributes
of all the <code>applet</code>, <code>embed</code>,
<code>form</code>, <code>iframe</code>, <code>img</code>, and
<span>fallback-free</span> <code>object</code> elements in the
<code>Document</code> that have <code title="attr-name">name</code>
content attributes, and the values of the <code
title="attr-id">id</code> content attributes of all the
<code>applet</code> and <span>fallback-free</span>
<code>object</code> elements in the <code>Document</code> that have
<code title="attr-id">id</code> content attributes, and the values
of the <code title="attr-id">id</code> content attributes of all the
<code>img</code> elements in the <code>Document</code> that have
both <code title="attr-name">name</code> content attributes and
<code title="attr-id">id</code> content attributes.</p>
of all the
<code>applet</code>,
<span>exposed</span> <code>embed</code>,
<code>form</code>,
<code>iframe</code>,
<code>img</code>, and
<span>exposed</span> <code>object</code>
elements in the <code>Document</code> that have <code
title="attr-name">name</code> content attributes, and the values of
the <code title="attr-id">id</code> content attributes of all the
<code>applet</code> and
<span>exposed</span> <code>object</code>
elements in the <code>Document</code> that have <code
title="attr-id">id</code> content attributes, and the values of the
<code title="attr-id">id</code> content attributes of all the
<code>img</code>
elements in the <code>Document</code> that have both <code
title="attr-name">name</code> content attributes and <code
title="attr-id">id</code> content attributes.</p>

<p>When <dfn title="dom-document-namedItem">the
<code>HTMLDocument</code> object is indexed for property
@@ -9768,27 +9774,28 @@ interface <dfn>HTMLDocument</dfn> {

<ul>

<li><code>applet</code>, <code>embed</code>, <code>form</code>,
<code>iframe</code>, <code>img</code>, or
<span>fallback-free</span> <code>object</code> elements that have a
<code title="attr-name">name</code> content attribute whose value
is <var title="">name</var>, or</li>

<li><code>applet</code> or <span>fallback-free</span>
<code>object</code> elements that have an <code
title="attr-id">id</code> content attribute whose value is <var
<li><code>applet</code>, <span>exposed</span> <code>embed</code>,
<code>form</code>, <code>iframe</code>, <code>img</code>, or
<span>exposed</span> <code>object</code> elements that have a <code
title="attr-name">name</code> content attribute whose value is <var
title="">name</var>, or</li>

<li><code>applet</code> or <span>exposed</span> <code>object</code>
elements that have an <code title="attr-id">id</code> content
attribute whose value is <var title="">name</var>, or</li>

<li><code>img</code> elements that have an <code
title="attr-id">id</code> content attribute whose value is <var
title="">name</var>, and that have a <code
title="attr-name">name</code> content attribute present also.</li>

</ul>

<p>An <code>object</code> element is said to be
<dfn>fallback-free</dfn> if it has no <code>object</code> or
<code>embed</code> descendants.</p>
<p>An <code>embed</code> or <code>object</code> element is said to
be <dfn>exposed</dfn> if it has no <span>exposed</span>
<code>object</code> ancestor, and, for <code>object</code> elements,
is additionally either not showing its <span>fallback content</span>
or has no <code>object</code> or <code>embed</code> descendants.</p>

</div>

0 comments on commit 499f375

Please sign in to comment.
You can’t perform that action at this time.