Skip to content

Commit

Permalink
[gi] (2) Define Document's [[Get]]ter. (credit: sp)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.whatwg.org/webapps@2642 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jan 13, 2009
1 parent c461168 commit d35357b
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 4 deletions.
47 changes: 44 additions & 3 deletions index
Expand Up @@ -22,7 +22,7 @@
<div class=head>
<p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG src=/images/logo></a></p>
<h1>HTML 5</h1>
<h2 class="no-num no-toc" id=draft-recommendation-&mdash;-date:-01-jan-1901>Draft Recommendation &mdash; 12 January 2009</h2>
<h2 class="no-num no-toc" id=draft-recommendation-&mdash;-date:-01-jan-1901>Draft Recommendation &mdash; 13 January 2009</h2>
<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>
<dl><dt>Multiple-page version:</dt>
Expand Down Expand Up @@ -5854,7 +5854,8 @@ interface <dfn id=domstringmap-0>DOMStringMap</dfn> {};</pre>
simply being the primary interface of the document object, it is no
longer defined as inheriting from <code>Document</code>.</p>

<pre class=idl>interface <dfn id=htmldocument>HTMLDocument</dfn> {
<pre class=idl>[<a href=#dom-document-nameditem title=dom-document-namedItem>NameGetter</a>]
interface <dfn id=htmldocument>HTMLDocument</dfn> {
// <a href=#resource-metadata-management>resource metadata management</a>
[PutForwards=href] readonly attribute <a href=#location>Location</a> <a href=#dom-document-location title=dom-document-location>location</a>;
readonly attribute DOMString <a href=#dom-document-url title=dom-document-URL>URL</a>;
Expand Down Expand Up @@ -6317,7 +6318,47 @@ interface <dfn id=domstringmap-0>DOMStringMap</dfn> {};</pre>
> optional tag name.
-->

<p class=note>The <code title=dom-document-dir><a href=#dom-document-dir>dir</a></code>
<p>The <code><a href=#htmldocument>HTMLDocument</a></code> interface <span title="support
named properties">supports named properties</span>. The <span>names
of the supported named properties</span> 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
<code><a href=#the-object-element>object</a></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><a href=#the-id-attribute>id</a></code> content attributes of
all the <code><a href=#the-applet-element>applet</a></code> and <code><a href=#the-object-element>object</a></code> elements in the
<code>Document</code> that have <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
retrieval</dfn> using a name <var title="">name</var>, then: if the
list of <a href=#dom-document-nameditem-filter title=dom-document-namedItem-filter>named
elements</a> with the name <var title="">name</var> in the
<code>Document</code> <!-- There will be at least one such element,
by definition. (If there wasn't, then this algorithm wouldn't have
been invoked by WebIDL.) --> has only one element, then that element
must be the value returned; otherwise the value returned must be an
<code><a href=#htmlcollection-0>HTMLCollection</a></code> rooted at the <code>Document</code>
node, whose filter matches only <a href=#dom-document-nameditem-filter title=dom-document-namedItem-filter>named elements</a> with the
name <var title="">name</var>.</p> <!-- the same one each time is
returned, because of the rule under collections -->

<p><dfn id=dom-document-nameditem-filter title=dom-document-nameditem-filter>Named elements</dfn>
with the name <var title="">name</var> 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 <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 <code><a href=#the-object-element>object</a></code> elements that have a
<code title=attr-id><a href=#the-id-attribute>id</a></code> content attribute whose value is
<var title="">name</var>.</li>

</ul><p class=note>The <code title=dom-document-dir><a href=#dom-document-dir>dir</a></code>
attribute on the <code><a href=#htmldocument>HTMLDocument</a></code> interface is defined
along with the <code title=attr-dir><a href=#the-dir-attribute>dir</a></code> content
attribute.</p>
Expand Down
49 changes: 48 additions & 1 deletion source
Expand Up @@ -5832,7 +5832,8 @@ interface <dfn>DOMStringMap</dfn> {};</pre>
simply being the primary interface of the document object, it is no
longer defined as inheriting from <code>Document</code>.</p>

<pre class="idl">interface <dfn>HTMLDocument</dfn> {
<pre class="idl">[<span title="dom-document-namedItem">NameGetter</span>]
interface <dfn>HTMLDocument</dfn> {
// <span>resource metadata management</span>
[PutForwards=href] readonly attribute <span>Location</span> <span title="dom-document-location">location</span>;
readonly attribute DOMString <span title="dom-document-URL">URL</span>;
Expand Down Expand Up @@ -6355,6 +6356,52 @@ interface <dfn>DOMStringMap</dfn> {};</pre>
> optional tag name.
-->

<p>The <code>HTMLDocument</code> interface <span title="support
named properties">supports named properties</span>. The <span>names
of the supported named properties</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
<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 <code>object</code> elements in the
<code>Document</code> that have <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
retrieval</dfn> using a name <var title="">name</var>, then: if the
list of <span title="dom-document-namedItem-filter">named
elements</span> with the name <var title="">name</var> in the
<code>Document</code> <!-- There will be at least one such element,
by definition. (If there wasn't, then this algorithm wouldn't have
been invoked by WebIDL.) --> has only one element, then that element
must be the value returned; otherwise the value returned must be an
<code>HTMLCollection</code> rooted at the <code>Document</code>
node, whose filter matches only <span
title="dom-document-namedItem-filter">named elements</span> with the
name <var title="">name</var>.</p> <!-- the same one each time is
returned, because of the rule under collections -->

<p><dfn title="dom-document-nameditem-filter">Named elements</dfn>
with the name <var title="">name</var> are those that are
either:</p>

<ul>

<li><code>applet</code>, <code>embed</code>, <code>form</code>,
<code>iframe</code>, <code>img</code>, or <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 <code>object</code> elements that have a
<code title="attr-id">id</code> content attribute whose value is
<var title="">name</var>.</li>

</ul>


<p class="note">The <code title="dom-document-dir">dir</code>
attribute on the <code>HTMLDocument</code> interface is defined
along with the <code title="attr-dir">dir</code> content
Expand Down

0 comments on commit d35357b

Please sign in to comment.