Skip to content

Commit

Permalink
[w] (2) Make document.open() and window.open() return things.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.whatwg.org/webapps@1006 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Aug 15, 2007
1 parent 7a1a00b commit cf4f212
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 39 deletions.
86 changes: 54 additions & 32 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -1561,6 +1561,12 @@

<li><a href="#rendering"><span class=secno>10. </span>Rendering</a>
<ul class=toc>
<li>
<ul class=toc>
<li><a href="#section"><span class=secno>10.0.1. </span>Section
headers</a>
</ul>

<li><a href="#rendering0"><span class=secno>10.1. </span>Rendering and
the DOM</a>

Expand Down Expand Up @@ -2434,11 +2440,11 @@

// <a href="#dynamic2">Dynamic markup insertion</a>
attribute DOMString <a href="#innerhtml" title=dom-innerHTML>innerHTML</a>;
void <a href="#open" title=dom-document-open>open</a>();
void <a href="#open" title=dom-document-open>open</a>(in DOMString type);
void <a href="#open" title=dom-document-open>open</a>(in DOMString type, in DOMString replace);
void <a href="#open" title=dom-document-open>open</a>(in DOMString url, in DOMString name, in DOMString features);
void <a href="#open" title=dom-document-open>open</a>(in DOMString url, in DOMString name, in DOMString features, in bool replace);
<a href="#htmldocument">HTMLDocument</a> <a href="#open" title=dom-document-open>open</a>();
<a href="#htmldocument">HTMLDocument</a> <a href="#open" title=dom-document-open>open</a>(in DOMString type);
<a href="#htmldocument">HTMLDocument</a> <a href="#open" title=dom-document-open>open</a>(in DOMString type, in DOMString replace);
<a href="#window">Window</a> <a href="#open" title=dom-document-open>open</a>(in DOMString url, in DOMString name, in DOMString features);
<a href="#window">Window</a> <a href="#open" title=dom-document-open>open</a>(in DOMString url, in DOMString name, in DOMString features, in bool replace);
void <a href="#close" title=dom-document-close>close</a>();
void <a href="#document.write" title=dom-document-write>write</a>(in DOMString text);
void <a href="#document.writeln" title=dom-document-writeln>writeln</a>(in DOMString text);
Expand Down Expand Up @@ -3568,7 +3574,8 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..
the <a href="#insertion">insertion point</a> associated with that
parser's <a href="#input0">input stream</a> is not undefined (that is,
it <em>does</em> point to somewhere in the input stream), then the
method does nothing. Abort these steps.</p>
method does nothing. Abort these steps and return the
<code>Document</code> object on which the method was invoked.</p>

<p class=note>This basically causes <code title=dom-document-open><a
href="#open">document.open()</a></code> to be ignored when it's called
Expand Down Expand Up @@ -3642,6 +3649,9 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..
<p>Finally, set the <a href="#insertion">insertion point</a> to point at
just before the end of the <a href="#input0">input stream</a> (which at
this point will be empty).

<li>
<p>Return the <code>Document</code> on which the method was invoked.
</ol>

<p class=big-issue>We shouldn't hard-code <code>text/plain</code> there. We
Expand All @@ -3659,9 +3669,9 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..
of the <code>DocumentView</code> interface of the <code><a
href="#htmldocument">HTMLDocument</a></code> object, with the same
arguments as the original call to the <code title=dom-document-open><a
href="#open">open()</a></code> method. If the <code
title=dom-document-defaultView>defaultView</code> attribute of the
<code>DocumentView</code> interface of the <code><a
href="#open">open()</a></code> method, and return whatever that method
returned. If the <code title=dom-document-defaultView>defaultView</code>
attribute of the <code>DocumentView</code> interface of the <code><a
href="#htmldocument">HTMLDocument</a></code> object is null, then the
method must raise an <code>INVALID_ACCESS_ERR</code> exception.

Expand Down Expand Up @@ -5842,7 +5852,7 @@ data:text/xml,<script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[ alert('test
<ul>
<li>Some can only contain other block-level elements: <code><a
href="#blockquote">blockquote</a></code>, <code><a
href="#section">section</a></code>, <code><a
href="#section0">section</a></code>, <code><a
href="#article">article</a></code>, <code><a
href="#header">header</a></code>.

Expand Down Expand Up @@ -7745,7 +7755,7 @@ class="main"> or <div class="content">. Why do we also need a body?
href="#scoped">scoped</a></code> attribute is present: at the start of
<code><a href="#article">article</a></code>, <code><a
href="#aside">aside</a></code>, <code><a href="#div">div</a></code>, and
<code><a href="#section">section</a></code> elements.
<code><a href="#section0">section</a></code> elements.

<dt>Content model:

Expand Down Expand Up @@ -7825,7 +7835,7 @@ class="main"> or <div class="content">. Why do we also need a body?
href="#style">style</a></code> element must be the child of an <code><a
href="#article">article</a></code>, <code><a
href="#aside">aside</a></code>, <code><a href="#div">div</a></code>, or
<code><a href="#section">section</a></code> element, before any <a
<code><a href="#section0">section</a></code> element, before any <a
href="#significant0">significant text</a> or any elements other than
<code><a href="#style">style</a></code> elements.

Expand Down Expand Up @@ -8022,7 +8032,7 @@ class="main"> or <div class="content">. Why do we also need a body?
arbitrary <code><a href="#body0">body</a></code> element.

<h4 id=the-section><span class=secno>3.8.2. </span>The <dfn
id=section><code>section</code></dfn> element</h4>
id=section0><code>section</code></dfn> element</h4>

<p><a href="#sectioning" title="sectioning elements">Sectioning</a> <a
href="#block-level0" title="block-level elements">block-level element</a>.
Expand All @@ -8048,7 +8058,7 @@ class="main"> or <div class="content">. Why do we also need a body?
href="#htmlelement">HTMLElement</a></code>.
</dl>

<p>The <code><a href="#section">section</a></code> element represents a
<p>The <code><a href="#section0">section</a></code> element represents a
generic document or application section. A section, in this context, is a
thematic grouping of content, typically with a header, possibly with a
footer.
Expand All @@ -8058,8 +8068,8 @@ class="main"> or <div class="content">. Why do we also need a body?
site's home page could be split into sections for an introduction, news
items, contact information.

<p>Each <code><a href="#section">section</a></code> element potentially has
a heading. See the section on <a href="#headings0">headings and
<p>Each <code><a href="#section0">section</a></code> element potentially
has a heading. See the section on <a href="#headings0">headings and
sections</a> for further details.

<h4 id=the-nav><span class=secno>3.8.3. </span>The <dfn
Expand Down Expand Up @@ -8360,7 +8370,7 @@ XXX attributes to give the date authored, date published
<p><code><a href="#header">header</a></code> elements must not contain any
<code><a href="#header">header</a></code> elements, <code><a
href="#footer">footer</a></code> elements, or any sectioning elements
(such as <code><a href="#section">section</a></code>) as descendants.
(such as <code><a href="#section0">section</a></code>) as descendants.

<p><code><a href="#header">header</a></code> elements must have at least
one <code><a href="#h1">h1</a></code>, <code><a href="#h2">h2</a></code>,
Expand Down Expand Up @@ -8465,7 +8475,7 @@ XXX attributes to give the date authored, date published
<code><a href="#h2">h2</a></code>, <code><a href="#h3">h3</a></code>,
<code><a href="#h4">h4</a></code>, <code><a href="#h5">h5</a></code>, or
<code><a href="#h6">h6</a></code> elements, or any of the sectioning
elements (such as <code><a href="#section">section</a></code>), as
elements (such as <code><a href="#section0">section</a></code>), as
descendants.

<p>When <a href="#determining1" title="Determining if a particular element
Expand Down Expand Up @@ -8604,14 +8614,14 @@ XXX attributes to give the date authored, date published
<li> Quux (heading starting implied section)

<li> Thud (heading of explicit <code><a
href="#section">section</a></code> section)
href="#section0">section</a></code> section)
</ol>
Grunt (paragraph)
</ol>

<p>Notice how the <code><a href="#blockquote">blockquote</a></code> nests
inside an implicit section while the <code><a
href="#section">section</a></code> does not (and in fact, ends the
href="#section0">section</a></code> does not (and in fact, ends the
earlier implicit section so that a later paragraph is back at the top
level).</p>
</div>
Expand Down Expand Up @@ -23533,6 +23543,11 @@ XXX selection ranges -->
href="#the-rules">the rules for chosing a browsing context given a
browsing context name</a>.

<p>The method must return the <code><a href="#window">Window</a></code>
object of the default view of the <a href="#browsing0">browsing
context</a> that was navigated, or null if no browsing context was
navigated.

<p>The <dfn id=name3 title=dom-name><code>name</code></dfn> attribute of
the <code><a href="#window">Window</a></code> object must, on getting,
return the current name of the <a href="#browsing0">browsing context</a>,
Expand Down Expand Up @@ -29027,7 +29042,7 @@ interface <dfn id=storageitem>StorageItem</dfn> {
<p>...the user agent should allow the user to insert <code><a
href="#p">p</a></code> elements before and after the <code><a
href="#dl">dl</a></code> element, as children of the <code><a
href="#section">section</a></code> element.</p>
href="#section0">section</a></code> element.</p>
</div>

<dt id=contenteditable-breakBlock>Break block
Expand Down Expand Up @@ -36265,7 +36280,7 @@ function receiver(e) {

<p class=big-issue>Still need to add these new elements to the lists:
<code><a href="#event-source">event-source</a></code>, <code><a
href="#section">section</a></code>, <code><a href="#nav">nav</a></code>,
href="#section0">section</a></code>, <code><a href="#nav">nav</a></code>,
<code><a href="#article">article</a></code>, <code><a
href="#aside">aside</a></code>, <code><a href="#header">header</a></code>,
<code><a href="#footer">footer</a></code>, <code><a
Expand Down Expand Up @@ -41463,12 +41478,18 @@ NOFRAMES S SPACER STRIKE TT U -->
<pre>@namespace xh url(http://www.w3.org/1999/xhtml);
xh|section { display: block; margin: 1em 0; }</pre>

<h4>Section headers</h4>

<p>For <code>h1</code> elements, CSS-aware visual user agents should
derive the size of the header from the level of <code>section</code>
nesting. This effect should be achieved by including the following
rules, or their equivalent, in the UA's user agent style sheet:</p>
<!-- XXX alt="": Define that either the src="" is shown (as an image)
or the alt="" is shown (inline) but should not ever have both at
once. -->

<h4 id=section><span class=secno>10.0.1. </span>Section headers</h4>

<p>For <code><a href="#h1">h1</a></code> elements, CSS-aware visual user
agents should derive the size of the header from the level of <code><a
href="#section0">section</a></code> nesting. This effect should be
achieved by including the following rules, or their equivalent, in the
UA's user agent style sheet:

<pre>@namespace xh url(http://www.w3.org/1999/xhtml);
xh|section xh|h1 { /* same styles as h2 */ }
Expand All @@ -41477,12 +41498,13 @@ xh|section xh|section xh|section xh|h1 { /* same styles as h4 */ }
xh|section xh|section xh|section xh|section xh|h1 { /* same styles as h5 */ }
xh|section xh|section xh|section xh|section xh|section xh|h1 { /* same styles as h6 */ }</pre>

<p>Authors should use <code>h1</code> elements to denote headers in
sections. Authors may instead use <code>h2</code> ...
<code>h6</code> elements, for backwards compatibility with user
agents that do not support <code>section</code> elements.</p>
<p>Authors should use <code><a href="#h1">h1</a></code> elements to denote
headers in sections. Authors may instead use <code><a
href="#h2">h2</a></code> ... <code><a href="#h6">h6</a></code> elements,
for backwards compatibility with user agents that do not support <code><a
href="#section0">section</a></code> elements.

-->
<p>-->

<p class=big-issue> must define letting the user <dfn id=obtain>obtain a
physical form</dfn> of a document (printing) and what this means for the
Expand Down
28 changes: 21 additions & 7 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -934,11 +934,11 @@

// <span>Dynamic markup insertion</span>
attribute DOMString <span title="dom-innerHTML">innerHTML</span>;
void <span title="dom-document-open">open</span>();
void <span title="dom-document-open">open</span>(in DOMString type);
void <span title="dom-document-open">open</span>(in DOMString type, in DOMString replace);
void <span title="dom-document-open">open</span>(in DOMString url, in DOMString name, in DOMString features);
void <span title="dom-document-open">open</span>(in DOMString url, in DOMString name, in DOMString features, in bool replace);
<span>HTMLDocument</span> <span title="dom-document-open">open</span>();
<span>HTMLDocument</span> <span title="dom-document-open">open</span>(in DOMString type);
<span>HTMLDocument</span> <span title="dom-document-open">open</span>(in DOMString type, in DOMString replace);
<span>Window</span> <span title="dom-document-open">open</span>(in DOMString url, in DOMString name, in DOMString features);
<span>Window</span> <span title="dom-document-open">open</span>(in DOMString url, in DOMString name, in DOMString features, in bool replace);
void <span title="dom-document-close">close</span>();
void <span title="dom-document-write">write</span>(in DOMString text);
void <span title="dom-document-writeln">writeln</span>(in DOMString text);
Expand Down Expand Up @@ -2095,7 +2095,8 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..
<span>insertion point</span> associated with that parser's
<span>input stream</span> is not undefined (that is, it
<em>does</em> point to somewhere in the input stream), then the
method does nothing. Abort these steps.</p>
method does nothing. Abort these steps and return the
<code>Document</code> object on which the method was invoked.</p>

<p class="note">This basically causes <code
title="dom-document-open">document.open()</code> to be ignored
Expand Down Expand Up @@ -2165,6 +2166,9 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..
just before the end of the <span>input stream</span> (which at this
point will be empty).</p></li>

<li><p>Return the <code>Document</code> on which the method was
invoked.</p></li>

</ol>

<p class="big-issue">We shouldn't hard-code <code>text/plain</code>
Expand All @@ -2183,7 +2187,8 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..
title="dom-document-defaultView">defaultView</code> attribute of the
<code>DocumentView</code> interface of the <code>HTMLDocument</code>
object, with the same arguments as the original call to the <code
title="dom-document-open">open()</code> method. If the <code
title="dom-document-open">open()</code> method, and return whatever
that method returned. If the <code
title="dom-document-defaultView">defaultView</code> attribute of the
<code>DocumentView</code> interface of the <code>HTMLDocument</code>
object is null, then the method must raise an
Expand Down Expand Up @@ -21198,6 +21203,10 @@ XXX selection ranges -->
<span>the rules for chosing a browsing context given a browsing
context name</span>.</p>

<p>The method must return the <code>Window</code> object of the
default view of the <span>browsing context</span> that was
navigated, or null if no browsing context was navigated.</p>

<p>The <dfn title="dom-name"><code>name</code></dfn> attribute of
the <code>Window</code> object must, on getting, return the current
name of the <span>browsing context</span>, and, on setting, set the
Expand Down Expand Up @@ -37374,6 +37383,11 @@ NOFRAMES S SPACER STRIKE TT U -->
<pre>@namespace xh url(http://www.w3.org/1999/xhtml);
xh|section { display: block; margin: 1em 0; }</pre>


<!-- XXX alt="": Define that either the src="" is shown (as an image)
or the alt="" is shown (inline) but should not ever have both at
once. -->

<h4>Section headers</h4>

<p>For <code>h1</code> elements, CSS-aware visual user agents should
Expand Down

0 comments on commit cf4f212

Please sign in to comment.