Skip to content
Permalink
Browse files

[] (0) Define window.frameElement.

git-svn-id: http://svn.whatwg.org/webapps@2068 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Aug 13, 2008
1 parent a0d0f63 commit fe1280419f05decf225979734e812cad431068f9
Showing with 110 additions and 54 deletions.
  1. +71 −42 index
  2. +39 −12 source
113 index
<p>The <dfn id=name1 title=attr-iframe-name><code>name</code></dfn>
attribute, if present, must be a <a href="#valid9">valid browsing context
name</a>. When the browsing context is created, if the attribute is
present, the <a href="#browsing2">browsing context name</a> must be set to
the value of this attribute; otherwise, the <a href="#browsing2">browsing
present, the <a href="#browsing3">browsing context name</a> must be set to
the value of this attribute; otherwise, the <a href="#browsing3">browsing
context name</a> must be set to the empty string.

<p>Whenever the <code title=attr-iframe-name><a
href="#name1">name</a></code> attribute is set, the nested <a
href="#browsing1">browsing context</a>'s <a href="#browsing2"
href="#browsing1">browsing context</a>'s <a href="#browsing3"
title="browsing context name">name</a> must be changed to the new value.
If the attribute is removed, the <a href="#browsing2">browsing context
If the attribute is removed, the <a href="#browsing3">browsing context
name</a> must be set to the empty string.

<p>When content loads in an <code><a href="#iframe">iframe</a></code>,

<p>If the <code title=attr-object-name><a
href="#name3">name</a></code> attribute is present, the <a
href="#browsing2">browsing context name</a> must be set to the value
of this attribute; otherwise, the <a href="#browsing2">browsing
href="#browsing3">browsing context name</a> must be set to the value
of this attribute; otherwise, the <a href="#browsing3">browsing
context name</a> must be set to the empty string.</p>

<p class=big-issue>navigation might end up treating it as something
<p>Whenever the <code title=attr-object-name><a
href="#name3">name</a></code> attribute is set, if the <code><a
href="#object">object</a></code> element has a nested <a
href="#browsing1">browsing context</a>, its <a href="#browsing2"
href="#browsing1">browsing context</a>, its <a href="#browsing3"
title="browsing context name">name</a> must be changed to the new value.
If the attribute is removed, if the <code><a
href="#object">object</a></code> element has a <a
href="#browsing1">browsing context</a>, the <a href="#browsing2">browsing
href="#browsing1">browsing context</a>, the <a href="#browsing3">browsing
context name</a> must be set to the empty string.

<p>The <code title=attr-hyperlink-usemap><a
elements) can instantiate further <a href="#browsing1" title="browsing
context">browsing contexts</a>. These are called <dfn id=nested0
title="nested browsing context">nested browsing contexts</dfn>. If a
browsing context <var title="">P</var> has an element in one of its
<code>Document</code>s <var title="">D</var> that nests another browsing
context <var title="">C</var> inside it, then <var title="">P</var> is
said to be the <dfn id=parent>parent browsing context</dfn> of <var
title="">C</var>, <var title="">C</var> is said to be a <dfn
id=child>child browsing context</dfn> of <var title="">P</var>, and <var
title="">C</var> is said to be <dfn id=nested1 title="browsing context
nested through">nested through</dfn> <var title="">D</var>.
browsing context <var title="">P</var> has an element <var
title="">E</var> in one of its <code>Document</code>s <var
title="">D</var> that nests another browsing context <var title="">C</var>
inside it, then <var title="">P</var> is said to be the <dfn
id=parent>parent browsing context</dfn> of <var title="">C</var>, <var
title="">C</var> is said to be a <dfn id=child>child browsing
context</dfn> of <var title="">P</var>, <var title="">C</var> is said to
be <dfn id=nested1 title="browsing context nested through">nested
through</dfn> <var title="">D</var>, and <var title="">E</var> is said to
be the <dfn id=browsing2>browsing context container</dfn> of <var
title="">C</var>.

<p>A browsing context <var title="">A</var> is said to be an ancestor of a
browsing context <var title="">B</var> if there exists a browsing context
<code><a href="#window">Window</a></code> object if it was a <a
href="#top-level">top-level browsing context</a> itself).

<hr>

<p>The <dfn id=parent0 title=dom-parent><code>parent</code></dfn> DOM
attribute on the <code><a href="#window">Window</a></code> object of a <a
href="#browsing1">browsing context</a> <var title="">b</var> must return
otherwise (i.e. if it is a <a href="#top-level">top-level browsing
context</a>).

<p>The <dfn id=frameelement
title=dom-frameElement><code>frameElement</code></dfn> DOM attribute on
the <code><a href="#window">Window</a></code> object of a <a
href="#browsing1">browsing context</a> <var title="">b</var>, on getting,
must run the following algorithm:

<ol>
<li>
<p>If <var title="">b</var> is not a <a href="#child">child browsing
context</a>, return null and abort these steps.

<li>
<p>If the <a href="#parent">parent browsing context</a>'s <a
href="#active">active document</a> does not have the <span>same</span>
<span>effective origin</span> as the script that is accessing the <code
title=dom-frameElement><a href="#frameelement">frameElement</a></code>
attribute, then throw a <a href="#security10">security exception</a>.

<li>
<p>Otherwise, return the <a href="#browsing2">browsing context
container</a> for <var title="">b</var>.
</ol>

<h4 id=auxiliary><span class=secno>5.1.2 </span>Auxiliary browsing contexts</h4>

<p>It is possible to create new browsing contexts that are related to a

<h4 id=browsing><span class=secno>5.1.6 </span>Browsing context names</h4>

<p>Browsing contexts can have a <dfn id=browsing2>browsing context
<p>Browsing contexts can have a <dfn id=browsing3>browsing context
name</dfn>. By default, a browsing context has no name (its name is not
set).


<li>
<p>If the given browsing context name is not <code title="">_blank</code>
and there exists a browsing context whose <a href="#browsing2"
and there exists a browsing context whose <a href="#browsing3"
title="browsing context name">name</a> is the same as the given browsing
context name, and the current browsing context is <a
href="#allowed">allowed to navigate</a> that browsing context, and the
readonly attribute <a href="#window">Window</a> <a href="#top0" title=dom-top>top</a>;
readonly attribute <a href="#window">Window</a> <a href="#opener0" title=dom-opener>opener</a>;
readonly attribute <a href="#window">Window</a> <a href="#parent0" title=dom-parent>parent</a>;
readonly attribute <span>Element</span> <a href="#frameelement" title=dom-frameElement>frameElement</a>;
<a href="#window">Window</a> <a href="#open2" title=dom-open>open</a>();
<a href="#window">Window</a> <a href="#open2" title=dom-open>open</a>(in DOMString url);
<a href="#window">Window</a> <a href="#open2" title=dom-open>open</a>(in DOMString url, in DOMString target);
invoked.

<p>The second argument, <var title="">target</var>, specifies the <a
href="#browsing2" title="browsing context name">name</a> of the browsing
href="#browsing3" title="browsing context name">name</a> of the browsing
context that is to be navigated. It must be a <a href="#valid10">valid
browsing context name or keyword</a>. If fewer than two arguments are
provided, then the <var title="">name</var> argument defaults to the value
href="#current1">current entry</a>, then the following sub-sub-steps
must be run:
<ol>
<li>The current <a href="#browsing2">browsing context name</a> must be
<li>The current <a href="#browsing3">browsing context name</a> must be
stored with all the entries in the history that are associated with
<code>Document</code> objects with the <a href="#same-origin">same
origin</a> as the <a href="#active">active document</a> <em>and</em>
that are contiguous with the <a href="#current1">current entry</a>.

<li id=resetBCName>The browsing context's <a
href="#browsing2">browsing context name</a> must be unset.
href="#browsing3">browsing context name</a> must be unset.
</ol>

<li id=appcache-history-2>The user agent must make the <i>specified
href="#appcache-history-1">change</a> which <a
href="#application0">application cache</a> it is associated with.)

<li>If the <i>specified entry</i> has a <a href="#browsing2">browsing
<li>If the <i>specified entry</i> has a <a href="#browsing3">browsing
context name</a> stored with it, then the following sub-sub-steps must
be run:
<ol>
<li>The browsing context's <a href="#browsing2">browsing context
<li>The browsing context's <a href="#browsing3">browsing context
name</a> must be set to the name stored with the specified entry.

<li>Any <a href="#browsing2">browsing context name</a> stored with the
<li>Any <a href="#browsing3">browsing context name</a> stored with the
entries in the history that are associated with <code>Document</code>
objects with the <a href="#same-origin">same origin</a> as the new <a
href="#active">active document</a>, and that are contiguous with the
Distler, James Graham, James Justin Harrell, James M Snell, James Perrett,
Jan-Klaas Kollhof, Jason White, Jasper Bryant-Greene, Jeff Cutsinger, Jeff
Schiller, Jeff Walden, Jens Bannmann, Jens Fendler, Jeroen van der Meer,
Jim Jewett, Jim Meehan, Joe Clark, Jjgod Jiang, Joel Spolsky, Johan
Herland, John Boyer, John Bussjaeger, John Harding, Johnny Stenback, Jon
Perlow, Jonathan Worent, Jorgen Horstink, Josh Levenberg, Joshua Randall,
Jukka K. Korpela, Julian Reschke, Kai Hendry, <!-- Keryx Web, = Lars
Gunther -->
Kornel Lesinski, &#x9ed2;&#x6fa4;&#x525b;&#x5fd7; (KUROSAWA Takeshi),
Kristof Zelechovski, Lachlan Hunt, Larry Page, Lars Gunther, Laura L.
Carlson, Laura Wisewell, Laurens Holst, Lee Kowalkowski, Leif Halvard
Silli, Lenny Domnitser, L&eacute;onard Bouchet, Leons Petrazickis,
Logan<!-- on moz irc -->, Loune, Maciej Stachowiak, Magnus
Kristiansen<!-- Dashiva -->, Malcolm Rowe, Mark Nottingham, Mark
Rowe<!--bdash-->, Mark Schenk, Martijn Wargers, Martin Atkins, Martin
D&uuml;rst, Martin Honnen, Masataka Yakura, Mathieu Henri, Matthew
Mastracci, Matthew Raymond, Matthew Thomas, Mattias Waldau, Max
Romantschuk, Michael 'Ratt' Iannarelli, Michael A. Nachbaur, Michael A.
Puls II<!--Shadow2531-->, Michael Carter, Michael Gratton, Michael Powers,
Michael(tm) Smith, Michel Fortin, Michiel van der Blonk, Mihai
&#x015E;ucan<!-- from ROBO Design -->, Mike Brown, Mike
Jim Jewett, Jim Meehan, Joe Clark, Joseph Kesselman, Jjgod Jiang, Joel
Spolsky, Johan Herland, John Boyer, John Bussjaeger, John Harding, Johnny
Stenback, Jon Perlow, Jonathan Worent, Jorgen Horstink, Josh Levenberg,
Joshua Randall, Jukka K. Korpela, Julian Reschke, Kai Hendry,
<!-- Keryx Web, = Lars
Gunther --> Kornel Lesinski,
&#x9ed2;&#x6fa4;&#x525b;&#x5fd7; (KUROSAWA Takeshi), Kristof Zelechovski,
Lachlan Hunt, Larry Page, Lars Gunther, Laura L. Carlson, Laura Wisewell,
Laurens Holst, Lee Kowalkowski, Leif Halvard Silli, Lenny Domnitser,
L&eacute;onard Bouchet, Leons Petrazickis, Logan<!-- on moz irc -->,
Loune, Maciej Stachowiak, Magnus Kristiansen<!-- Dashiva -->, Malcolm
Rowe, Mark Nottingham, Mark Rowe<!--bdash-->, Mark Schenk, Martijn
Wargers, Martin Atkins, Martin D&uuml;rst, Martin Honnen, Masataka Yakura,
Mathieu Henri, Matthew Mastracci, Matthew Raymond, Matthew Thomas, Mattias
Waldau, Max Romantschuk, Michael 'Ratt' Iannarelli, Michael A. Nachbaur,
Michael A. Puls II<!--Shadow2531-->, Michael Carter, Michael Gratton,
Michael Powers, Michael(tm) Smith, Michel Fortin, Michiel van der Blonk,
Mihai &#x015E;ucan<!-- from ROBO Design -->, Mike Brown, Mike
Dierken<!-- S. Mike Dierken -->, Mike Dixon, Mike Schinkel, Mike Shaver,
Mikko Rantalainen, Neil Deakin, Neil Soiffer, Olaf Hoffmann, Olav Junker
Kj&aelig;r, Oliver Hunt, Peter Karlsson, Peter Kasting, Philip
51 source
instantiate further <span title="browsing context">browsing
contexts</span>. These are called <dfn title="nested browsing
context">nested browsing contexts</dfn>. If a browsing context <var
title="">P</var> has an element in one of its <code>Document</code>s
<var title="">D</var> that nests another browsing context <var
title="">C</var> inside it, then <var title="">P</var> is said to be
the <dfn>parent browsing context</dfn> of <var title="">C</var>,
<var title="">C</var> is said to be a <dfn>child browsing
context</dfn> of <var title="">P</var>, and <var title="">C</var> is
said to be <dfn title="browsing context nested through">nested
through</dfn> <var title="">D</var>.</p>
title="">P</var> has an element <var title="">E</var> in one of its
<code>Document</code>s <var title="">D</var> that nests another
browsing context <var title="">C</var> inside it, then <var
title="">P</var> is said to be the <dfn>parent browsing
context</dfn> of <var title="">C</var>, <var title="">C</var> is
said to be a <dfn>child browsing context</dfn> of <var
title="">P</var>, <var title="">C</var> is said to be <dfn
title="browsing context nested through">nested through</dfn> <var
title="">D</var>, and <var title="">E</var> is said to be the
<dfn>browsing context container</dfn> of <var title="">C</var>.</p>

<p>A browsing context <var title="">A</var> is said to be an
ancestor of a browsing context <var title="">B</var> if there exists
<code>Window</code> object if it was a <span>top-level browsing
context</span> itself).</p>

<hr>

<p>The <dfn title="dom-parent"><code>parent</code></dfn> DOM
attribute on the <code>Window</code> object of a <span>browsing
context</span> <var title="">b</var> must return the
itself, otherwise (i.e. if it is a <span>top-level browsing
context</span>).</p>

<p>The <dfn title="dom-frameElement"><code>frameElement</code></dfn>
DOM attribute on the <code>Window</code> object of a <span>browsing
context</span> <var title="">b</var>, on getting, must run the
following algorithm:</p>

<ol>

<li><p>If <var title="">b</var> is not a <span>child browsing
context</span>, return null and abort these steps.</p></li>

<li><p>If the <span>parent browsing context</span>'s <span>active
document</span> does not have the <span>same</span> <span>effective
origin</span> as the script that is accessing the <code
title="dom-frameElement">frameElement</code> attribute, then throw
a <span>security exception</span>.</p></li>

<li><p>Otherwise, return the <span>browsing context
container</span> for <var title="">b</var>.</p></li>

</ol>


<h4>Auxiliary browsing contexts</h4>

readonly attribute <span>Window</span> <span title="dom-top">top</span>;
readonly attribute <span>Window</span> <span title="dom-opener">opener</span>;
readonly attribute <span>Window</span> <span title="dom-parent">parent</span>;
readonly attribute <span>Element</span> <span title="dom-frameElement">frameElement</span>;
<span>Window</span> <span title="dom-open">open</span>();
<span>Window</span> <span title="dom-open">open</span>(in DOMString url);
<span>Window</span> <span title="dom-open">open</span>(in DOMString url, in DOMString target);




<h4>APIs for creating and navigating browsing contexts by name</h4>

<p>The <dfn title="dom-open"><code>open()</code></dfn> method on
James Perrett, Jan-Klaas Kollhof, Jason White, Jasper Bryant-Greene,
Jeff Cutsinger, Jeff Schiller, Jeff Walden, Jens Bannmann, Jens
Fendler, Jeroen van der Meer, Jim Jewett, Jim Meehan, Joe Clark,
Jjgod Jiang, Joel Spolsky, Johan Herland, John Boyer, John
Bussjaeger, John Harding, Johnny Stenback, Jon Perlow, Jonathan
Worent, Jorgen Horstink, Josh Levenberg, Joshua Randall, Jukka
K. Korpela, Julian Reschke, Kai Hendry, <!-- Keryx Web, = Lars
Joseph Kesselman, Jjgod Jiang, Joel Spolsky, Johan Herland, John
Boyer, John Bussjaeger, John Harding, Johnny Stenback, Jon Perlow,
Jonathan Worent, Jorgen Horstink, Josh Levenberg, Joshua Randall,
Jukka K. Korpela, Julian Reschke, Kai Hendry, <!-- Keryx Web, = Lars
Gunther --> Kornel Lesinski, &#x9ed2;&#x6fa4;&#x525b;&#x5fd7;
(KUROSAWA Takeshi), Kristof Zelechovski, Lachlan Hunt, Larry Page,
Lars Gunther, Laura L. Carlson, Laura Wisewell, Laurens Holst, Lee

0 comments on commit fe12804

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