[html5] r8114 - [giow] (3) Try to clean up the incumbent script situation. Fixing https://www.w3 [...]

whatwg at whatwg.org whatwg at whatwg.org
Thu Aug 1 12:44:58 PDT 2013


Author: ianh
Date: 2013-08-01 12:44:55 -0700 (Thu, 01 Aug 2013)
New Revision: 8114

Modified:
   complete.html
   index
   source
Log:
[giow] (3) Try to clean up the incumbent script situation.
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=18242
Affected topics: HTML

Modified: complete.html
===================================================================
--- complete.html	2013-07-31 21:29:04 UTC (rev 8113)
+++ complete.html	2013-08-01 19:44:55 UTC (rev 8114)
@@ -256,7 +256,7 @@
 
   <header class=head id=head><p><a href=http://www.whatwg.org/ class=logo><img width=101 src=/images/logo alt=WHATWG height=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 31 July 2013</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 1 August 2013</h2>
    </hgroup><dl><dt><strong>Web developer edition:</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -71460,6 +71460,11 @@
 
   <h5 id=calling-scripts><span class=secno>7.1.3.2 </span>Calling scripts</h5>
 
+  <p>Each <a href=#unit-of-related-similar-origin-browsing-contexts>unit of related similar-origin browsing contexts</a> has a <dfn id=stack-of-incumbent-scripts>stack of
+  incumbent scripts</dfn>, which must be initially empty. When a new script is <i>pushed</i> onto
+  this stack, the specified script is to be added to the stack; when the script on this stack that
+  was most recently pushed onto it is to be <i>popped</i> from the stack, it must be removed.</p>
+
   <p>When a user agent is to <dfn id=jump-to-a-code-entry-point>jump to a code entry-point</dfn> for a <a href=#concept-script title=concept-script>script</a>, for example to invoke an event listener defined in that
   <a href=#concept-script title=concept-script>script</a>, the user agent must run the following steps:</p>
 
@@ -71470,20 +71475,20 @@
    <li><p>If <a href=#concept-bc-noscript title=concept-bc-noscript>scripting is disabled</a> for <a href="#script's-browsing-context">script's
    browsing context</a>, then abort these steps.</p>
 
-   <li><p>Set the <a href=#entry-script>entry script</a> to be the <a href=#concept-script title=concept-script>script</a>
-   being invoked.</li>
+   <li><p>Push the <a href=#concept-script title=concept-script>script</a> being invoked onto the <a href=#stack-of-incumbent-scripts>stack of
+   incumbent scripts</a>.</li>
 
    <li><p>Make the <a href=#script-execution-environment title="script execution environment">script execution environment</a>
    for the <a href=#concept-script title=concept-script>script</a> execute the code for the given code
    entry-point.</li>
 
-   <li><p>Set the <a href=#entry-script>entry script</a> back to whatever it was when this algorithm
-   started (possibly nothing).</li>
+   <li><p>Pop the <a href=#concept-script title=concept-script>script</a> being invoked from the <a href=#stack-of-incumbent-scripts>stack of
+   incumbent scripts</a>.</li>
 
-   <li><p>If there is no longer an <a href=#entry-script>entry script</a>, <a href=#run-the-global-script-clean-up-jobs>run the global script clean-up
-   jobs</a>. (These cannot run scripts.)</li>
+   <li><p>If the <a href=#stack-of-incumbent-scripts>stack of incumbent scripts</a> is now empty, <a href=#run-the-global-script-clean-up-jobs>run the global script
+   clean-up jobs</a>. (These cannot run scripts.)</li>
 
-   <li><p>If there is no longer an <a href=#entry-script>entry script</a>, <a href=#perform-a-microtask-checkpoint>perform a microtask
+   <li><p>If the <a href=#stack-of-incumbent-scripts>stack of incumbent scripts</a> is now empty, <a href=#perform-a-microtask-checkpoint>perform a microtask
    checkpoint</a>. (If this runs scripts, it will result in this algorithm being invoked
    reentrantly.)</li>
 
@@ -71491,20 +71496,26 @@
   reentrantly in an indirect manner, e.g. if a script dispatches an event which has event listeners
   registered.</p>
 
-  <hr><p>Each <a href=#unit-of-related-similar-origin-browsing-contexts>unit of related similar-origin browsing contexts</a> can have an <dfn id=entry-script>entry
-  script</dfn> which is used to obtain, amongst other things, the <a href="#script's-base-url">script's base URL</a> to
-  <a href=#resolve-a-url title="resolve a url">resolve</a> relative <a href=#url title=URL>URLs</a> used in scripts
-  running in that <a href=#unit-of-related-similar-origin-browsing-contexts>unit of related similar-origin browsing contexts</a>. Initially, there is
-  no <a href=#entry-script>entry script</a>. It is changed by the <a href=#jump-to-a-code-entry-point>jump to a code entry-point</a>
-  algorithm above.</p>
+  <p>When a JavaScript <i>SourceElements</i> production is to be evaluated, the <a href=#concept-script title=concept-script>script</a> corresponding to that <i>SourceElements</i> must be pushed
+  onto the <a href=#stack-of-incumbent-scripts>stack of incumbent scripts</a> before the evaluation begins, and popped when the
+  evaluation ends (regardless of whether it's an abrupt completion or not).</p>
 
+  <p>The <dfn id=entry-script>entry script</dfn> is the <a href=#concept-script title=concept-script>script</a> in the
+  <a href=#stack-of-incumbent-scripts>stack of incumbent scripts</a> that was least-recently added (i.e. the first one in the
+  stack). If the stack is empty, then there is no <a href=#entry-script>entry script</a>. It is used to obtain,
+  amongst other things, the <a href="#script's-base-url">script's base URL</a> to <a href=#resolve-a-url title="resolve a
+  url">resolve</a> relative <a href=#url title=URL>URLs</a> used in scripts running in that
+  <a href=#unit-of-related-similar-origin-browsing-contexts>unit of related similar-origin browsing contexts</a>.</p>
+
+  <p>The <dfn id=incumbent-script>incumbent script</dfn> is the <a href=#concept-script title=concept-script>script</a> in the
+  <a href=#stack-of-incumbent-scripts>stack of incumbent scripts</a> that was most-recently added (i.e. the last one on the
+  stack). If the stack is empty, then there is no <a href=#incumbent-script>incumbent script</a>. It is used in some
+  security checks.</p>
+
+  <p class=note>The WebIDL specification also manipulates the <a href=#stack-of-incumbent-scripts>stack of incumbent
+  scripts</a>. <a href=#refsWEBIDL>[WEBIDL]</a></p>
+
 <!--CLEANUP:all occurrences of 'incumbent'-->
-  <p>The <dfn id=incumbent-script>incumbent script</dfn> is the <a href=#concept-script title=concept-script>script</a> corresponding
-  to the most-recently evaluated <i>SourceElements</i> JavaScript production whose evaluation
-  directly resulted in the invocation of the current API (method, attribute getter or setter,
-  constructor, etc).</p>
-  <!-- the <span title="concept-script">script</span> that invoked the current API -->
-  <!-- the <span title="concept-script">script</span> corresponding to the top execution context on the logical JavaScript execution context stack, also known as the running execution context -->
 
   <hr><p>Each <a href=#unit-of-related-similar-origin-browsing-contexts>unit of related similar-origin browsing contexts</a> has a <dfn id=running-mutation-observers>running mutation
   observers</dfn> flag, which must initially be false. It is used to prevent reentrant invocation of

Modified: index
===================================================================
--- index	2013-07-31 21:29:04 UTC (rev 8113)
+++ index	2013-08-01 19:44:55 UTC (rev 8114)
@@ -256,7 +256,7 @@
 
   <header class=head id=head><p><a href=http://www.whatwg.org/ class=logo><img width=101 src=/images/logo alt=WHATWG height=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 31 July 2013</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 1 August 2013</h2>
    </hgroup><dl><dt><strong>Web developer edition:</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -71460,6 +71460,11 @@
 
   <h5 id=calling-scripts><span class=secno>7.1.3.2 </span>Calling scripts</h5>
 
+  <p>Each <a href=#unit-of-related-similar-origin-browsing-contexts>unit of related similar-origin browsing contexts</a> has a <dfn id=stack-of-incumbent-scripts>stack of
+  incumbent scripts</dfn>, which must be initially empty. When a new script is <i>pushed</i> onto
+  this stack, the specified script is to be added to the stack; when the script on this stack that
+  was most recently pushed onto it is to be <i>popped</i> from the stack, it must be removed.</p>
+
   <p>When a user agent is to <dfn id=jump-to-a-code-entry-point>jump to a code entry-point</dfn> for a <a href=#concept-script title=concept-script>script</a>, for example to invoke an event listener defined in that
   <a href=#concept-script title=concept-script>script</a>, the user agent must run the following steps:</p>
 
@@ -71470,20 +71475,20 @@
    <li><p>If <a href=#concept-bc-noscript title=concept-bc-noscript>scripting is disabled</a> for <a href="#script's-browsing-context">script's
    browsing context</a>, then abort these steps.</p>
 
-   <li><p>Set the <a href=#entry-script>entry script</a> to be the <a href=#concept-script title=concept-script>script</a>
-   being invoked.</li>
+   <li><p>Push the <a href=#concept-script title=concept-script>script</a> being invoked onto the <a href=#stack-of-incumbent-scripts>stack of
+   incumbent scripts</a>.</li>
 
    <li><p>Make the <a href=#script-execution-environment title="script execution environment">script execution environment</a>
    for the <a href=#concept-script title=concept-script>script</a> execute the code for the given code
    entry-point.</li>
 
-   <li><p>Set the <a href=#entry-script>entry script</a> back to whatever it was when this algorithm
-   started (possibly nothing).</li>
+   <li><p>Pop the <a href=#concept-script title=concept-script>script</a> being invoked from the <a href=#stack-of-incumbent-scripts>stack of
+   incumbent scripts</a>.</li>
 
-   <li><p>If there is no longer an <a href=#entry-script>entry script</a>, <a href=#run-the-global-script-clean-up-jobs>run the global script clean-up
-   jobs</a>. (These cannot run scripts.)</li>
+   <li><p>If the <a href=#stack-of-incumbent-scripts>stack of incumbent scripts</a> is now empty, <a href=#run-the-global-script-clean-up-jobs>run the global script
+   clean-up jobs</a>. (These cannot run scripts.)</li>
 
-   <li><p>If there is no longer an <a href=#entry-script>entry script</a>, <a href=#perform-a-microtask-checkpoint>perform a microtask
+   <li><p>If the <a href=#stack-of-incumbent-scripts>stack of incumbent scripts</a> is now empty, <a href=#perform-a-microtask-checkpoint>perform a microtask
    checkpoint</a>. (If this runs scripts, it will result in this algorithm being invoked
    reentrantly.)</li>
 
@@ -71491,20 +71496,26 @@
   reentrantly in an indirect manner, e.g. if a script dispatches an event which has event listeners
   registered.</p>
 
-  <hr><p>Each <a href=#unit-of-related-similar-origin-browsing-contexts>unit of related similar-origin browsing contexts</a> can have an <dfn id=entry-script>entry
-  script</dfn> which is used to obtain, amongst other things, the <a href="#script's-base-url">script's base URL</a> to
-  <a href=#resolve-a-url title="resolve a url">resolve</a> relative <a href=#url title=URL>URLs</a> used in scripts
-  running in that <a href=#unit-of-related-similar-origin-browsing-contexts>unit of related similar-origin browsing contexts</a>. Initially, there is
-  no <a href=#entry-script>entry script</a>. It is changed by the <a href=#jump-to-a-code-entry-point>jump to a code entry-point</a>
-  algorithm above.</p>
+  <p>When a JavaScript <i>SourceElements</i> production is to be evaluated, the <a href=#concept-script title=concept-script>script</a> corresponding to that <i>SourceElements</i> must be pushed
+  onto the <a href=#stack-of-incumbent-scripts>stack of incumbent scripts</a> before the evaluation begins, and popped when the
+  evaluation ends (regardless of whether it's an abrupt completion or not).</p>
 
+  <p>The <dfn id=entry-script>entry script</dfn> is the <a href=#concept-script title=concept-script>script</a> in the
+  <a href=#stack-of-incumbent-scripts>stack of incumbent scripts</a> that was least-recently added (i.e. the first one in the
+  stack). If the stack is empty, then there is no <a href=#entry-script>entry script</a>. It is used to obtain,
+  amongst other things, the <a href="#script's-base-url">script's base URL</a> to <a href=#resolve-a-url title="resolve a
+  url">resolve</a> relative <a href=#url title=URL>URLs</a> used in scripts running in that
+  <a href=#unit-of-related-similar-origin-browsing-contexts>unit of related similar-origin browsing contexts</a>.</p>
+
+  <p>The <dfn id=incumbent-script>incumbent script</dfn> is the <a href=#concept-script title=concept-script>script</a> in the
+  <a href=#stack-of-incumbent-scripts>stack of incumbent scripts</a> that was most-recently added (i.e. the last one on the
+  stack). If the stack is empty, then there is no <a href=#incumbent-script>incumbent script</a>. It is used in some
+  security checks.</p>
+
+  <p class=note>The WebIDL specification also manipulates the <a href=#stack-of-incumbent-scripts>stack of incumbent
+  scripts</a>. <a href=#refsWEBIDL>[WEBIDL]</a></p>
+
 <!--CLEANUP:all occurrences of 'incumbent'-->
-  <p>The <dfn id=incumbent-script>incumbent script</dfn> is the <a href=#concept-script title=concept-script>script</a> corresponding
-  to the most-recently evaluated <i>SourceElements</i> JavaScript production whose evaluation
-  directly resulted in the invocation of the current API (method, attribute getter or setter,
-  constructor, etc).</p>
-  <!-- the <span title="concept-script">script</span> that invoked the current API -->
-  <!-- the <span title="concept-script">script</span> corresponding to the top execution context on the logical JavaScript execution context stack, also known as the running execution context -->
 
   <hr><p>Each <a href=#unit-of-related-similar-origin-browsing-contexts>unit of related similar-origin browsing contexts</a> has a <dfn id=running-mutation-observers>running mutation
   observers</dfn> flag, which must initially be false. It is used to prevent reentrant invocation of

Modified: source
===================================================================
--- source	2013-07-31 21:29:04 UTC (rev 8113)
+++ source	2013-08-01 19:44:55 UTC (rev 8114)
@@ -79892,6 +79892,11 @@
 
   <h5>Calling scripts</h5>
 
+  <p>Each <span>unit of related similar-origin browsing contexts</span> has a <dfn>stack of
+  incumbent scripts</dfn>, which must be initially empty. When a new script is <i>pushed</i> onto
+  this stack, the specified script is to be added to the stack; when the script on this stack that
+  was most recently pushed onto it is to be <i>popped</i> from the stack, it must be removed.</p>
+
   <p>When a user agent is to <dfn>jump to a code entry-point</dfn> for a <span
   title="concept-script">script</span>, for example to invoke an event listener defined in that
   <span title="concept-script">script</span>, the user agent must run the following steps:</p>
@@ -79905,20 +79910,20 @@
    <li><p>If <span title="concept-bc-noscript">scripting is disabled</span> for <span>script's
    browsing context</span>, then abort these steps.</p>
 
-   <li><p>Set the <span>entry script</span> to be the <span title="concept-script">script</span>
-   being invoked.</p></li>
+   <li><p>Push the <span title="concept-script">script</span> being invoked onto the <span>stack of
+   incumbent scripts</span>.</p></li>
 
    <li><p>Make the <span title="script execution environment">script execution environment</span>
    for the <span title="concept-script">script</span> execute the code for the given code
    entry-point.</p></li>
 
-   <li><p>Set the <span>entry script</span> back to whatever it was when this algorithm
-   started (possibly nothing).</p></li>
+   <li><p>Pop the <span title="concept-script">script</span> being invoked from the <span>stack of
+   incumbent scripts</span>.</p></li>
 
-   <li><p>If there is no longer an <span>entry script</span>, <span>run the global script clean-up
-   jobs</span>. (These cannot run scripts.)</p></li>
+   <li><p>If the <span>stack of incumbent scripts</span> is now empty, <span>run the global script
+   clean-up jobs</span>. (These cannot run scripts.)</p></li>
 
-   <li><p>If there is no longer an <span>entry script</span>, <span>perform a microtask
+   <li><p>If the <span>stack of incumbent scripts</span> is now empty, <span>perform a microtask
    checkpoint</span>. (If this runs scripts, it will result in this algorithm being invoked
    reentrantly.)</p></li>
 
@@ -79928,22 +79933,27 @@
   reentrantly in an indirect manner, e.g. if a script dispatches an event which has event listeners
   registered.</p>
 
-  <hr>
+  <p>When a JavaScript <i>SourceElements</i> production is to be evaluated, the <span
+  title="concept-script">script</span> corresponding to that <i>SourceElements</i> must be pushed
+  onto the <span>stack of incumbent scripts</span> before the evaluation begins, and popped when the
+  evaluation ends (regardless of whether it's an abrupt completion or not).</p>
 
-  <p>Each <span>unit of related similar-origin browsing contexts</span> can have an <dfn>entry
-  script</dfn> which is used to obtain, amongst other things, the <span>script's base URL</span> to
-  <span title="resolve a url">resolve</span> relative <span title="URL">URLs</span> used in scripts
-  running in that <span>unit of related similar-origin browsing contexts</span>. Initially, there is
-  no <span>entry script</span>. It is changed by the <span>jump to a code entry-point</span>
-  algorithm above.</p>
+  <p>The <dfn>entry script</dfn> is the <span title="concept-script">script</span> in the
+  <span>stack of incumbent scripts</span> that was least-recently added (i.e. the first one in the
+  stack). If the stack is empty, then there is no <span>entry script</span>. It is used to obtain,
+  amongst other things, the <span>script's base URL</span> to <span title="resolve a
+  url">resolve</span> relative <span title="URL">URLs</span> used in scripts running in that
+  <span>unit of related similar-origin browsing contexts</span>.</p>
 
+  <p>The <dfn>incumbent script</dfn> is the <span title="concept-script">script</span> in the
+  <span>stack of incumbent scripts</span> that was most-recently added (i.e. the last one on the
+  stack). If the stack is empty, then there is no <span>incumbent script</span>. It is used in some
+  security checks.</p>
+
+  <p class="note">The WebIDL specification also manipulates the <span>stack of incumbent
+  scripts</span>. <a href="#refsWEBIDL">[WEBIDL]</a></p>
+
 <!--CLEANUP:all occurrences of 'incumbent'-->
-  <p>The <dfn>incumbent script</dfn> is the <span title="concept-script">script</span> corresponding
-  to the most-recently evaluated <i>SourceElements</i> JavaScript production whose evaluation
-  directly resulted in the invocation of the current API (method, attribute getter or setter,
-  constructor, etc).</p>
-  <!-- the <span title="concept-script">script</span> that invoked the current API -->
-  <!-- the <span title="concept-script">script</span> corresponding to the top execution context on the logical JavaScript execution context stack, also known as the running execution context -->
 
   <hr>
 




More information about the Commit-Watchers mailing list