HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
2898Define the storage mutex. Will be used in the next few checkins.2009-03-24 07:42
@@ -397,29 +397,20 @@
   refer to any use of HTML, ranging from short static documents to
   long essays or reports with rich multimedia, as well as to
   fully-fledged interactive applications.</p>
 
   <p>For simplicity, terms such as <i>shown</i>, <i>displayed</i>,
   and <i>visible</i> might sometimes be used when referring to the
   way a document is rendered to the user. These terms are not meant to
   imply a visual medium; they must be considered to apply to other
   media in equivalent ways.</p>
 
-  <p class="impl">Some of the algorithms in this specification, for
-  historical reasons, require the user agent to <dfn>pause</dfn> until
-  some condition has been met. While a user agent is paused, it must
-  ensure that no scripts execute (e.g. no event handlers, no timers,
-  etc). User agents should remain responsive to user input while
-  paused, however, albeit without letting the user interact with Web
-  pages where that would involve invoking any <span
-  title="concept-script">script</span>.</p>
-
 
   <h4>XML</h4>
 
   <p id="html-namespace">To ease migration from HTML to XHTML, UAs
   conforming to this specification will place elements in HTML in the
   <code>http://www.w3.org/1999/xhtml</code> namespace, at least for
   the purposes of the DOM and CSS. The term "<dfn>elements in the HTML
   namespace</dfn>", or "<dfn>HTML elements</dfn>" for short, when used
   in this specification, thus refers to both HTML and XHTML
   elements.</p>
@@ -45519,20 +45510,22 @@ interface <dfn>Window</dfn> {
   <p>If scripting is disabled while a script is executing, the script
   should be terminated immediately.</p>
 
   </div>
 
 
   <div class="impl">
 
   <h4>Event loops</h4>
 
+  <h5>Definitions</h5>
+
   <p>To coordinate events, user interaction, scripts, rendering,
   networking, and so forth, user agents must use <dfn title="event
   loop">event loops</dfn> as described in this section.</p>
 
   <p>There must be at least one <span>event loop</span> per user
   agent, and at most one <span>event loop</span> per <span>unit of
   related similar-origin browsing contexts</span>.</p>
 
   <p>An <span>event loop</span> always has at least one <span>browsing
   context</span>. If an <span>event loop</span>'s <span
@@ -45614,42 +45607,87 @@ interface <dfn>Window</dfn> {
 
   <p class="example">For example, a user agent could have one
   <span>task queue</span> for mouse and key events (the <span>user
   interaction task source</span>), and another for everything
   else. The user agent could then give keyboard and mouse events
   preference over other tasks three quarters of the time, keeping the
   interface responsive but not starving other task queues, and never
   processing events from any one <span>task source</span> out of
   order.</p>
 
+  <p>A user agent is required to have one <dfn>storage
+  mutex</dfn>. This mutex is used to control access to shared state
+  like cookies. At any one point, the <span>storage mutex</span> is
+  either free, or owned by a particular <span>event loop</span>.</p>
+
+
+  <h5>Processing model</h5>
+
   <p>An <span>event loop</span> must continually run through the
   following steps for as long as it exists:</p>
 
   <ol>
 
-   <li><p>Run the oldest task on one of the <span>event loop</span>'s
-   <span title="task queue">task queues</span>, ignoring tasks whose
-   associated <code>Document</code>s are not <span>fully
-   active</span>. The user agent may pick any <span>task
-   queue</span>.</p></li>
+   <li><p>Run the oldest <span title="concept-task">task</span> on one
+   of the <span>event loop</span>'s <span title="task queue">task
+   queues</span>, ignoring tasks whose associated
+   <code>Document</code>s are not <span>fully active</span>. The user
+   agent may pick any <span>task queue</span>.</p></li>
+
+   <li><p>If the <span>storage mutex</span> is now owned by the
+   <span>event loop</span>, release it so that it is once again
+   free.</p>
 
    <li><p>Remove that task from its <span>task queue</span>.</p></li>
 
    <li><p>If necessary, update the rendering or user interface of any
    <code>Document</code> or <span>browsing context</span> to reflect
    the current state.</p></li>
 
    <li><p>Return to the first step of the <span>event
    loop</span>.</p></li>
 
   </ol>
 
+  <hr>
+
+  <p class="impl">Some of the algorithms in this specification, for
+  historical reasons, require the user agent to <dfn>pause</dfn> while
+  running a <span title="concept-task">task</span> until some
+  condition has been met. While a user agent has a paused <span
+  title="concept-task">task</span>, the corresponding <span>event
+  loop</span> must not run further <span
+  title="concept-task">tasks</span>, and any script in the currently
+  running <span title="concept-task">task</span> must block. User
+  agents should remain responsive to user input while paused, however,
+  albeit in a reduced capacity since the <span>event loop</span> will
+  not be doing anything.</p>
+
+  <hr>
+
+  <p>When a user agent is to <dfn>obtain the storage mutex</dfn> as
+  part of running a <span title="concept-task">task</span>, it must
+  run through the following steps:</p>
+
+  <ol>
+
+   <li><p>If the <span>storage mutex</span> is already owned by this
+   <span title="concept-task">task</span>'s <span>event loop</span>,
+   then abort these steps.</p></li>
+
+   <li><p>Otherwise, <span>pause</span> until the <span>storage
+   mutex</span> can be taken by the <span>event loop</span>.</p></li>
+
+   <li><p>Take ownership of the <span>storage mutex</span>.</p></li>
+
+  </ol>
+
   </div>
 
 
   <div class="impl">
 
   <h5>Generic task sources</h5>
 
   <p>The following <span title="task source">task sources</span> are
   used by a number of mostly unrelated features in this and other
   specifications.</p>

|