- From: Ian Hickson via cvs-syncmail <cvsmail@w3.org>
- Date: Tue, 13 Jan 2009 07:46:44 +0000
- To: public-html-commits@w3.org
Update of /sources/public/html5/spec In directory hutz:/tmp/cvs-serv22686 Modified Files: Overview.html Log Message: Add <embed> to the HTMLCollection nmedItem() rules. Made the HTMLDocument NameGetter override builtins. Made it return Window objects instead of <iframe>s. Added a similar NameGetter for Window. Fixed typos, added clarifications, fixed cross-reference issues. (whatwg r2646) Index: Overview.html =================================================================== RCS file: /sources/public/html5/spec/Overview.html,v retrieving revision 1.1815 retrieving revision 1.1816 diff -u -d -r1.1815 -r1.1816 --- Overview.html 13 Jan 2009 00:47:43 -0000 1.1815 +++ Overview.html 13 Jan 2009 07:46:41 -0000 1.1816 @@ -581,7 +581,8 @@ <li><a href=#security-2><span class=secno>5.2.1 </span>Security</a></li> <li><a href=#apis-for-creating-and-navigating-browsing-contexts-by-name><span class=secno>5.2.2 </span>APIs for creating and navigating browsing contexts by name</a></li> <li><a href=#accessing-other-browsing-contexts><span class=secno>5.2.3 </span>Accessing other browsing contexts</a></li> - <li><a href=#garbage-collection-and-browsing-contexts><span class=secno>5.2.4 </span>Garbage collection and browsing contexts</a></ol></li> + <li><a href=#garbage-collection-and-browsing-contexts><span class=secno>5.2.4 </span>Garbage collection and browsing contexts</a></li> + <li><a href=#named-access-on-the-window-object><span class=secno>5.2.5 </span>Named access on the <code>Window</code> object</a></ol></li> <li><a href=#origin><span class=secno>5.3 </span>Origin</a> <ol> <li><a href=#relaxing-the-same-origin-restriction><span class=secno>5.3.1 </span>Relaxing the same-origin restriction</a></ol></li> @@ -4478,8 +4479,9 @@ collection</a>.<p>The <dfn id=dom-htmlcollection-item title=dom-HTMLCollection-item><code>item(<var title="">index</var>)</code></dfn> method must return the <var title="">index</var>th node in the collection. If there is no <var title="">index</var>th node in the collection, then the method must return null.<p>The <dfn id=dom-htmlcollection-nameditem title=dom-HTMLCollection-namedItem><code>namedItem(<var title="">key</var>)</code></dfn> method must return the first node in the collection that matches the following requirements:<ul><li>It is an <code><a href=#the-a-element>a</a></code>, <code><a href=#the-applet-element>applet</a></code>, - <code><a href=#the-area-element>area</a></code>, <code><a href=#the-form-element>form</a></code>, <code><a href=#the-img-element>img</a></code>, or - <code><a href=#the-object-element>object</a></code> element with a <code title="">name</code> attribute equal to <var title="">key</var>, or,</li> + <code><a href=#the-area-element>area</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> + element with a <code title="">name</code> attribute equal to <var title="">key</var>, or,</li> <li>It is an element with an ID <var title="">key</var>.</li> @@ -4872,7 +4874,7 @@ <code>SVGDocument</code>.<p class=note>Because the <code><a href=#htmldocument>HTMLDocument</a></code> interface is now obtained using binding-specific casting methods instead of simply being the primary interface of the document object, it is no - longer defined as inheriting from <code>Document</code>.<pre class=idl>[<a href=#dom-document-nameditem title=dom-document-namedItem>NameGetter</a>] + longer defined as inheriting from <code>Document</code>.<pre class=idl>[<a href=#dom-document-nameditem title=dom-document-namedItem>NameGetter</a>=OverrideBuiltins]<!-- XXX http://krijnhoetmer.nl/irc-logs/whatwg/20090113#l-300 --> 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>; @@ -5246,26 +5248,60 @@ <code><a href=#the-img-element>img</a></code> elements in the <code>Document</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>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:<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>, + retrieval</dfn> using a name <var title="">name</var>, then the user + agent must return the value obtained using the following steps:<ol><li> + + <p>Let <var title="">elements</var> be 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>. + + <p class=note>There will be at least one such element, by + definition.<!-- (If there wasn't, then this algorithm wouldn't + have been invoked by WebIDL.) --></p> + + </li> + + <li> + + <p>If <var title="">elements</var> has only one element, and that + element is an <code><a href=#the-iframe-element>iframe</a></code> element, then return the + <code><a href=#window>Window</a></code> object of the <a href=#default-view>default view</a> of the + <a href=#nested-browsing-context>nested browsing context</a> represented by that + <code><a href=#the-iframe-element>iframe</a></code> element, and abort these steps.</p> + + </li> + + <li> + + <p>Otherwise, if <var title="">elements</var> has only one + element, return that element and abort these steps.</p> + + </li> + + <li> + + <p>Otherwise return 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 --> + + </li> + + <!-- + Note that this named getter overrides built-in properties, as in: + http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0D%0A...%3Ciframe%20name%3Dbody%3E%3C%2Fiframe%3E%3Cscript%3Ew(document.body)%3C%2Fscript%3E + This is what the "OverrideBuiltins" bit means in the IDL. + --> + + </ol><p><dfn id=dom-document-nameditem-filter title=dom-document-nameditem-filter>Named elements</dfn> + with the name <var title="">name</var>, for the purposes of the + above algorithm, are those that are either:<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> <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>.</li> + <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> @@ -5447,8 +5483,8 @@ <dd><code title=attr-tabindex><a href=#attr-tabindex>tabindex</a></code></dd> <dd><code title=attr-title><a href=#the-title-attribute>title</a></code></dd> </dl><p>In addition, the following <a href=#event-handler-content-attributes>event handler content - attributes</a> may be specified on any <span>HTML - element</span>:<dl class=element><dt>Event handler content attributes:</dt> + attributes</a> may be specified on any <a href=#html-elements title="HTML + elements">HTML element</a>:<dl class=element><dt>Event handler content attributes:</dt> <dd><code title=handler-onabort><a href=#handler-onabort>onabort</a></code></dd> <dd><code title=handler-onbeforeunload><a href=#handler-onbeforeunload>onbeforeunload</a></code></dd> <dd><code title=handler-onblur><a href=#handler-onblur>onblur</a></code></dd> @@ -5485,8 +5521,8 @@ <dd><code title=handler-onunload><a href=#handler-onunload>onunload</a></code></dd> </dl><p>Also, <a href=#custom-data-attribute title="custom data attribute">custom data attributes</a> (e.g. <code title="">data-foldername</code> or - <code title="">data-msgid</code>) can be specified on any <span>HTML - element</span>, to store custom data specific to the page.<p>In <a href=#html-documents>HTML documents</a>, elements in the <a href=#html-namespace-0>HTML + <code title="">data-msgid</code>) can be specified on any <a href=#html-elements title="HTML elements">HTML element</a>, to store custom data + specific to the page.<p>In <a href=#html-documents>HTML documents</a>, elements in the <a href=#html-namespace-0>HTML namespace</a> may have an <code title="">xmlns</code> attribute specified, if, and only if, it has the exact value "<code>http://www.w3.org/1999/xhtml</code>". This does not apply to @@ -27026,7 +27062,7 @@ </ol><h3 id=the-default-view><span class=secno>5.2 </span>The default view</h3><p>The <code>AbstractView</code> object of <a href=#default-view title="default view">default views</a> must also implement the - <code><a href=#window>Window</a></code> and <code>EventTarget</code> interfaces.<pre class=idl>[NoInterfaceObject, IndexGetter] + <code><a href=#window>Window</a></code> and <code>EventTarget</code> interfaces.<pre class=idl>[NoInterfaceObject, <a href=#dom-window-item title=dom-window-item>IndexGetter</a>, <a href=#dom-window-nameditem title=dom-window-namedItem>NameGetter</a>] interface <dfn id=window>Window</dfn> { // the current browsing context readonly attribute <a href=#window>Window</a> <a href=#dom-window title=dom-window>window</a>; @@ -27139,7 +27175,7 @@ <li>The <code title=dom-frames><a href=#dom-frames>frames</a></code> attribute <li>Any <span title="corresponding indexed property">corresponding - indexed properties</span> + indexed properties</span> (used for <a href=#dom-window-item title=dom-window-item>accessing nested browsing contexts</a>) </ul><p>User agents must not allow scripts to override the <code title=dom-location><a href=#dom-location>location</a></code> object's setter.<h4 id=apis-for-creating-and-navigating-browsing-contexts-by-name><span class=secno>5.2.2 </span>APIs for creating and navigating browsing contexts by name</h4><p>The <dfn id=dom-open title=dom-open><code>open()</code></dfn> method on <code><a href=#window>Window</a></code> objects provides a mechanism for <a href=#navigate title=navigate>navigating</a> an existing <a href=#browsing-context>browsing @@ -27207,11 +27243,12 @@ any instant are the numbers in the range 0 .. <var title="">n</var>, where <var title="">n</var> is the number of <a href=#child-browsing-context title="child browsing context">child browsing contexts</a> of the <a href=#active-document title="active document">active</a> - <code>Document</code>.<p>The value of a <span>corresponding indexed property</span> <var title="">index</var> whenever an indexed property on a - <code><a href=#window>Window</a></code> object is retrieved is the <var title="">index</var>th <a href=#child-browsing-context>child browsing context</a> of the - <a href=#active-document title="active document">active</a> <code>Document</code>, - sorted in document order of the elements nesting those browsing - contexts.<h4 id=garbage-collection-and-browsing-contexts><span class=secno>5.2.4 </span>Garbage collection and browsing contexts</h4><p>A <a href=#browsing-context>browsing context</a> has a strong reference to each of + <code>Document</code>.<p>The value of a <span>corresponding indexed property</span> <var title="">index</var> whenever <dfn id=dom-window-item title=dom-window-item>an + indexed property on a <code>Window</code> object is retrieved</dfn> + is the <var title="">index</var>th <a href=#child-browsing-context>child browsing + context</a> of the <a href=#active-document title="active document">active</a> + <code>Document</code>, sorted in document order of the elements + nesting those browsing contexts.<h4 id=garbage-collection-and-browsing-contexts><span class=secno>5.2.4 </span>Garbage collection and browsing contexts</h4><p>A <a href=#browsing-context>browsing context</a> has a strong reference to each of its <code>Document</code>s and <a href=#view title=view>views</a>, and the user agent itself has a strong reference to its <a href=#top-level-browsing-context title="top-level browsing context">top-level browsing contexts</a>.<p>When a <a href=#browsing-context>browsing context</a> is to <dfn id=discard-a-document>discard a @@ -27232,7 +27269,67 @@ containing one or more <a href=#top-level-browsing-context title="top-level browsing context">top-level browsing contexts</a>). Other <a href=#browsing-context title="browsing context">browsing contexts</a> must be discarded once their <code><a href=#window>Window</a></code> object is eligible for garbage - collection.<h3 id=origin><span class=secno>5.3 </span>Origin</h3><!-- Hallowed are the Ori --><p>The <dfn id=origin-0>origin</dfn> of a resource and the <dfn id=effective-script-origin>effective script + collection.<h4 id=named-access-on-the-window-object><span class=secno>5.2.5 </span>Named access on the <code><a href=#window>Window</a></code> object</h4><p>The <code><a href=#window>Window</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:<ul><li>The value of the <code title="">name</code> content attribute + for all <code><a href=#the-a-element>a</a></code>, <code><a href=#the-applet-element>applet</a></code>, <code><a href=#the-area-element>area</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 + <a href=#active-document>active document</a> that have a <code title="">name</code> + content attribute, and,</li> + + <li>The value of the <code title=attr-id><a href=#the-id-attribute>id</a></code> content + attribute of any <a href=#html-elements title="HTML elements">HTML element</a> in + the <a href=#active-document>active document</a> with an <code title=attr-id><a href=#the-id-attribute>id</a></code> content attribute.</li> + + </ul><p>When <dfn id=dom-window-nameditem title=dom-window-namedItem>the <code>Window</code> + object is indexed for property retrieval</dfn> using a name <var title="">name</var>, then the user agent must return the value + obtained using the following steps:<ol><li> + + <p>Let <var title="">elements</var> be the list of <a href=#dom-window-nameditem-filter title=dom-window-namedItem-filter>named elements</a> with the + name <var title="">name</var> in the <a href=#active-document>active document</a>. + + <p class=note>There will be at least one such element, by + definition.<!-- (If there wasn't, then this algorithm wouldn't + have been invoked by WebIDL.) --></p> + + </li> + + <li> + + <p>If <var title="">elements</var> contains an <code><a href=#the-iframe-element>iframe</a></code> + element, then return the <code><a href=#window>Window</a></code> object of the + <a href=#default-view>default view</a> of the <a href=#nested-browsing-context>nested browsing + context</a> represented by the first such <code><a href=#the-iframe-element>iframe</a></code> + element in <a href=#tree-order>tree order</a>, and abort these steps.</p> + + </li> + + <li> + + <p>Otherwise, if <var title="">elements</var> has only one + element, return that element and abort these steps.</p> + + </li> + + <li> + + <p>Otherwise return an <code><a href=#htmlcollection-0>HTMLCollection</a></code> rooted at the + <code>Document</code> node, whose filter matches only <a href=#dom-window-nameditem-filter title=dom-window-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 --> + + </li> + + </ol><p><dfn id=dom-window-nameditem-filter title=dom-window-nameditem-filter>Named elements</dfn> + with the name <var title="">name</var>, for the purposes of the + above algorithm, are those that are either:<ul><li><code><a href=#the-a-element>a</a></code>, <code><a href=#the-applet-element>applet</a></code>, <code><a href=#the-area-element>area</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><a href=#html-elements>HTML elements</a> 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>.</li> + + </ul><h3 id=origin><span class=secno>5.3 </span>Origin</h3><!-- Hallowed are the Ori --><p>The <dfn id=origin-0>origin</dfn> of a resource and the <dfn id=effective-script-origin>effective script origin</dfn> of a resource are both either opaque identifiers or tuples consisting of a scheme component, a host component, a port component, and optionally extra data.<p class=note>The extra data could include the certificate of the
Received on Tuesday, 13 January 2009 07:46:54 UTC