[html5] r7551 - [giow] (1) Add document.currentScript, as implemented by Mozilla. Affected topic [...]
whatwg at whatwg.org
whatwg at whatwg.org
Wed Nov 28 17:32:54 PST 2012
Author: ianh
Date: 2012-11-28 17:32:53 -0800 (Wed, 28 Nov 2012)
New Revision: 7551
Modified:
complete.html
index
source
Log:
[giow] (1) Add document.currentScript, as implemented by Mozilla.
Affected topics: DOM APIs, HTML
Modified: complete.html
===================================================================
--- complete.html 2012-11-29 00:51:32 UTC (rev 7550)
+++ complete.html 2012-11-29 01:32:53 UTC (rev 7551)
@@ -9725,6 +9725,7 @@
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);
@@ -10284,6 +10285,26 @@
</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>
@@ -16757,6 +16778,21 @@
<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
script</a> from the <code><a href=#the-script-element>script</a></code> element node, using
<var><a href="#the-script-block's-source">the script block's source</a></var>, the <a href=#url>URL</a>
@@ -16774,6 +16810,13 @@
<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
counter</a> of <var title="">neutralized doc</var>, if it
was incremented in the earlier step.</p>
Modified: index
===================================================================
--- index 2012-11-29 00:51:32 UTC (rev 7550)
+++ index 2012-11-29 01:32:53 UTC (rev 7551)
@@ -9725,6 +9725,7 @@
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);
@@ -10284,6 +10285,26 @@
</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>
@@ -16757,6 +16778,21 @@
<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
script</a> from the <code><a href=#the-script-element>script</a></code> element node, using
<var><a href="#the-script-block's-source">the script block's source</a></var>, the <a href=#url>URL</a>
@@ -16774,6 +16810,13 @@
<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
counter</a> of <var title="">neutralized doc</var>, if it
was incremented in the earlier step.</p>
Modified: source
===================================================================
--- source 2012-11-29 00:51:32 UTC (rev 7550)
+++ source 2012-11-29 01:32:53 UTC (rev 7551)
@@ -9678,6 +9678,7 @@
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);
@@ -10355,8 +10356,35 @@
</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>
<p id="dom-document-namedItem-which">The <code>Document</code>
@@ -17707,6 +17735,23 @@
<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
script</span> from the <code>script</code> element node, using
<var>the script block's source</var>, the <span>URL</span>
@@ -17725,6 +17770,14 @@
<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
counter</span> of <var title="">neutralized doc</var>, if it
was incremented in the earlier step.</p>
More information about the Commit-Watchers
mailing list