spec/Overview.html 1.1211 2023 Simplify message ports: use queueing ins

Simplify message ports: use queueing instead of transient 'active'
functionality. Also, make localStorage use the same mechanism for
obtaining origin as openDatabase(). (whatwg r2023)

traverse the history
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#traverse
in table
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#in-table
onunload
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#onunload0
onload
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#onload0
8. The HTML syntax
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#syntax
localStorage
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#localstorage
reconstruct the active formatting elements
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#reconstruct
Void elements
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#void-elements
in row
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#in-row
MessageChannel()
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#messagechannel0
create a new MessagePort object
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#create
start()
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#start6
active
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#active0
8.1.2.1. Start tags
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#start
7.2.2 Connecting to an event stream
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#connecting
list of added properties
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#list-of2
list of event sources
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#list-of3
clear the list of active formatting elements up to the last marker
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#clear1
clone a port
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#clone
list of active formatting elements
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#list-of4
port message queue
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#port-message
Tags
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#tags
addEventSource(src)
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#addeventsource
tag name
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#tag-name0
Start tags
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#start7
The user agent must make the specified entry's Document object the active document of the browsing context. (If it is a top-level browsing context, this might change which application cache it is associated with.)
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#appcache-history-2
postMessage()
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#postmessage1
7.5.3.2. Ports and garbage collection
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#ports0
An end tag whose tag name is one of: "a", "b", "big", "em", "font", "i", "nobr", "s", "small", "strike", "strong", "tt", "u"
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#adoptionAgency
entangle
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#entangle
close()
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#close3
8.2.3.3. The list of active formatting elements
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#the-list
removeEventSource(src)
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#removeeventsource
onmessage
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#onmessage1
5.2.1 Security
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#security3
Formatting
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#formatting
in body
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#in-body
discard a Document
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#discard
5.9.10 Closing a browsing context
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#closing
MessagePort
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#messageport0
7.5.3.1. Ports and browsing contexts
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1211.html#ports

http://people.w3.org/mike/diffs/html5/spec/Overview.diff.html
http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.1210&r2=1.1211&f=h
http://html5.org/tools/web-apps-tracker?from=2022&to=2023

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.1210
retrieving revision 1.1211
diff -u -d -r1.1210 -r1.1211
--- Overview.html 6 Aug 2008 00:51:49 -0000 1.1210
+++ Overview.html 6 Aug 2008 07:25:14 -0000 1.1211
@@ -31686,15 +31686,6 @@
    <a href="#list-of2">list of added properties</a> must be empty when the
    <code>Document</code> object is created.
 
-  <p>Each <code>Document</code> in a <a href="#browsing1">browsing
-   context</a> also has an associated <dfn id=list-of3>list of message
-   ports</dfn>, which must be initially empty. The list is used during <a
-   href="#traverse" title="traverse the history">history traversal</a> in
-   much the same way as the <a href="#list-of2">list of added properties</a>,
-   to keep track of message ports that need to be reactivated if the
-   <code>Document</code> is made the <a href="#active">active document</a>
-   again.
-
   <h4 id=security3><span class=secno>5.2.1 </span>Security</h4>
 
   <p>User agents must raise a <a href="#security10">security exception</a>
@@ -36406,15 +36397,6 @@
      <li class=big-issue>freeze any timers, intervals, XMLHttpRequests,
       database transactions, etc
 
-     <li id=port-traversal-deactivation>If there are any <code><a
-      href="#messageport0">MessagePort</a></code> objects whose owner is the
-      browsing context's default view's <code><a
-      href="#window">Window</a></code> object and that are entangled with
-      another port, the user agent must <a href="#deactivate"
-      title="deactivate a port">deactivate</a> all such ports and let the
-      <code>Document</code>'s <a href="#list-of3">list of message ports</a>
-      be a list of those ports.
-
      <li>The user agent must move any properties that have been added to the
       browsing context's default view's <code><a
       href="#window">Window</a></code> object to the <a href="#active">active
@@ -36466,12 +36448,6 @@
       href="#list-of2">list of added properties</a> to browsing context's
       default view's <code><a href="#window">Window</a></code> object.
 
-     <li id=port-traversal-reactivation>If the <a href="#active">active
-      document</a>'s <a href="#list-of3">list of message ports</a> is not
-      empty, then the user agent must <a href="#reactivate" title="reactivate
-      a port">reactivate</a> all the ports in that list. Empty that <a
-      href="#list-of3">list of message ports</a>.
-
      <li class=big-issue>unfreeze any timers, intervals, XMLHttpRequests,
       database transactions, etc
     </ol>
@@ -36525,13 +36501,8 @@
 
   <p class=big-issue>When a user agent is to <dfn id=discard>discard a
    <code>Document</code></dfn>, any frozen timers, intervals,
-   XMLHttpRequests, database transactions, etc, must be killed, and any ports
-   owned by the Window object that aren't in a <a href="#list-of3">list of
-   message ports</a>, if the document is the <a href="#active">active
-   document</a>, or otherwise any ports in that document's <a
-   href="#list-of3">list of message ports</a>, if the document is not the <a
-   href="#active">active document</a>, must be <span>deactivated</span> and
-   unentangled.
+   XMLHttpRequests, database transactions, etc, must be killed, and any
+   MessagePorts owned by the Window object must be unentangled.
 
   <p class=big-issue>Also, <code title=event-unload>unload</code> events
    should fire.
@@ -36848,8 +36819,11 @@
   <p>When the <code title=dom-localStorage><a
    href="#localstorage">localStorage</a></code> attribute is accessed, the
    user agent must check to see if it has allocated local storage area for
-   the <a href="#origin0">origin</a> of the script. If it has not, a new
-   storage area for that <a href="#origin0">origin</a> must be created.
+   the for the <a href="#origin0">origin</a> of the <a href="#active">active
+   document</a> of the <a href="#browsing1">browsing context</a> of the
+   <code><a href="#window">Window</a></code> object on which the method was
+   invoked. If it has not, a new storage area for that <a
+   href="#origin0">origin</a> must be created.
 
   <p>The user agent must then create a <code><a
    href="#storage0">Storage</a></code> object associated with that origin's
@@ -42230,7 +42204,7 @@
    href="#resolve" title="resolve a url">resolve</a> the <a
    href="#url">URL</a> specified in <var title="">src</var>, and if that
    succeeds, add the resulting <a href="#absolute">absolute URL</a> to the <a
-   href="#list-of4" title=concept-eventsource-list>list of event sources</a>
+   href="#list-of3" title=concept-eventsource-list>list of event sources</a>
    for that object. The same URL can be registered multiple times. If the URL
    fails to resolve, then the user agent must raise a <code>SYNTAX_ERR</code>
    exception.
@@ -42241,7 +42215,7 @@
    href="#resolve" title="resolve a url">resolve</a> the <a
    href="#url">URL</a> specified in <var title="">src</var>, and if that
    succeeds, remove the resulting <a href="#absolute">absolute URL</a> from
-   the <a href="#list-of4" title=concept-eventsource-list>list of event
+   the <a href="#list-of3" title=concept-eventsource-list>list of event
    sources</a> for that object. If the same URI has been registered multiple
    times, removing it must remove only one instance of that URI for each
    invocation of the <code title=removeEventSource>removeEventSource()</code>
@@ -42252,7 +42226,7 @@
 
   <p>Each object implementing the <code>EventTarget</code> and <code><a
    href="#remoteeventtarget">RemoteEventTarget</a></code> interfaces has a
-   <dfn id=list-of4 title=concept-eventsource-list>list of event
+   <dfn id=list-of3 title=concept-eventsource-list>list of event
    sources</dfn> that are registered for that object.
 
   <p>When a new URI is added to this list, the user agent should, as soon as
@@ -43837,10 +43811,6 @@
      <var title="">port2</var> objects.
 
    <li>
-    <p>Set the <code title=dom-MessagePort-active><a
-     href="#active0">active</a></code> attribute of the two ports to true.
-
-   <li>
     <p>Instantiate a new <code><a
      href="#messagechannel">MessageChannel</a></code> object, and let <var
      title="">channel</var> be that object.
@@ -43873,6 +43843,7 @@
   readonly attribute boolean <a href="#active0" title=dom-MessagePort-active>active</a>;
   boolean <a href="#postmessage1" title=dom-MessagePort-postMessage>postMessage</a>(in DOMString message);
   boolean <a href="#postmessage1" title=dom-MessagePort-postMessage>postMessage</a>(in DOMString message, in <a href="#messageport0">MessagePort</a> messagePort);
+  void <span title=dom-MessagePort-start>start</span>();
   void <a href="#close3" title=dom-MessagePort-close>close</a>();
 
   // event handler attributes
@@ -43882,24 +43853,18 @@
            attribute <span>EventListener</span> <a href="#onunload0" title=handler-MessagePort-onunload>onunload</a>;
 };</pre>
 
+  <p>Each <code><a href="#messageport0">MessagePort</a></code> object can be
+   entangled with another (a symmetric relationship). Each <code><a
+   href="#messageport0">MessagePort</a></code> object also has a <dfn
+   id=port-message>port message queue</dfn>, initial empty. A <a
+   href="#port-message">port message queue</a> can be open or closed, and is
+   initially closed.
+
   <p>When the user agent is to <dfn id=create>create a new
    <code>MessagePort</code> object</dfn> owned by a <a href="#script2">script
-   execution context</a> object <var title="">owner</var>, it must run the
-   following steps:
-
-  <ol>
-   <li>
-    <p>Instantiate a new <code><a href="#messageport0">MessagePort</a></code>
-     object, and let <var title="">port</var> be that object.
-
-   <li>
-    <p>Let <var title="">port</var>'s owner be <var title="">owner</var>.
-
-   <li>
-    <p>Set the <code title=dom-MessagePort-active><a
-     href="#active0">active</a></code> attribute of <var title="">port</var>
-     be false.
-  </ol>
+   execution context</a> object <var title="">owner</var>, it must
+   instantiate a new <code><a href="#messageport0">MessagePort</a></code>
+   object, and let its owner be <var title="">owner</var>.
 
   <hr>
 
@@ -43909,34 +43874,14 @@
 
   <ol>
    <li>
-    <p>If either port is already entangled, then let <var
-     title="">port1</var> be that port, and run these substeps:</p>
-
-    <ol>
-     <li>
-      <p>Let <var title="">old port</var> be the port that <var
-       title="">port1</var> is entangled with.
-
-     <li>
-      <p>Unentangle <var title="">old port</var>, so that it is no longer
-       entangled with any ports.
-
-     <li>
-      <p>Set the <code title=dom-MessagePort-active><a
-       href="#active0">active</a></code> attribute of <var title="">old
-       port</var> to false.
-
-     <li>
-      <p>Unentangle <var title="">port1</var>, so that it is no longer
-       entangled with any ports.
-    </ol>
+    <p>If one of the ports is already entangled, then unentangle it and the
+     port that it was entangled with.</p>
 
-    <p>If <var title="">port1</var> and <var title="">old port</var> were the
-     two ports of a <code><a href="#messagechannel">MessageChannel</a></code>
-     object, then that <code><a
-     href="#messagechannel">MessageChannel</a></code> object no longer
-     represents an actual channel: the two ports in that object are no longer
-     entangled.</p>
+    <p class=note>If those two previously entangled ports were the two ports
+     of a <code><a href="#messagechannel">MessageChannel</a></code> object,
+     then that <code><a href="#messagechannel">MessageChannel</a></code>
+     object no longer represents an actual channel: the two ports in that
+     object are no longer entangled.</p>
 
    <li>
     <p>Associate the two ports to be entangled, so that they form the two
@@ -43964,33 +43909,22 @@
      <var title="">original port</var> is entangled.
 
    <li>
-    <p>Let <var title="">original status</var> be the value of the <code
-     title=dom-MessagePort-active><a href="#active0">active</a></code>
-     attribute of the <var title="">original port</var>.
-
-   <li>
     <p><a href="#create">Create a new <code>MessagePort</code> object</a>
      owned by <var title="">owner</var>, and let <var title="">new port</var>
      be that object.
 
    <li>
-    <p><a href="#entangle">Entangle</a> the <var title="">remote port</var>
-     and <var title="">new port</var> objects. The <var title="">original
-     port</var> object will have its <code title=dom-MessagePort-active><a
-     href="#active0">active</a></code> attribute permanently set to false by
-     this process.
+    <p><span>Move all the events in the <a href="#port-message">port message
+     queue</a> of <var title="">original port</var> to the <a
+     href="#port-message">port message queue</a> of <var title="">new
+     port</var>, if any, leaving the <var title="">new port</var>'s <a
+     href="#port-message">port message queue</a> in its initial closed
+     state.</span>
 
    <li>
-    <p>Let the <code title=dom-MessagePort-active><a
-     href="#active0">active</a></code> attribute of the <var title="">new
-     port</var> object have the same value as <var title="">original
-     status</var>.
-   </li>
-   <!-- we
-   don't throw if it's false, because it might become true again,
-   e.g. if you're sending a port that is entangled with a port that's
-   associated with a document that's currently not the active document
-   of its iframe, but which hasn't been discarded yet -->
+    <p><a href="#entangle">Entangle</a> the <var title="">remote port</var>
+     and <var title="">new port</var> objects. The <var title="">original
+     port</var> object will be unentangled by this process.
 
    <li>
     <p>Return <var title="">new port</var>. It is the clone.
@@ -44000,8 +43934,7 @@
 
   <p>The <dfn id=active0
    title=dom-MessagePort-active><code>active</code></dfn> attribute must
-   return the last value that it was set to according to the rules of this
-   specification.
+   return true if the port is entangled, and false otherwise.
 
   <hr>
 
@@ -44019,14 +43952,12 @@
      any.
 
    <li>
-    <p>If the <var title="">source port</var>'s <code
-     title=dom-MessagePort-active><a href="#active0">active</a></code>
-     attribute is false, then return false and abort these steps.
+    <p>If the <var title="">source port</var> is not entangled with another
+     port, then return false and abort these steps.
    </li>
-   <!-- we don't
-   raise an exception because this attribute can become false at a
-   moment's notice, but we return false so that the caller can check
-   whether the port was active at time of calling without a race
+   <!-- we don't raise an exception because this can happen moment's
+   notice, but we return false so that the caller can check whether
+   the port was active at time of calling without a race
    condition. -->
 
    <li>
@@ -44072,17 +44003,8 @@
     <p>Return true from the method, but continue with these steps.
 
    <li>
-    <p>Wait for all scripts in the conceptual thread that the <a
-     href="#script2">script execution context</a> that owns the <var
-     title="">target port</var> belongs to have executed to completion. If
-     this never happens (e.g. the relevant <a href="#browsing1">browsing
-     context</a> is closed by the user before the event can be dispatched),
-     then discard the event.
-   </li>
-   <!-- XXX queue -->
-
-   <li>
-    <p>Dispatch the event at the <var title="">target port</var> object.
+    <p>Add the event to the <a href="#port-message">port message queue</a> of
+     <var title="">target port</var>.
   </ol>
 
   <p class=big-issue>People often request the ability to send name/value
@@ -44090,6 +44012,20 @@
 
   <hr>
 
+  <p>The <dfn id=start6
+   title=dom-MessagePort-close><code>start()</code></dfn> method must open
+   its port's <a href="#port-message">port message queue</a>, if it is not
+   already open.
+
+  <p>When a port's <a href="#port-message">port message queue</a> is open and
+   contains an event, the user agent must, at the earliest opportunity, after
+   any scripts have finished executing<!-- XXX queue -->, dispatch the first
+   event in the queue on the <code><a
+   href="#messageport0">MessagePort</a></code> object, and remove the event
+   from the queue.
+
+  <hr>
+
   <p>The <dfn id=close3
    title=dom-MessagePort-close><code>close()</code></dfn> method, when called
    on a port <var title="">local port</var> that is entangled with another
@@ -44100,10 +44036,6 @@
     <p>Unentangle the two ports.
 
    <li>
-    <p>Set both ports' <code title=dom-messageport-active><a
-     href="#active0">active</a></code> attribute to false.
-
-   <li>
     <p>At the next available opportunity, after any scripts have finished
      executing<!-- XXX queue -->, <a href="#firing2">fire a simple event</a>
      called <code title=event-unload>unload</code> at each of the message
@@ -44129,7 +44061,12 @@
     <p>Must be invoked whenever a <code
      title=event-MessagePort-message>message</code> event is targeted at or
      bubbles through the <code><a href="#messageport0">MessagePort</a></code>
-     object.
+     object.</p>
+
+    <p>The first time a <code><a href="#messageport0">MessagePort</a></code>
+     object's onmessage attribute is set, the port's <a
+     href="#port-message">port message queue</a> must be opened, as if the
+     <code title=dom-MessagePort-start>start()</code> method had been called.</p>
 
    <dt><dfn id=onload0
     title=handler-MessagePort-onload><code>onload</code></dfn>
@@ -44165,35 +44102,11 @@
 
   <h5 id=ports><span class=secno>7.5.3.1. </span>Ports and browsing contexts</h5>
 
-  <p>During <a href="#traverse" title="traverse the history">session history
-   traversal</a> (e.g. when a user <a href="#navigate"
-   title=navigate>navigates</a> a <a href="#browsing1">browsing context</a>
-   to another page, or goes back to a previous page), the user agent will
-   have to <a href="#port-traversal-deactivation">deactivate</a> and/or <a
-   href="#port-traversal-reactivation">reactivate</a> some ports.
-
-  <p>Ports are deactivated and unentangled when the <code>Document</code>
-   that was the <a href="#active">active document</a> of the <a
-   href="#browsing1">browsing context</a> corresponding to the <code><a
-   href="#window">Window</a></code> object that owns them is <a
-   href="#discard" title="discard a document">discarded</a>.
-
-  <p>To <dfn id=deactivate>deactivate a port</dfn> <var title="">local
-   port</var> that is entangled with a second port <var title="">remote
-   port</var>, the user agent must set the <code
-   title=dom-MessagePort-active><a href="#active0">active</a></code>
-   attribute of the <var title="">remote port</var> to false.
-
-  <p>To <dfn id=reactivate>reactivate a port</dfn> <var title="">local
-   port</var> that is entangled with a second port <var title="">remote
-   port</var>, the user agent must set the <code
-   title=dom-MessagePort-active><a href="#active0">active</a></code>
-   attribute of the <var title="">remote port</var> to true.
-
-  <p class=note>It's important to note that activating or deactivating a port
-   actually changes the <code title=dom-MessagePort-active><a
-   href="#active0">active</a></code> attribute of the port's entangled port,
-   not its own attribute.
+  <p>Ports are unentangled when the <code>Document</code> that was the <a
+   href="#active">active document</a> of the <a href="#browsing1">browsing
+   context</a> corresponding to the <code><a href="#window">Window</a></code>
+   object that owns them is <a href="#discard" title="discard a
+   document">discarded</a>.
 
   <h5 id=ports0><span class=secno>7.5.3.2. </span>Ports and garbage
    collection</h5>
@@ -44201,10 +44114,7 @@
   <p>User agents must act as if <code><a
    href="#messageport0">MessagePort</a></code> objects have a strong
    reference to their entangled <code><a
-   href="#messageport0">MessagePort</a></code> object so long as that other
-   <code><a href="#messageport0">MessagePort</a></code> object has any <code
-   title=event-message><a href="#message2">message</a></code> or <code
-   title=event-unload>unload</code> event listeners registered.
+   href="#messageport0">MessagePort</a></code> object.
 
   <div class=note>
    <p>Thus, a message port can be received, given an event listener, and then
@@ -44217,10 +44127,10 @@
   </div>
 
   <p>When an entangled message port is about to be garbage collected, it must
-   be <span>deactivated</span> and unentangled, so that the two ports are no
-   longer related and so that the other port's <code
-   title=dom-MessagePort-active><a href="#active0">active</a></code>
-   attribute is set to false.
+   be unentangled. Because of the aforementioned strong reference, this can
+   only happen if either both ports are about to be garbage collected as a
+   pair, or if the entire <a href="#script2">script execution context</a> of
+   the port is being discarded.
 
   <h2 id=syntax><span class=secno>8. </span>The HTML syntax</h2>
 
@@ -44393,7 +44303,7 @@
 
   <p><dfn id=tags title=syntax-tags>Tags</dfn> are used to delimit the start
    and end of elements in the markup. CDATA, RCDATA, and normal elements have
-   a <a href="#start6" title=syntax-start-tags>start tag</a> to indicate
+   a <a href="#start7" title=syntax-start-tags>start tag</a> to indicate
    where they begin, and an <a href="#end-tags0" title=syntax-end-tags>end
    tag</a> to indicate where they end. The start and end tags of certain
    normal elements can be <a href="#omitted"
@@ -44466,7 +44376,7 @@
 
   <h5 id=start><span class=secno>8.1.2.1. </span>Start tags</h5>
 
-  <p><dfn id=start6 title=syntax-start-tags>Start tags</dfn> must have the
+  <p><dfn id=start7 title=syntax-start-tags>Start tags</dfn> must have the
    following format:
 
   <ol>
@@ -46101,7 +46011,7 @@
 
    <dd>
     <p>The following HTML elements are those that end up in the <a
-     href="#list-of5">list of active formatting elements</a>: <code><a
+     href="#list-of4">list of active formatting elements</a>: <code><a
      href="#a">a</a></code>, <code><a href="#b">b</a></code>,
      <code>big</code>, <code><a href="#em">em</a></code>, <code>font</code>,
      <code><a href="#i">i</a></code>, <code>nobr</code>, <code>s</code>,
@@ -46216,7 +46126,7 @@
   <h5 id=the-list><span class=secno>8.2.3.3. </span>The list of active
    formatting elements</h5>
 
-  <p>Initially the <dfn id=list-of5>list of active formatting elements</dfn>
+  <p>Initially the <dfn id=list-of4>list of active formatting elements</dfn>
    is empty. It is used to handle mis-nested <a href="#formatting"
    title=formatting>formatting element tags</a>.
 
@@ -46233,32 +46143,32 @@
    steps:
 
   <ol>
-   <li>If there are no entries in the <a href="#list-of5">list of active
+   <li>If there are no entries in the <a href="#list-of4">list of active
     formatting elements</a>, then there is nothing to reconstruct; stop this
     algorithm.
 
    <li>If the last (most recently added) entry in the <a
-    href="#list-of5">list of active formatting elements</a> is a marker, or
+    href="#list-of4">list of active formatting elements</a> is a marker, or
     if it is an element that is in the <a href="#stack">stack of open
     elements</a>, then there is nothing to reconstruct; stop this algorithm.
 
    <li>Let <var title="">entry</var> be the last (most recently added)
-    element in the <a href="#list-of5">list of active formatting
+    element in the <a href="#list-of4">list of active formatting
     elements</a>.
 
    <li>If there are no entries before <var title="">entry</var> in the <a
-    href="#list-of5">list of active formatting elements</a>, then jump to
+    href="#list-of4">list of active formatting elements</a>, then jump to
     step 8.
 
    <li>Let <var title="">entry</var> be the entry one earlier than <var
-    title="">entry</var> in the <a href="#list-of5">list of active formatting
+    title="">entry</var> in the <a href="#list-of4">list of active formatting
     elements</a>.
 
    <li>If <var title="">entry</var> is neither a marker nor an element that
     is also in the <a href="#stack">stack of open elements</a>, go to step 4.
 
    <li>Let <var title="">entry</var> be the element one later than <var
-    title="">entry</var> in the <a href="#list-of5">list of active formatting
+    title="">entry</var> in the <a href="#list-of4">list of active formatting
     elements</a>.
 
    <li>Perform a shallow clone of the element <var title="">entry</var> to
@@ -46272,7 +46182,7 @@
     entry for <var title="">clone</var>.
 
    <li>If the entry for <var title="">clone</var> in the <a
-    href="#list-of5">list of active formatting elements</a> is not the last
+    href="#list-of4">list of active formatting elements</a> is not the last
     entry in the list, return to step 7.
   </ol>
 
@@ -46281,7 +46191,7 @@
    haven't been explicitly closed.
 
   <p class=note>The way this specification is written, the <a
-   href="#list-of5">list of active formatting elements</a> always consists of
+   href="#list-of4">list of active formatting elements</a> always consists of
    elements in chronological order with the least recently added element
    first and the most recently added element last (except for while steps 8
    to 11 of the above algorithm are being executed, of course).
@@ -46292,9 +46202,9 @@
 
   <ol>
    <li>Let <var title="">entry</var> be the last (most recently added) entry
-    in the <a href="#list-of5">list of active formatting elements</a>.
+    in the <a href="#list-of4">list of active formatting elements</a>.
 
-   <li>Remove <var title="">entry</var> from the <a href="#list-of5">list of
+   <li>Remove <var title="">entry</var> from the <a href="#list-of4">list of
     active formatting elements</a>.
 
    <li>If <var title="">entry</var> was a marker, then stop the algorithm at
@@ -49828,12 +49738,12 @@
    <dt>A start tag whose tag name is "a"
 
    <dd>
-    <p>If the <a href="#list-of5">list of active formatting elements</a>
+    <p>If the <a href="#list-of4">list of active formatting elements</a>
      contains an element whose tag name is "a" between the end of the list
      and the last marker on the list (or the start of the list if there is no
      marker on the list), then this is a <a href="#parse2">parse error</a>;
      act as if an end tag with the tag name "a" had been seen, then remove
-     that element from the <a href="#list-of5">list of active formatting
+     that element from the <a href="#list-of4">list of active formatting
      elements</a> and the <a href="#stack">stack of open elements</a> if the
      end tag didn't already remove it (it might not have if the element is
      not <a href="#have-an0" title="has an element in table scope">in table
@@ -49852,7 +49762,7 @@
      if any.</p>
 
     <p><a href="#insert0">Insert an HTML element</a> for the token. Add that
-     element to the <a href="#list-of5">list of active formatting
+     element to the <a href="#list-of4">list of active formatting
      elements</a>.</p>
 
    <dt>A start tag whose tag name is one of: "b", "big", "em", "font", "i",
@@ -49863,7 +49773,7 @@
      if any.</p>
 
     <p><a href="#insert0">Insert an HTML element</a> for the token. Add that
-     element to the <a href="#list-of5">list of active formatting
+     element to the <a href="#list-of4">list of active formatting
      elements</a>.</p>
 
    <dt>A start tag whose tag name is "nobr"
@@ -49880,7 +49790,7 @@
      any.</p>
 
     <p><a href="#insert0">Insert an HTML element</a> for the token. Add that
-     element to the <a href="#list-of5">list of active formatting
+     element to the <a href="#list-of4">list of active formatting
      elements</a>.</p>
 
    <dt id=adoptionAgency>An end tag whose tag name is one of: "a", "b",
@@ -49893,7 +49803,7 @@
     <ol>
      <li>
       <p>Let the <var title="">formatting element</var> be the last element
-       in the <a href="#list-of5">list of active formatting elements</a>
+       in the <a href="#list-of4">list of active formatting elements</a>
        that:</p>
 
       <ul>
@@ -49934,7 +49844,7 @@
        bottom of the <a href="#stack">stack of open elements</a>, from the <a
        href="#current5">current node</a> up to and including the <var
        title="">formatting element</var>, and remove the <var
-       title="">formatting element</var> from the <a href="#list-of5">list of
+       title="">formatting element</var> from the <a href="#list-of4">list of
        active formatting elements</a>.
 
      <li>
@@ -49948,7 +49858,7 @@
 
      <li>
       <p>Let a bookmark note the position of the <var title="">formatting
-       element</var> in the <a href="#list-of5">list of active formatting
+       element</var> in the <a href="#list-of4">list of active formatting
        elements</a> relative to the elements on either side of it in the
        list.
 
@@ -49961,7 +49871,7 @@
         title="">node</var> in the <a href="#stack">stack of open
         elements</a>.
 
-       <li>If <var title="">node</var> is not in the <a href="#list-of5">list
+       <li>If <var title="">node</var> is not in the <a href="#list-of4">list
         of active formatting elements</a>, then remove <var
         title="">node</var> from the <a href="#stack">stack of open
         elements</a> and then go back to step 1.
@@ -49973,11 +49883,11 @@
        <li>Otherwise, if <var title="">last node</var> is the <var
         title="">furthest block</var>, then move the aforementioned bookmark
         to be immediately after the <var title="">node</var> in the <a
-        href="#list-of5">list of active formatting elements</a>.
+        href="#list-of4">list of active formatting elements</a>.
 
        <li>If <var title="">node</var> has any children, perform a shallow
         clone of <var title="">node</var>, replace the entry for <var
-        title="">node</var> in the <a href="#list-of5">list of active
+        title="">node</var> in the <a href="#list-of4">list of active
         formatting elements</a> with an entry for the clone, replace the
         entry for <var title="">node</var> in the <a href="#stack">stack of
         open elements</a> with an entry for the clone, and let <var
@@ -50018,8 +49928,8 @@
 
      <li>
       <p>Remove the <var title="">formatting element</var> from the <a
-       href="#list-of5">list of active formatting elements</a>, and insert
-       the clone into the <a href="#list-of5">list of active formatting
+       href="#list-of4">list of active formatting elements</a>, and insert
+       the clone into the <a href="#list-of4">list of active formatting
        elements</a> at the position of the aforementioned bookmark.
 
      <li>
@@ -50069,7 +49979,7 @@
      pointed to by the <a href="#form-element"><code title="">form</code>
      element pointer</a>.</p>
 
-    <p>Insert a marker at the end of the <a href="#list-of5">list of active
+    <p>Insert a marker at the end of the <a href="#list-of4">list of active
      formatting elements</a>.</p>
 
    <dt>A start tag token whose tag name is one of: "applet", "marquee",
@@ -50081,7 +49991,7 @@
 
     <p><a href="#insert0">Insert an HTML element</a> for the token.</p>
 
-    <p>Insert a marker at the end of the <a href="#list-of5">list of active
+    <p>Insert a marker at the end of the <a href="#list-of4">list of active
      formatting elements</a>.</p>
 
    <dt>An end tag token whose tag name is one of: "applet", "button",
@@ -50554,7 +50464,7 @@
     <p><a href="#clear2">Clear the stack back to a table context</a>. (See
      below.)</p>
 
-    <p>Insert a marker at the end of the <a href="#list-of5">list of active
+    <p>Insert a marker at the end of the <a href="#list-of4">list of active
      formatting elements</a>.</p>
 
     <p><a href="#insert0">Insert an HTML element</a> for the token, then
@@ -50956,7 +50866,7 @@
      switch the <span>insertion mode</span> to "<a href="#in-cell"
      title="insertion mode: in cell">in cell</a>".</p>
 
-    <p>Insert a marker at the end of the <a href="#list-of5">list of active
+    <p>Insert a marker at the end of the <a href="#list-of4">list of active
      formatting elements</a>.</p>
 
    <dt>An end tag whose tag name is "tr"

Received on Wednesday, 6 August 2008 07:28:55 UTC