[html5] r3115 - [giw] (2) Fix how drag and drop exports data.

whatwg at whatwg.org whatwg at whatwg.org
Mon May 18 18:11:51 PDT 2009


Author: ianh
Date: 2009-05-18 18:11:49 -0700 (Mon, 18 May 2009)
New Revision: 3115

Modified:
   index
   source
Log:
[giw] (2) Fix how drag and drop exports data.

Modified: index
===================================================================
--- index	2009-05-18 08:23:17 UTC (rev 3114)
+++ index	2009-05-19 01:11:49 UTC (rev 3115)
@@ -39,7 +39,7 @@
   <div class=head>
    <p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG src=/images/logo></a></p>
    <h1>HTML 5</h1>
-   <h2 class="no-num no-toc" id=draft-recommendation-—-date:-01-jan-1901>Draft Recommendation — 18 May 2009</h2>
+   <h2 class="no-num no-toc" id=draft-recommendation-—-date:-01-jan-1901>Draft Recommendation — 19 May 2009</h2>
    <p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
    <p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
    <dl><dt>Multiple-page version:</dt>
@@ -43941,22 +43941,17 @@
 
    <li><p>Add an entry to <var title="">result</var> called "<code title="">items</code>" whose value is the array <var title="">items</var>.</li>
 
-   <li><p>Let <var title="">current node</var> be <var title="">node</var>.</p>
+   <li><p>Let <var title="">citations</var> be an empty
+   array.</li>
 
-   <li><p>Let <var title="">citation</var> be null.</p>
+   <li><p>For each <var title="">node</var> in <var title="">nodes</var> that is <a href=#sectioning-content-0>sectioning content</a>, check
+   if there are any <code><a href=#the-footer-element>footer</a></code> elements that <a href=#applyToSection>apply</a> to <var title="">node</var> and
+   that contain any elements that are <a href=#top-level-microdata-items title="top-level microdata
+   items">top-level microdata items</a> with the type <code title=md-bibtex><a href=#md-bibtex>bibtex</a></code>, and if so, then <a href=#get-the-object>get the
+   object</a> for each such element and add them to <var title="">citations</var>.</li>
 
-   <li><p><i>Citation search:</i> If <var title="">current node</var>
-   has a descendant element that is a <a href=#top-level-microdata-items title="top-level microdata
-   items">top-level microdata item</a> with the type <code title=md-bibtex><a href=#md-bibtex>bibtex</a></code>, then <a href=#get-the-object>get the object</a>
-   for the first such element in <a href=#tree-order>tree order</a> and let <var title="">citation</var> be that object.</li>
+   <li><p>Add an entry to <var title="">result</var> called "<code title="">citations</code>" whose value is the array <var title="">citations</var>.</li>
 
-   <li><p>If <var title="">citation</var> is null and <var title="">current node</var> has a parent node, let <var title="">current node</var> be its parent node and jump back to the
-   step labeled <i>citation search</i>.</li>
-
-   <li><p>If <var title="">citation</var> is not null, add an entry to
-   <var title="">result</var> called "<code title="">citation</code>"
-   whose value is the <var title="">citation</var> object.</li>
-
    <li><p>Return the result of serializing <var title="">result</var>
    to JSON.</li>
 
@@ -44216,24 +44211,16 @@
 
   </ol><h4 id=vcard-0><span class=secno>5.5.3 </span>vCard</h4>
 
-  <p>Given a node <var title="">node</var> in a <code>Document</code>,
-  a user agent must run the following algorithm to <dfn id=extracting-a-vcard title="extracting a vCard">extract any <code title=md-vcard>vcard</code> data represented by that
-  node</dfn>:</p>
+  <p>Given a list of nodes <var title="">nodes</var> in a
+  <code>Document</code>, a user agent must run the following algorithm
+  to <dfn id=extracting-a-vcard title="extracting a vCard">extract any <code title=md-vcard>vcard</code> data represented by those nodes</dfn>
+  (only the first vCard is returned):</p>
 
-  <ol><li>
+  <ol><li><p>If none of the nodes in <var title="">nodes</var> are <a href=#concept-item title=concept-item>items</a> with the type <code title=md-vcard><a href=#md-vcard>vcard</a></code>, then there is no vCard. Abort the
+   algorithm, returning nothing.</li>
 
-    <p>If <var title="">node</var> is not an element that is an <a href=#concept-item title=concept-item>item</a> with the type <code title=md-vcard><a href=#md-vcard>vcard</a></code>, then run these substeps:</p>
+   <li><p>Let <var title="">node</var> be the first node in <var title="">nodes</var> that is an <a href=#concept-item title=concept-item>item</a> with the type <code title=md-vcard><a href=#md-vcard>vcard</a></code>.</li>
 
-    <ol><li><p>If <var title="">node</var> has no parent, then there is
-     no vCard. Abort the algorithm, returning nothing.</li>
-
-     <li><p>Let <var title="">node</var> be <var title="">node</var>'s
-     parent.</li>
-
-     <li><p>Restart the entire algorithm with the new value of <var title="">node</var>.</li>
-
-    </ol></li>
-
    <li><p>Let <var title="">output</var> be an empty string.</li>
 
    <li><p><a href=#add-a-vcard-line>Add a vCard line</a> with the type "<code title="">BEGIN</code>" and the value "<code title="">VCARD</code>"
@@ -44740,25 +44727,14 @@
 
   <h4 id=icalendar><span class=secno>5.5.4 </span>iCalendar</h4>
 
-  <p>Given a node <var title="">node</var> in a <code>Document</code>,
-  a user agent must run the following algorithm to <dfn id=extracting-a-vevent title="extracting a vEvent">extract any <code title=md-vevent>vevent</code> data represented by that
-  node</dfn>:</p>
+  <p>Given a list of nodes <var title="">nodes</var> in a
+  <code>Document</code>, a user agent must run the following algorithm
+  to <dfn id=extracting-vevent-data title="extracting vEvent data">extract any <code title=md-vevent>vevent</code> data represented by those
+  nodes</dfn>:</p>
 
-  <ol><li>
+  <ol><li><p>If none of the nodes in <var title="">nodes</var> are <a href=#concept-item title=concept-item>items</a> with the type <code title=md-vevent><a href=#md-vevent>vevent</a></code>, then there is no vEvent
+   data. Abort the algorithm, returning nothing.</li>
 
-    <p>If <var title="">node</var> is not an element that is an <a href=#concept-item title=concept-item>item</a> with the type <code title=md-vevent><a href=#md-vevent>vevent</a></code>, then run these substeps:</p>
-
-    <ol><li><p>If <var title="">node</var> has no parent, then there is
-     no event to output. Abort the algorithm, returning
-     nothing.</li>
-
-     <li><p>Let <var title="">node</var> be <var title="">node</var>'s
-     parent.</li>
-
-     <li><p>Restart the entire algorithm with the new value of <var title="">node</var>.</li>
-
-    </ol></li>
-
    <li><p>Let <var title="">output</var> be an empty string.</li>
 
    <li><p><a href=#add-an-icalendar-line>Add an iCalendar line</a> with the type "<code title="">BEGIN</code>" and the value "<code title="">VCALENDAR</code>"
@@ -44770,79 +44746,85 @@
    <li><p><a href=#add-an-icalendar-line>Add an iCalendar line</a> with the type "<code title="">VERSION</code>" and the value "<code title="">2.0</code>"
    to <var title="">output</var>.</li>
 
-   <li><p><a href=#add-an-icalendar-line>Add an iCalendar line</a> with the type "<code title="">BEGIN</code>" and the value "<code title="">VEVENT</code>"
-   to <var title="">output</var>.</li>
+   <li>
 
-   <li><p><a href=#add-an-icalendar-line>Add an iCalendar line</a> with the type "<code title="">DTSTAMP</code>" and a value consisting of an iCalendar
-   DATE-TIME string representing the current date and time, with the
-   annotation "<code title="">VALUE=DATE-TIME</code>", to <var title="">output</var>.  <a href=#refsRFC2445>[RFC2445]</a></li>
+    <p>For each node <var title="">node</var> in <var title="">nodes</var> that is an <a href=#concept-item title=concept-item>item</a> with the type <code title=md-vevent><a href=#md-vevent>vevent</a></code>, run the following steps:</p>
 
-   <li><p>If there is a property named <code title=md-about><a href=#md-about>about</a></code> whose <a href=#concept-item-corresponding title=concept-item-corresponding>corresponding item</a> is
-   <var title="">node</var> and the element of the first such property
-   is a <a href=#url-property-elements title="URL property elements">URL property
-   element</a> and has a <a href=#concept-property-value title=concept-property-value>value</a> that is not an <a href=#concept-item title=concept-item>item</a>, <a href=#add-an-icalendar-line>add an iCalendar line</a>
-   with the type "<code title="">UID</code>" and that property's
-   <a href=#concept-property-value title=concept-property-value>value</a> as the value to
-   <var title="">output</var>.</li>
+    <ol><li><p><a href=#add-an-icalendar-line>Add an iCalendar line</a> with the type "<code title="">BEGIN</code>" and the value "<code title="">VEVENT</code>"
+     to <var title="">output</var>.</li>
 
-   <li>
+     <li><p><a href=#add-an-icalendar-line>Add an iCalendar line</a> with the type "<code title="">DTSTAMP</code>" and a value consisting of an iCalendar
+     DATE-TIME string representing the current date and time, with the
+     annotation "<code title="">VALUE=DATE-TIME</code>", to <var title="">output</var>.  <a href=#refsRFC2445>[RFC2445]</a></li>
 
-    <p>For each element <var title="">element</var> that has one or
-    more <a href=#property-names>property names</a> and whose <a href=#concept-item-corresponding title=concept-item-corresponding>corresponding item</a> is
-    <var title="">node</var>: for each name <var title="">name</var>
-    in <var title="">element</var>'s <a href=#property-names>property names</a>, run
-    the appropriate set of substeps from the following list:</p>
+     <li><p>If there is a property named <code title=md-about><a href=#md-about>about</a></code> whose <a href=#concept-item-corresponding title=concept-item-corresponding>corresponding item</a> is
+     <var title="">node</var> and the element of the first such property
+     is a <a href=#url-property-elements title="URL property elements">URL property
+     element</a> and has a <a href=#concept-property-value title=concept-property-value>value</a> that is not an <a href=#concept-item title=concept-item>item</a>, <a href=#add-an-icalendar-line>add an iCalendar line</a>
+     with the type "<code title="">UID</code>" and that property's
+     <a href=#concept-property-value title=concept-property-value>value</a> as the value to
+     <var title="">output</var>.</li>
 
-    <dl><dt>If <var title="">name</var> is equal to the string "<code title=md-about><a href=#md-about>about</a></code>"</dt>
+     <li>
 
-     <dt>If the property's <a href=#concept-property-value title=concept-property-value>value</a> is an <a href=#concept-item title=concept-item>item</a></dt>
+      <p>For each element <var title="">element</var> that has one or
+      more <a href=#property-names>property names</a> and whose <a href=#concept-item-corresponding title=concept-item-corresponding>corresponding item</a> is
+      <var title="">node</var>: for each name <var title="">name</var>
+      in <var title="">element</var>'s <a href=#property-names>property names</a>, run
+      the appropriate set of substeps from the following list:</p>
 
-     <dd>
+      <dl><dt>If <var title="">name</var> is equal to the string "<code title=md-about><a href=#md-about>about</a></code>"</dt>
 
-      <p>Skip the property.</p>
+       <dt>If the property's <a href=#concept-property-value title=concept-property-value>value</a> is an <a href=#concept-item title=concept-item>item</a></dt>
 
-     </dd>
+       <dd>
 
+        <p>Skip the property.</p>
 
-     <dt>If <var title="">element</var> is a <code><a href=#the-time-element>time</a></code>
-     element</dt>
+       </dd>
 
-     <dd>
 
-      <p>Let <var title="">value</var> be the result of stripping
-      all U+002D HYPHEN-MINUS (-) and U+003A COLON (:) characters
-      from the property's <a href=#concept-property-value title=concept-property-value>value</a>.</p>
+       <dt>If <var title="">element</var> is a <code><a href=#the-time-element>time</a></code>
+       element</dt>
 
-      <p>If the property's <a href=#concept-property-value title=concept-property-value>value</a> is a <a href=#valid-date-string>valid
-      date string</a> then <a href=#add-an-icalendar-line>add an iCalendar line</a>
-      with the type <var title="">name</var> and the value <var title="">value</var> to <var title="">output</var>, with the
-      annotation "<code title="">VALUE=DATE</code>".</p>
+       <dd>
 
-      <p>Otherwise, if the property's <a href=#concept-property-value title=concept-property-value>value</a> is a <a href=#valid-global-date-and-time-string>valid
-      global date and time string</a> then <a href=#add-an-icalendar-line>add an iCalendar
-      line</a> with the type <var title="">name</var> and the
-      value <var title="">value</var> to <var title="">output</var>,
-      with the annotation "<code title="">VALUE=DATE-TIME</code>".</p>
+        <p>Let <var title="">value</var> be the result of stripping
+        all U+002D HYPHEN-MINUS (-) and U+003A COLON (:) characters
+        from the property's <a href=#concept-property-value title=concept-property-value>value</a>.</p>
 
-      <p>Otherwise skip the property.</p>
+        <p>If the property's <a href=#concept-property-value title=concept-property-value>value</a> is a <a href=#valid-date-string>valid
+        date string</a> then <a href=#add-an-icalendar-line>add an iCalendar line</a>
+        with the type <var title="">name</var> and the value <var title="">value</var> to <var title="">output</var>, with the
+        annotation "<code title="">VALUE=DATE</code>".</p>
 
-     </dd>
+        <p>Otherwise, if the property's <a href=#concept-property-value title=concept-property-value>value</a> is a <a href=#valid-global-date-and-time-string>valid
+        global date and time string</a> then <a href=#add-an-icalendar-line>add an iCalendar
+        line</a> with the type <var title="">name</var> and the
+        value <var title="">value</var> to <var title="">output</var>,
+        with the annotation "<code title="">VALUE=DATE-TIME</code>".</p>
 
+        <p>Otherwise skip the property.</p>
 
-     <dt>Otherwise</dt>
+       </dd>
 
-     <dd>
 
-      <p><a href=#add-an-icalendar-line>Add an iCalendar line</a> with the type <var title="">name</var> and the value <var title="">value</var> to
-      <var title="">output</var>.</p>
+       <dt>Otherwise</dt>
 
-     </dd>
+       <dd>
 
-    </dl></li>
+        <p><a href=#add-an-icalendar-line>Add an iCalendar line</a> with the type <var title="">name</var> and the value <var title="">value</var> to
+        <var title="">output</var>.</p>
 
-   <li><p><a href=#add-an-icalendar-line>Add an iCalendar line</a> with the type "<code title="">END</code>" and the value "<code title="">VEVENT</code>"
-   to <var title="">output</var>.</li>
+       </dd>
 
+      </dl></li>
+
+     <li><p><a href=#add-an-icalendar-line>Add an iCalendar line</a> with the type "<code title="">END</code>" and the value "<code title="">VEVENT</code>"
+     to <var title="">output</var>.</li>
+
+    </ol></li>
+
    <li><p><a href=#add-an-icalendar-line>Add an iCalendar line</a> with the type "<code title="">END</code>" and the value "<code title="">VCALENDAR</code>" to <var title="">output</var>.</li>
 
   </ol><p>When the above algorithm says that the user agent is to <dfn id=add-an-icalendar-line>add
@@ -55324,6 +55306,14 @@
   <p>Multiple events are fired on the <a href=#source-node>source node</a> during
   the course of the drag-and-drop operation.</p>
 
+  <hr><p>The <dfn id=list-of-dragged-nodes>list of dragged nodes</dfn> also depends on the kind of
+  drag. If it is a selection that is being dragged, then the
+  <a href=#list-of-dragged-nodes>list of dragged nodes</a> contains, in <a href=#tree-order>tree
+  order</a>, every node that is partially or completely included in
+  the selection (including all their ancestors). Otherwise, the
+  <a href=#list-of-dragged-nodes>list of dragged nodes</a> contains only the <a href=#source-node>source
+  node</a>.</p>
+
   <hr><p>If it is a selection that is being dragged, the <code title=dom-DragEvent-dataTransfer><a href=#dom-dragevent-datatransfer>dataTransfer</a></code> member of the event
   must be created with no nodes. Otherwise, it must be created
   containing just the <a href=#source-node>source node</a>. Script can use the
@@ -55331,56 +55321,101 @@
   to add further elements to the list of what is being dragged.</p>
 
   <p>The <code title=dom-DragEvent-dataTransfer><a href=#dom-dragevent-datatransfer>dataTransfer</a></code>
-  member of the event must have added to it the following:</p>
+  member of the event also has data added to it, as follows:</p>
 
-  <ul><li>If it is a selection that is being dragged, the text of the
-   selection, associated with the <code title="">text/plain</code>
-   format.</li>
+  <ul><li>
 
-   <li>If it is a selection that is being dragged, then the string
-   resulting from making a list of every node that is partially or
-   completely included in the selection and <a href=#extracting-json title="extracting
-   JSON">extracting the microdata from those nodes into a JSON
-   form</a>, associated with the <code title="">application/microdata+json</code> format.</li> <!-- XXX
-   register -->
+    <p>If it is a selection that is being dragged, then the user agent
+    must add the text of the selection to the <code title=dom-DragEvent-dataTransfer><a href=#dom-dragevent-datatransfer>dataTransfer</a></code> member,
+    associated with the <code title="">text/plain</code> format.</p>
 
-   <li>If it is a selection that is being dragged, then the string
-   resulting from making a list of every node that is partially or
-   completely included in the selection and <a href=#extracting-a-vcard title="extracting a
-   vCard">extracting the vCard data</a> from the first node in that
-   list that is an <a href=#concept-item title=concept-item>item</a> with the
-   type <code title=md-vcard><a href=#md-vcard>vcard</a></code>, if any, associated with
-   the <code title="">text/directory;profile=vcard</code> format.</li>
-   <!-- v2 more than one? -->
+   </li>
 
-   <li>If it is a selection that is being dragged, then the string
-   resulting from making a list of every node that is partially or
-   completely included in the selection and <a href=#extracting-a-vevent title="extracting a
-   vEvent">extracting the vEvent data</a> from the first node in
-   that list that is an <a href=#concept-item title=concept-item>item</a> with
-   the type <code title=md-vevent><a href=#md-vevent>vevent</a></code>, if any, associated
-   with the <code title="">text/calendar;component=vevent</code>
-   format.</li> <!-- v2 more than one? -->
+   <li>
 
-   <li>If it is a selection that is being dragged, then the string
-   resulting from making a list of every node that is partially or
-   completely included in the selection and concatenating the strings
-   obtained from <a href=#extracting-bibtex title="extracting BibTeX">extracting BibTeX
-   data</a> from all the nodes in that list that are <a href=#concept-item title=concept-item>items</a> with the type <code title=md-bibtex><a href=#md-bibtex>bibtex</a></code>, if any, associated with the <code title="">application/microdata+bibtex</code> format.</li> <!-- XXX
+    <p>The user agent must take the <a href=#list-of-dragged-nodes>list of dragged nodes</a>
+    and <a href=#extracting-json title="extracting JSON">extract the microdata from those
+    nodes into a JSON form</a>, and then must add the resulting
+    string to the <code title=dom-DragEvent-dataTransfer><a href=#dom-dragevent-datatransfer>dataTransfer</a></code> member,
+    associated with the <code title="">application/microdata+json</code> format.</li> <!-- XXX
+    register -->
+
+   <li>
+
+   <li>
+
+    <p>The user agent must take the <a href=#list-of-dragged-nodes>list of dragged nodes</a>
+    and <a href=#extracting-a-vcard title="extracting a vCard">extract the vCard data from
+    those nodes</a>, and then must add the resulting string to the
+    <code title=dom-DragEvent-dataTransfer><a href=#dom-dragevent-datatransfer>dataTransfer</a></code>
+    member, associated with the <code title="">text/directory;profile=vcard</code> format.</p>
+    <!-- v2: deal with multiple vCards -->
+
+   </li>
+
+   <li>
+
+    <p>The user agent must take the <a href=#list-of-dragged-nodes>list of dragged nodes</a>
+    and <a href=#extracting-vevent-data title="extracting vEvent data">extract the vEvent data
+    from those nodes</a>, and then must add the resulting string to
+    the <code title=dom-DragEvent-dataTransfer><a href=#dom-dragevent-datatransfer>dataTransfer</a></code>
+    member, associated with the <code title="">text/calendar;component=vevent</code> format.</p>
+
+   </li>
+
+   <li><p>For each node <var title="">node</var> that is
+   <a href=#sectioning-content-0>sectioning content</a> in the <a href=#list-of-dragged-nodes>list of dragged
+   nodes</a>, the user agent must check if there are any
+   <code><a href=#the-footer-element>footer</a></code> elements that <a href=#applyToSection>apply</a> to <var title="">node</var> and
+   that contain any elements that are <a href=#top-level-microdata-items title="top-level microdata
+   items">top-level microdata items</a> with the type <code title=md-bibtex><a href=#md-bibtex>bibtex</a></code>, and if so, then the user agent
+   must concatenate the strings obtained from <a href=#extracting-bibtex title="extracting
+   BibTeX">extracting BibTeX data</a> from all such nodes, and then
+   must add the resulting string to the <code title=dom-DragEvent-dataTransfer><a href=#dom-dragevent-datatransfer>dataTransfer</a></code> member,
+   associated with the <code title="">application/microdata+bibtex</code> format.</li> <!-- XXX
    register -->
 
    <li><p class=XXX>text/html fragment</p>
 
-   <li>If it is an <code><a href=#the-img-element>img</a></code> element being dragged, the value
-   of the element's <code title=dom-img-src><a href=#dom-img-src>src</a></code> DOM
-   attribute, associated with the <code title="">text/uri-list</code>
-   format.</li>
+   <li>
 
-   <li>If it is an <code><a href=#the-a-element>a</a></code> element being dragged, the value of
-   the element's <code title=dom-a-href><a href=#dom-a-href>href</a></code> DOM attribute,
-   associated with the <code title="">text/uri-list</code> format.</li>
+    <p>The user agent must run the following steps:</p>
 
-  </ul><p>If the event is canceled, then the drag-and-drop operation must
+    <ol><li><p>Let <var title="">urls</var> be an empty list of <a href=#absolute-url title="absolute URL">absolute URLs</a>.</li>
+
+     <li>
+
+      <p>For each <var title="">node</var> in <var title="">nodes</var>:</p>
+
+      <dl><dt>If the node is an <code><a href=#the-a-element>a</a></code> element with an <code title=attr-a-href>href</code></dt>
+
+       <dd>Add to <var title="">urls</var> the result of <a href=#resolve-a-url title="resolve a url">resolving</a> the element's <code title=attr-a-href>href</code> content attribute relative to
+       the element.</dd>
+
+       <dt>If the node is an <code><a href=#the-img-element>img</a></code> element with an <code title=attr-img-src><a href=#attr-img-src>src</a></code></dt>
+
+       <dd>Add to <var title="">urls</var> the result of <a href=#resolve-a-url title="resolve a url">resolving</a> the element's <code title=attr-img-src><a href=#attr-img-src>src</a></code> content attribute relative to the
+       element.</dd>
+
+       <!-- XXX others -->
+
+      </dl></li>
+
+     <li><p>If <var title="">urls</var> is still empty, abort these
+     steps.</li>
+
+     <li><p>Let <var title="">url string</var> be the result of
+     concatenating the strings in <var title="">urls</var>, in the
+     order they were added, separated by a U+000D CARRIAGE RETURN
+     U+000A LINE FEED character pair (CRLF).</li>
+
+     <li><p>Add <var title="">url string</var> to the <code title=dom-DragEvent-dataTransfer><a href=#dom-dragevent-datatransfer>dataTransfer</a></code> member,
+     associated with the <code title="">text/uri-list</code>
+     format.</li>
+
+    </ol></li>
+
+  </ul><hr><p>If the event is canceled, then the drag-and-drop operation must
   not occur; the user agent must not continue with this algorithm.</p>
 
   <p>If it is not canceled, then the drag-and-drop operation must be

Modified: source
===================================================================
--- source	2009-05-18 08:23:17 UTC (rev 3114)
+++ source	2009-05-19 01:11:49 UTC (rev 3115)
@@ -49729,27 +49729,23 @@
    title="">items</code>" whose value is the array <var
    title="">items</var>.</p></li>
 
-   <li><p>Let <var title="">current node</var> be <var
-   title="">node</var>.</p>
+   <li><p>Let <var title="">citations</var> be an empty
+   array.</p></li>
 
-   <li><p>Let <var title="">citation</var> be null.</p>
+   <li><p>For each <var title="">node</var> in <var
+   title="">nodes</var> that is <span>sectioning content</span>, check
+   if there are any <code>footer</code> elements that <a
+   href="#applyToSection">apply</a> to <var title="">node</var> and
+   that contain any elements that are <span title="top-level microdata
+   items">top-level microdata items</span> with the type <code
+   title="md-bibtex">bibtex</code>, and if so, then <span>get the
+   object</span> for each such element and add them to <var
+   title="">citations</var>.</p></li>
 
-   <li><p><i>Citation search:</i> If <var title="">current node</var>
-   has a descendant element that is a <span title="top-level microdata
-   items">top-level microdata item</span> with the type <code
-   title="md-bibtex">bibtex</code>, then <span>get the object</span>
-   for the first such element in <span>tree order</span> and let <var
-   title="">citation</var> be that object.</p></li>
+   <li><p>Add an entry to <var title="">result</var> called "<code
+   title="">citations</code>" whose value is the array <var
+   title="">citations</var>.</p></li>
 
-   <li><p>If <var title="">citation</var> is null and <var
-   title="">current node</var> has a parent node, let <var
-   title="">current node</var> be its parent node and jump back to the
-   step labeled <i>citation search</i>.</p></li>
-
-   <li><p>If <var title="">citation</var> is not null, add an entry to
-   <var title="">result</var> called "<code title="">citation</code>"
-   whose value is the <var title="">citation</var> object.</p></li>
-
    <li><p>Return the result of serializing <var title="">result</var>
    to JSON.</p></li>
 
@@ -50112,35 +50108,24 @@
 
   <h4>vCard</h4>
 
-  <p>Given a node <var title="">node</var> in a <code>Document</code>,
-  a user agent must run the following algorithm to <dfn
-  title="extracting a vCard">extract any <code
-  title="md-vcard">vcard</code> data represented by that
-  node</dfn>:</p>
+  <p>Given a list of nodes <var title="">nodes</var> in a
+  <code>Document</code>, a user agent must run the following algorithm
+  to <dfn title="extracting a vCard">extract any <code
+  title="md-vcard">vcard</code> data represented by those nodes</dfn>
+  (only the first vCard is returned):</p>
 
   <ol>
 
-   <li>
+   <li><p>If none of the nodes in <var title="">nodes</var> are <span
+   title="concept-item">items</span> with the type <code
+   title="md-vcard">vcard</code>, then there is no vCard. Abort the
+   algorithm, returning nothing.</p></li>
 
-    <p>If <var title="">node</var> is not an element that is an <span
-    title="concept-item">item</span> with the type <code
-    title="md-vcard">vcard</code>, then run these substeps:</p>
+   <li><p>Let <var title="">node</var> be the first node in <var
+   title="">nodes</var> that is an <span
+   title="concept-item">item</span> with the type <code
+   title="md-vcard">vcard</code>.</p></li>
 
-    <ol>
-
-     <li><p>If <var title="">node</var> has no parent, then there is
-     no vCard. Abort the algorithm, returning nothing.</p></li>
-
-     <li><p>Let <var title="">node</var> be <var title="">node</var>'s
-     parent.</p></li>
-
-     <li><p>Restart the entire algorithm with the new value of <var
-     title="">node</var>.</p></li>
-
-    </ol>
-
-   </li>
-
    <li><p>Let <var title="">output</var> be an empty string.</p></li>
 
    <li><p><span>Add a vCard line</span> with the type "<code
@@ -50860,36 +50845,19 @@
 
   <h4>iCalendar</h4>
 
-  <p>Given a node <var title="">node</var> in a <code>Document</code>,
-  a user agent must run the following algorithm to <dfn
-  title="extracting a vEvent">extract any <code
-  title="md-vevent">vevent</code> data represented by that
-  node</dfn>:</p>
+  <p>Given a list of nodes <var title="">nodes</var> in a
+  <code>Document</code>, a user agent must run the following algorithm
+  to <dfn title="extracting vEvent data">extract any <code
+  title="md-vevent">vevent</code> data represented by those
+  nodes</dfn>:</p>
 
   <ol>
 
-   <li>
+   <li><p>If none of the nodes in <var title="">nodes</var> are <span
+   title="concept-item">items</span> with the type <code
+   title="md-vevent">vevent</code>, then there is no vEvent
+   data. Abort the algorithm, returning nothing.</p></li>
 
-    <p>If <var title="">node</var> is not an element that is an <span
-    title="concept-item">item</span> with the type <code
-    title="md-vevent">vevent</code>, then run these substeps:</p>
-
-    <ol>
-
-     <li><p>If <var title="">node</var> has no parent, then there is
-     no event to output. Abort the algorithm, returning
-     nothing.</p></li>
-
-     <li><p>Let <var title="">node</var> be <var title="">node</var>'s
-     parent.</p></li>
-
-     <li><p>Restart the entire algorithm with the new value of <var
-     title="">node</var>.</p></li>
-
-    </ol>
-
-   </li>
-
    <li><p>Let <var title="">output</var> be an empty string.</p></li>
 
    <li><p><span>Add an iCalendar line</span> with the type "<code
@@ -50905,103 +50873,116 @@
    title="">VERSION</code>" and the value "<code title="">2.0</code>"
    to <var title="">output</var>.</p></li>
 
-   <li><p><span>Add an iCalendar line</span> with the type "<code
-   title="">BEGIN</code>" and the value "<code title="">VEVENT</code>"
-   to <var title="">output</var>.</p></li>
+   <li>
 
-   <li><p><span>Add an iCalendar line</span> with the type "<code
-   title="">DTSTAMP</code>" and a value consisting of an iCalendar
-   DATE-TIME string representing the current date and time, with the
-   annotation "<code title="">VALUE=DATE-TIME</code>", to <var
-   title="">output</var>.  <a
-   href="#refsRFC2445">[RFC2445]</a></p></li>
+    <p>For each node <var title="">node</var> in <var
+    title="">nodes</var> that is an <span
+    title="concept-item">item</span> with the type <code
+    title="md-vevent">vevent</code>, run the following steps:</p>
 
-   <li><p>If there is a property named <code
-   title="md-about">about</code> whose <span
-   title="concept-item-corresponding">corresponding item</span> is
-   <var title="">node</var> and the element of the first such property
-   is a <span title="URL property elements">URL property
-   element</span> and has a <span
-   title="concept-property-value">value</span> that is not an <span
-   title="concept-item">item</span>, <span>add an iCalendar line</span>
-   with the type "<code title="">UID</code>" and that property's
-   <span title="concept-property-value">value</span> as the value to
-   <var title="">output</var>.</p></li>
+    <ol>
 
-   <li>
+     <li><p><span>Add an iCalendar line</span> with the type "<code
+     title="">BEGIN</code>" and the value "<code title="">VEVENT</code>"
+     to <var title="">output</var>.</p></li>
 
-    <p>For each element <var title="">element</var> that has one or
-    more <span>property names</span> and whose <span
-    title="concept-item-corresponding">corresponding item</span> is
-    <var title="">node</var>: for each name <var title="">name</var>
-    in <var title="">element</var>'s <span>property names</span>, run
-    the appropriate set of substeps from the following list:</p>
+     <li><p><span>Add an iCalendar line</span> with the type "<code
+     title="">DTSTAMP</code>" and a value consisting of an iCalendar
+     DATE-TIME string representing the current date and time, with the
+     annotation "<code title="">VALUE=DATE-TIME</code>", to <var
+     title="">output</var>.  <a
+     href="#refsRFC2445">[RFC2445]</a></p></li>
 
-    <dl>
+     <li><p>If there is a property named <code
+     title="md-about">about</code> whose <span
+     title="concept-item-corresponding">corresponding item</span> is
+     <var title="">node</var> and the element of the first such property
+     is a <span title="URL property elements">URL property
+     element</span> and has a <span
+     title="concept-property-value">value</span> that is not an <span
+     title="concept-item">item</span>, <span>add an iCalendar line</span>
+     with the type "<code title="">UID</code>" and that property's
+     <span title="concept-property-value">value</span> as the value to
+     <var title="">output</var>.</p></li>
 
-     <dt>If <var title="">name</var> is equal to the string "<code
-     title="md-about">about</code>"</dt>
+     <li>
 
-     <dt>If the property's <span
-     title="concept-property-value">value</span> is an <span
-     title="concept-item">item</span></dt>
+      <p>For each element <var title="">element</var> that has one or
+      more <span>property names</span> and whose <span
+      title="concept-item-corresponding">corresponding item</span> is
+      <var title="">node</var>: for each name <var title="">name</var>
+      in <var title="">element</var>'s <span>property names</span>, run
+      the appropriate set of substeps from the following list:</p>
 
-     <dd>
+      <dl>
 
-      <p>Skip the property.</p>
+       <dt>If <var title="">name</var> is equal to the string "<code
+       title="md-about">about</code>"</dt>
 
-     </dd>
+       <dt>If the property's <span
+       title="concept-property-value">value</span> is an <span
+       title="concept-item">item</span></dt>
 
+       <dd>
 
-     <dt>If <var title="">element</var> is a <code>time</code>
-     element</dt>
+        <p>Skip the property.</p>
 
-     <dd>
+       </dd>
 
-      <p>Let <var title="">value</var> be the result of stripping
-      all U+002D HYPHEN-MINUS (-) and U+003A COLON (:) characters
-      from the property's <span
-      title="concept-property-value">value</span>.</p>
 
-      <p>If the property's <span
-      title="concept-property-value">value</span> is a <span>valid
-      date string</span> then <span>add an iCalendar line</span>
-      with the type <var title="">name</var> and the value <var
-      title="">value</var> to <var title="">output</var>, with the
-      annotation "<code title="">VALUE=DATE</code>".</p>
+       <dt>If <var title="">element</var> is a <code>time</code>
+       element</dt>
 
-      <p>Otherwise, if the property's <span
-      title="concept-property-value">value</span> is a <span>valid
-      global date and time string</span> then <span>add an iCalendar
-      line</span> with the type <var title="">name</var> and the
-      value <var title="">value</var> to <var title="">output</var>,
-      with the annotation "<code
-      title="">VALUE=DATE-TIME</code>".</p>
+       <dd>
 
-      <p>Otherwise skip the property.</p>
+        <p>Let <var title="">value</var> be the result of stripping
+        all U+002D HYPHEN-MINUS (-) and U+003A COLON (:) characters
+        from the property's <span
+        title="concept-property-value">value</span>.</p>
 
-     </dd>
+        <p>If the property's <span
+        title="concept-property-value">value</span> is a <span>valid
+        date string</span> then <span>add an iCalendar line</span>
+        with the type <var title="">name</var> and the value <var
+        title="">value</var> to <var title="">output</var>, with the
+        annotation "<code title="">VALUE=DATE</code>".</p>
 
+        <p>Otherwise, if the property's <span
+        title="concept-property-value">value</span> is a <span>valid
+        global date and time string</span> then <span>add an iCalendar
+        line</span> with the type <var title="">name</var> and the
+        value <var title="">value</var> to <var title="">output</var>,
+        with the annotation "<code
+        title="">VALUE=DATE-TIME</code>".</p>
 
-     <dt>Otherwise</dt>
+        <p>Otherwise skip the property.</p>
 
-     <dd>
+       </dd>
 
-      <p><span>Add an iCalendar line</span> with the type <var
-      title="">name</var> and the value <var title="">value</var> to
-      <var title="">output</var>.</p>
 
-     </dd>
+       <dt>Otherwise</dt>
 
-    </dl>
+       <dd>
 
+        <p><span>Add an iCalendar line</span> with the type <var
+        title="">name</var> and the value <var title="">value</var> to
+        <var title="">output</var>.</p>
+
+       </dd>
+
+      </dl>
+
+     </li>
+
+     <li><p><span>Add an iCalendar line</span> with the type "<code
+     title="">END</code>" and the value "<code title="">VEVENT</code>"
+     to <var title="">output</var>.</p></li>
+
+    </ol>
+
    </li>
 
    <li><p><span>Add an iCalendar line</span> with the type "<code
-   title="">END</code>" and the value "<code title="">VEVENT</code>"
-   to <var title="">output</var>.</p></li>
-
-   <li><p><span>Add an iCalendar line</span> with the type "<code
    title="">END</code>" and the value "<code
    title="">VCALENDAR</code>" to <var title="">output</var>.</p></li>
 
@@ -64842,6 +64823,16 @@
 
   <hr>
 
+  <p>The <dfn>list of dragged nodes</dfn> also depends on the kind of
+  drag. If it is a selection that is being dragged, then the
+  <span>list of dragged nodes</span> contains, in <span>tree
+  order</span>, every node that is partially or completely included in
+  the selection (including all their ancestors). Otherwise, the
+  <span>list of dragged nodes</span> contains only the <span>source
+  node</span>.</p>
+
+  <hr>
+
   <p>If it is a selection that is being dragged, the <code
   title="dom-DragEvent-dataTransfer">dataTransfer</code> member of the event
   must be created with no nodes. Otherwise, it must be created
@@ -64850,63 +64841,132 @@
   to add further elements to the list of what is being dragged.</p>
 
   <p>The <code title="dom-DragEvent-dataTransfer">dataTransfer</code>
-  member of the event must have added to it the following:</p>
+  member of the event also has data added to it, as follows:</p>
 
   <ul>
 
-   <li>If it is a selection that is being dragged, the text of the
-   selection, associated with the <code title="">text/plain</code>
-   format.</li>
+   <li>
 
-   <li>If it is a selection that is being dragged, then the string
-   resulting from making a list of every node that is partially or
-   completely included in the selection and <span title="extracting
-   JSON">extracting the microdata from those nodes into a JSON
-   form</span>, associated with the <code
-   title="">application/microdata+json</code> format.</li> <!-- XXX
-   register -->
+    <p>If it is a selection that is being dragged, then the user agent
+    must add the text of the selection to the <code
+    title="dom-DragEvent-dataTransfer">dataTransfer</code> member,
+    associated with the <code title="">text/plain</code> format.</p>
 
-   <li>If it is a selection that is being dragged, then the string
-   resulting from making a list of every node that is partially or
-   completely included in the selection and <span title="extracting a
-   vCard">extracting the vCard data</span> from the first node in that
-   list that is an <span title="concept-item">item</span> with the
-   type <code title="md-vcard">vcard</code>, if any, associated with
-   the <code title="">text/directory;profile=vcard</code> format.</li>
-   <!-- v2 more than one? -->
+   </li>
 
-   <li>If it is a selection that is being dragged, then the string
-   resulting from making a list of every node that is partially or
-   completely included in the selection and <span title="extracting a
-   vEvent">extracting the vEvent data</span> from the first node in
-   that list that is an <span title="concept-item">item</span> with
-   the type <code title="md-vevent">vevent</code>, if any, associated
-   with the <code title="">text/calendar;component=vevent</code>
-   format.</li> <!-- v2 more than one? -->
+   <li>
 
-   <li>If it is a selection that is being dragged, then the string
-   resulting from making a list of every node that is partially or
-   completely included in the selection and concatenating the strings
-   obtained from <span title="extracting BibTeX">extracting BibTeX
-   data</span> from all the nodes in that list that are <span
-   title="concept-item">items</span> with the type <code
-   title="md-bibtex">bibtex</code>, if any, associated with the <code
+    <p>The user agent must take the <span>list of dragged nodes</span>
+    and <span title="extracting JSON">extract the microdata from those
+    nodes into a JSON form</span>, and then must add the resulting
+    string to the <code
+    title="dom-DragEvent-dataTransfer">dataTransfer</code> member,
+    associated with the <code
+    title="">application/microdata+json</code> format.</li> <!-- XXX
+    register -->
+
+   <li>
+
+   <li>
+
+    <p>The user agent must take the <span>list of dragged nodes</span>
+    and <span title="extracting a vCard">extract the vCard data from
+    those nodes</span>, and then must add the resulting string to the
+    <code title="dom-DragEvent-dataTransfer">dataTransfer</code>
+    member, associated with the <code
+    title="">text/directory;profile=vcard</code> format.</p>
+    <!-- v2: deal with multiple vCards -->
+
+   </li>
+
+   <li>
+
+    <p>The user agent must take the <span>list of dragged nodes</span>
+    and <span title="extracting vEvent data">extract the vEvent data
+    from those nodes</span>, and then must add the resulting string to
+    the <code title="dom-DragEvent-dataTransfer">dataTransfer</code>
+    member, associated with the <code
+    title="">text/calendar;component=vevent</code> format.</p>
+
+   </li>
+
+   <li><p>For each node <var title="">node</var> that is
+   <span>sectioning content</span> in the <span>list of dragged
+   nodes</span>, the user agent must check if there are any
+   <code>footer</code> elements that <a
+   href="#applyToSection">apply</a> to <var title="">node</var> and
+   that contain any elements that are <span title="top-level microdata
+   items">top-level microdata items</span> with the type <code
+   title="md-bibtex">bibtex</code>, and if so, then the user agent
+   must concatenate the strings obtained from <span title="extracting
+   BibTeX">extracting BibTeX data</span> from all such nodes, and then
+   must add the resulting string to the <code
+   title="dom-DragEvent-dataTransfer">dataTransfer</code> member,
+   associated with the <code
    title="">application/microdata+bibtex</code> format.</li> <!-- XXX
    register -->
 
    <li><p class="XXX">text/html fragment</p>
 
-   <li>If it is an <code>img</code> element being dragged, the value
-   of the element's <code title="dom-img-src">src</code> DOM
-   attribute, associated with the <code title="">text/uri-list</code>
-   format.</li>
+   <li>
 
-   <li>If it is an <code>a</code> element being dragged, the value of
-   the element's <code title="dom-a-href">href</code> DOM attribute,
-   associated with the <code title="">text/uri-list</code> format.</li>
+    <p>The user agent must run the following steps:</p>
 
+    <ol>
+
+     <li><p>Let <var title="">urls</var> be an empty list of <span
+     title="absolute URL">absolute URLs</span>.</p></li>
+
+     <li>
+
+      <p>For each <var title="">node</var> in <var
+      title="">nodes</var>:</p>
+
+      <dl>
+
+       <dt>If the node is an <code>a</code> element with an <code
+       title="attr-a-href">href</code></dt>
+
+       <dd>Add to <var title="">urls</var> the result of <span
+       title="resolve a url">resolving</span> the element's <code
+       title="attr-a-href">href</code> content attribute relative to
+       the element.</dd>
+
+       <dt>If the node is an <code>img</code> element with an <code
+       title="attr-img-src">src</code></dt>
+
+       <dd>Add to <var title="">urls</var> the result of <span
+       title="resolve a url">resolving</span> the element's <code
+       title="attr-img-src">src</code> content attribute relative to the
+       element.</dd>
+
+       <!-- XXX others -->
+
+      </dl>
+
+     </li>
+
+     <li><p>If <var title="">urls</var> is still empty, abort these
+     steps.</p></li>
+
+     <li><p>Let <var title="">url string</var> be the result of
+     concatenating the strings in <var title="">urls</var>, in the
+     order they were added, separated by a U+000D CARRIAGE RETURN
+     U+000A LINE FEED character pair (CRLF).</p></li>
+
+     <li><p>Add <var title="">url string</var> to the <code
+     title="dom-DragEvent-dataTransfer">dataTransfer</code> member,
+     associated with the <code title="">text/uri-list</code>
+     format.</p></li>
+
+    </ol>
+
+   </li>
+
   </ul>
 
+  <hr>
+
   <p>If the event is canceled, then the drag-and-drop operation must
   not occur; the user agent must not continue with this algorithm.</p>
 




More information about the Commit-Watchers mailing list