[html5] r3114 - [] (0) Include microdata when dragging-and-dropping or copying-and-pasting.

whatwg at whatwg.org whatwg at whatwg.org
Mon May 18 01:23:18 PDT 2009


Author: ianh
Date: 2009-05-18 01:23:17 -0700 (Mon, 18 May 2009)
New Revision: 3114

Modified:
   index
   source
Log:
[] (0) Include microdata when dragging-and-dropping or copying-and-pasting.

Modified: index
===================================================================
--- index	2009-05-18 06:20:08 UTC (rev 3113)
+++ index	2009-05-18 08:23:17 UTC (rev 3114)
@@ -43926,19 +43926,18 @@
 
   </ul><h4 id=json><span class=secno>5.5.1 </span>JSON</h4>
 
-  <p>Given a node <var title="">node</var> in a <code>Document</code>,
-  a user agent must run the following algorithm to extract that node's
-  microdata into a JSON form:</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-json title="extracting JSON">extract the microdata from those
+  nodes into a JSON form</dfn>:</p>
 
   <ol><li><p>Let <var title="">result</var> be an empty object.</li>
 
    <li><p>Let <var title="">items</var> be an empty array.</li>
 
-   <li><p>For <var title="">node</var> and each element that is a
-   descendant of <var title="">node</var>, check if the element is a
-   <a href=#top-level-microdata-items title="top-level microdata items">top-level microdata
-   item</a>, and if it is then <a href=#get-the-object>get the object</a> for that
-   element and add it to <var title="">items</var>.</li>
+   <li><p>For each <var title="">node</var> in <var title="">nodes</var>, check if the element is a <a href=#top-level-microdata-items title="top-level microdata items">top-level microdata item</a>,
+   and if it is then <a href=#get-the-object>get the object</a> for that element and
+   add it to <var title="">items</var>.</li>
 
    <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>
 
@@ -44742,7 +44741,8 @@
   <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 extract any <code title=md-vevent><a href=#md-vevent>vevent</a></code> data represented by that node:</p>
+  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>
 
   <ol><li>
 
@@ -44930,9 +44930,9 @@
   <h4 id=bibtex-0><span class=secno>5.5.5 </span>BibTeX</h4>
 
   <p>Given a node <var title="">node</var> in a <code>Document</code>,
-  a user agent must run the following algorithm to extract any <code title=md-bibtex><a href=#md-bibtex>bibtex</a></code> data represented by that node into a
+  a user agent must run the following algorithm to <dfn id=extracting-bibtex title="extracting BibTeX">extract any <code title=md-bibtex>bibtex</code> data represented by that node into a
   form that vaguely resembles the format used by BibTeX
-  processors:</p>
+  processors</dfn>:</p>
 
   <ol><li>
 
@@ -44987,8 +44987,7 @@
 
      <li><p>Append two U+0020 SPACE characters to <var title="">output</var>.</li>
 
-     <li><p>Append <var title="">name</var> to var
-     title="">output.</li>
+     <li><p>Append <var title="">name</var> to <var title="">output</var>.</li>
 
      <li><p>Append a U+0020 SPACE character, a U+003D EQUALS SIGN
      character (=), and another U+0020 SPACE character to <var title="">output</var>.</li>
@@ -55309,45 +55308,79 @@
 
   <p>If the user agent determines that something can be dragged, a
   <code title=event-dragstart><a href=#event-dragstart>dragstart</a></code> event must then be
-  fired.</p>
+  fired at the <a href=#source-node>source node</a>.</p>
 
-  <p>If it is a selection that is being dragged, then this event must
-  be fired on the node that the user started the drag on (typically
-  the text node that the user originally clicked). If the user did not
-  specify a particular node, for example if the user just told the
-  user agent to begin a drag of "the selection", then the event must
-  be fired on the deepest node that is a common ancestor of all parts
-  of the selection.</p>
+  <p>The <dfn id=source-node>source node</dfn> depends on the kind of drag and how it
+  was initiated. If it is a selection that is being dragged, then the
+  <a href=#source-node>source node</a> is the node that the user started the drag
+  on (typically the text node that the user originally clicked). If
+  the user did not specify a particular node, for example if the user
+  just told the user agent to begin a drag of "the selection", then
+  the <a href=#source-node>source node</a> is the deepest node that is a common
+  ancestor of all parts of the selection. If it is not a selection
+  that is being dragged, then the <a href=#source-node>source node</a> is the
+  element that is being dragged.</p>
 
-  <p class=XXX>We should look into how browsers do other types
-  (e.g. Firefox apparently also adds text/html for internal drag and
-  drop of a selection).</p>
+  <p>Multiple events are fired on the <a href=#source-node>source node</a> during
+  the course of the drag-and-drop operation.</p>
 
-  <p>If it is not a selection that is being dragged, then the event
-  must be fired on the element that is being dragged.</p>
-
-  <p>The node on which the event is fired is the <dfn id=source-node>source
-  node</dfn>. Multiple events are fired on this node during the course
-  of the drag-and-drop operation.</p>
-
-  <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
+  <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
   <code title=dom-DataTransfer-addElement><a href=#dom-datatransfer-addelement>addElement()</a></code> method
   to add further elements to the list of what is being dragged.</p>
 
-  <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 have the text of the selection added to it as the data
-  associated with the <code title="">text/plain</code>
-  format. Otherwise, if it is an <code><a href=#the-img-element>img</a></code> element being
-  dragged, then the value of the element's <code title=dom-img-src><a href=#dom-img-src>src</a></code> DOM attribute must be added,
-  associated with the <code title="">text/uri-list</code>
-  format. Otherwise, if it is an <code><a href=#the-a-element>a</a></code> element being dragged,
-  then the value of the element's <code title=dom-a-href><a href=#dom-a-href>href</a></code>
-  DOM attribute must be added, associated with the <code title="">text/uri-list</code> format. Otherwise, no data is added to
-  the object by the user agent.</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>
 
-  <p>If the event is canceled, then the drag-and-drop operation must
+  <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>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 -->
+
+   <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>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>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
+   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>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>
+
+  </ul><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 06:20:08 UTC (rev 3113)
+++ source	2009-05-18 08:23:17 UTC (rev 3114)
@@ -49708,9 +49708,10 @@
 
   <h4>JSON</h4>
 
-  <p>Given a node <var title="">node</var> in a <code>Document</code>,
-  a user agent must run the following algorithm to extract that node's
-  microdata into a JSON form:</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 JSON">extract the microdata from those
+  nodes into a JSON form</dfn>:</p>
 
   <ol>
 
@@ -49718,11 +49719,11 @@
 
    <li><p>Let <var title="">items</var> be an empty array.</p></li>
 
-   <li><p>For <var title="">node</var> and each element that is a
-   descendant of <var title="">node</var>, check if the element is a
-   <span title="top-level microdata items">top-level microdata
-   item</span>, and if it is then <span>get the object</span> for that
-   element and add it to <var title="">items</var>.</p></li>
+   <li><p>For each <var title="">node</var> in <var
+   title="">nodes</var>, check if the element is a <span
+   title="top-level microdata items">top-level microdata item</span>,
+   and if it is then <span>get the object</span> for that element and
+   add it to <var title="">items</var>.</p></li>
 
    <li><p>Add an entry to <var title="">result</var> called "<code
    title="">items</code>" whose value is the array <var
@@ -50860,8 +50861,10 @@
   <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 extract any <code
-  title="md-vevent">vevent</code> data represented by that node:</p>
+  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>
 
   <ol>
 
@@ -51116,10 +51119,11 @@
   <h4>BibTeX</h4>
 
   <p>Given a node <var title="">node</var> in a <code>Document</code>,
-  a user agent must run the following algorithm to extract any <code
+  a user agent must run the following algorithm to <dfn
+  title="extracting BibTeX">extract any <code
   title="md-bibtex">bibtex</code> data represented by that node into a
   form that vaguely resembles the format used by BibTeX
-  processors:</p>
+  processors</dfn>:</p>
 
   <ol>
 
@@ -51201,7 +51205,7 @@
      <li><p>Append two U+0020 SPACE characters to <var
      title="">output</var>.</p></li>
 
-     <li><p>Append <var title="">name</var> to var
+     <li><p>Append <var title="">name</var> to <var
      title="">output</var>.</li>
 
      <li><p>Append a U+0020 SPACE character, a U+003D EQUALS SIGN
@@ -64820,27 +64824,24 @@
 
   <p>If the user agent determines that something can be dragged, a
   <code title="event-dragstart">dragstart</code> event must then be
-  fired.</p>
+  fired at the <span>source node</span>.</p>
 
-  <p>If it is a selection that is being dragged, then this event must
-  be fired on the node that the user started the drag on (typically
-  the text node that the user originally clicked). If the user did not
-  specify a particular node, for example if the user just told the
-  user agent to begin a drag of "the selection", then the event must
-  be fired on the deepest node that is a common ancestor of all parts
-  of the selection.</p>
+  <p>The <dfn>source node</dfn> depends on the kind of drag and how it
+  was initiated. If it is a selection that is being dragged, then the
+  <span>source node</span> is the node that the user started the drag
+  on (typically the text node that the user originally clicked). If
+  the user did not specify a particular node, for example if the user
+  just told the user agent to begin a drag of "the selection", then
+  the <span>source node</span> is the deepest node that is a common
+  ancestor of all parts of the selection. If it is not a selection
+  that is being dragged, then the <span>source node</span> is the
+  element that is being dragged.</p>
 
-  <p class="XXX">We should look into how browsers do other types
-  (e.g. Firefox apparently also adds text/html for internal drag and
-  drop of a selection).</p>
+  <p>Multiple events are fired on the <span>source node</span> during
+  the course of the drag-and-drop operation.</p>
 
-  <p>If it is not a selection that is being dragged, then the event
-  must be fired on the element that is being dragged.</p>
+  <hr>
 
-  <p>The node on which the event is fired is the <dfn>source
-  node</dfn>. Multiple events are fired on this node during the course
-  of the drag-and-drop operation.</p>
-
   <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
@@ -64848,20 +64849,64 @@
   <code title="dom-DataTransfer-addElement">addElement()</code> method
   to add further elements to the list of what is being dragged.</p>
 
-  <p>If it is a selection that is being dragged, the <code
-  title="dom-DragEvent-dataTransfer">dataTransfer</code> member of the
-  event must have the text of the selection added to it as the data
-  associated with the <code title="">text/plain</code>
-  format. Otherwise, if it is an <code>img</code> element being
-  dragged, then the value of the element's <code
-  title="dom-img-src">src</code> DOM attribute must be added,
-  associated with the <code title="">text/uri-list</code>
-  format. Otherwise, if it is an <code>a</code> element being dragged,
-  then the value of the element's <code title="dom-a-href">href</code>
-  DOM attribute must be added, associated with the <code
-  title="">text/uri-list</code> format. Otherwise, no data is added to
-  the object by the user agent.</p>
+  <p>The <code title="dom-DragEvent-dataTransfer">dataTransfer</code>
+  member of the event must have added to it the following:</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>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 -->
+
+   <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>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>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
+   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>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>
+
+  </ul>
+
   <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