Skip to content
Permalink
Browse files

[giow] (1) Add document.currentScript, as implemented by Mozilla.

Affected topics: DOM APIs, HTML

git-svn-id: http://svn.whatwg.org/webapps@7551 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Nov 29, 2012
1 parent 72d811f commit 96e0dcfd12f729e50808d63b0991edbc943066e2
Showing with 139 additions and 0 deletions.
  1. +43 −0 complete.html
  2. +43 −0 index
  3. +53 −0 source
NodeList <a href=#dom-document-getelementsbyname title=dom-document-getElementsByName>getElementsByName</a>(DOMString elementName);
NodeList <a href=#dom-document-getitems title=dom-document-getItems>getItems</a>(optional DOMString typeNames); // <a href=#microdata>microdata</a>
readonly attribute <a href=#domelementmap>DOMElementMap</a> <a href=#dom-document-csselementmap title=dom-document-cssElementMap>cssElementMap</a>;
readonly attribute <a href=#htmlscriptelement>HTMLScriptElement</a>? <a href=#dom-document-currentscript title=dom-document-currentScript>currentScript</a>;

// <a href=#dynamic-markup-insertion>dynamic markup insertion</a>
<a href=#document>Document</a> <a href=#dom-document-open title=dom-document-open>open</a>(optional DOMString type, optional DOMString replace);

</div>

<hr><dl class=domintro><dt><var title="">document</var> . <code title=dom-document-currentScript><a href=#dom-document-currentscript>currentScript</a></code></dt>
<dd>

<p>Returns the <code><a href=#the-script-element>script</a></code> element that is currently executing. In the case of reentrant
<code><a href=#the-script-element>script</a></code> execution, returns the one that most recently started executing amongst
those that have not yet finished executing.</p>

<p>Returns null if the <code><a href=#document>Document</a></code> is not currently executing a <code><a href=#the-script-element>script</a></code>
element (e.g. because the running script is an event handler, or a timeout).</p>

</dd>

</dl><div class=impl>

<p>The <dfn id=dom-document-currentscript title=dom-document-currentScript><code>currentScript</code></dfn> attribute, on
getting, must return the value to which it was most recently initialized. When the
<code><a href=#document>Document</a></code> is created, the <code title=dom-document-currentScript><a href=#dom-document-currentscript>currentScript</a></code> must be initialized to null.</p>

</div>

<div class=impl>

<hr><p id=dom-document-namedItem-which>The <code><a href=#document>Document</a></code>

</li>

<li>

<p>Let <var title="">old script element</var> be the value to which the
<code><a href=#document>Document</a></code> element's <code title=dom-document-currentScript><a href=#dom-document-currentscript>currentScript</a></code> object was most recently
initialized.</p>

</li>

<li>

<p>Initialize the <code><a href=#document>Document</a></code> element's <code title=dom-document-currentScript><a href=#dom-document-currentscript>currentScript</a></code> object to the <code><a href=#the-script-element>script</a></code>
element.</p>

</li>

<li>

<p><a href=#create-a-script-from-a-node title="create a script from a node">Create a

</li>

<li>

<p>Initialize the <code><a href=#document>Document</a></code> element's <code title=dom-document-currentScript><a href=#dom-document-currentscript>currentScript</a></code> object to <var title="">old script
element</var>.</p>

</li>

<li>

<p>Decrement the <a href=#ignore-destructive-writes-counter>ignore-destructive-writes
43 index
NodeList <a href=#dom-document-getelementsbyname title=dom-document-getElementsByName>getElementsByName</a>(DOMString elementName);
NodeList <a href=#dom-document-getitems title=dom-document-getItems>getItems</a>(optional DOMString typeNames); // <a href=#microdata>microdata</a>
readonly attribute <a href=#domelementmap>DOMElementMap</a> <a href=#dom-document-csselementmap title=dom-document-cssElementMap>cssElementMap</a>;
readonly attribute <a href=#htmlscriptelement>HTMLScriptElement</a>? <a href=#dom-document-currentscript title=dom-document-currentScript>currentScript</a>;

// <a href=#dynamic-markup-insertion>dynamic markup insertion</a>
<a href=#document>Document</a> <a href=#dom-document-open title=dom-document-open>open</a>(optional DOMString type, optional DOMString replace);

</div>

<hr><dl class=domintro><dt><var title="">document</var> . <code title=dom-document-currentScript><a href=#dom-document-currentscript>currentScript</a></code></dt>
<dd>

<p>Returns the <code><a href=#the-script-element>script</a></code> element that is currently executing. In the case of reentrant
<code><a href=#the-script-element>script</a></code> execution, returns the one that most recently started executing amongst
those that have not yet finished executing.</p>

<p>Returns null if the <code><a href=#document>Document</a></code> is not currently executing a <code><a href=#the-script-element>script</a></code>
element (e.g. because the running script is an event handler, or a timeout).</p>

</dd>

</dl><div class=impl>

<p>The <dfn id=dom-document-currentscript title=dom-document-currentScript><code>currentScript</code></dfn> attribute, on
getting, must return the value to which it was most recently initialized. When the
<code><a href=#document>Document</a></code> is created, the <code title=dom-document-currentScript><a href=#dom-document-currentscript>currentScript</a></code> must be initialized to null.</p>

</div>

<div class=impl>

<hr><p id=dom-document-namedItem-which>The <code><a href=#document>Document</a></code>

</li>

<li>

<p>Let <var title="">old script element</var> be the value to which the
<code><a href=#document>Document</a></code> element's <code title=dom-document-currentScript><a href=#dom-document-currentscript>currentScript</a></code> object was most recently
initialized.</p>

</li>

<li>

<p>Initialize the <code><a href=#document>Document</a></code> element's <code title=dom-document-currentScript><a href=#dom-document-currentscript>currentScript</a></code> object to the <code><a href=#the-script-element>script</a></code>
element.</p>

</li>

<li>

<p><a href=#create-a-script-from-a-node title="create a script from a node">Create a

</li>

<li>

<p>Initialize the <code><a href=#document>Document</a></code> element's <code title=dom-document-currentScript><a href=#dom-document-currentscript>currentScript</a></code> object to <var title="">old script
element</var>.</p>

</li>

<li>

<p>Decrement the <a href=#ignore-destructive-writes-counter>ignore-destructive-writes
53 source
NodeList <span title="dom-document-getElementsByName">getElementsByName</span>(DOMString elementName);
NodeList <span title="dom-document-getItems">getItems</span>(optional DOMString typeNames); // <span>microdata</span>
readonly attribute <span>DOMElementMap</span> <span title="dom-document-cssElementMap">cssElementMap</span>;
readonly attribute <span>HTMLScriptElement</span>? <span title="dom-document-currentScript">currentScript</span>;

// <span>dynamic markup insertion</span>
<span>Document</span> <span title="dom-document-open">open</span>(optional DOMString type, optional DOMString replace);

</div>

<hr>

<dl class="domintro">

<dt><var title="">document</var> . <code title="dom-document-currentScript">currentScript</code></dt>
<dd>

<p>Returns the <code>script</code> element that is currently executing. In the case of reentrant
<code>script</code> execution, returns the one that most recently started executing amongst
those that have not yet finished executing.</p>

<p>Returns null if the <code>Document</code> is not currently executing a <code>script</code>
element (e.g. because the running script is an event handler, or a timeout).</p>

</dd>

</dl>

<div class="impl">

<p>The <dfn title="dom-document-currentScript"><code>currentScript</code></dfn> attribute, on
getting, must return the value to which it was most recently initialized. When the
<code>Document</code> is created, the <code
title="dom-document-currentScript">currentScript</code> must be initialized to null.</p>

</div>

<div class="impl">

<hr>

</li>

<li>

<p>Let <var title="">old script element</var> be the value to which the
<code>Document</code> element's <code
title="dom-document-currentScript">currentScript</code> object was most recently
initialized.</p>

</li>

<li>

<p>Initialize the <code>Document</code> element's <code
title="dom-document-currentScript">currentScript</code> object to the <code>script</code>
element.</p>

</li>

<li>

<p><span title="create a script from a node">Create a

</li>

<li>

<p>Initialize the <code>Document</code> element's <code
title="dom-document-currentScript">currentScript</code> object to <var title="">old script
element</var>.</p>

</li>

<li>

<p>Decrement the <span>ignore-destructive-writes

0 comments on commit 96e0dcf

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