Skip to content

Commit

Permalink
Fix #45 - drag data store mode should be read-only for paste
Browse files Browse the repository at this point in the history
  • Loading branch information
garykac committed Oct 16, 2017
1 parent 3d40902 commit b6bf11a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions index.bs
Expand Up @@ -477,7 +477,7 @@ urlPrefix: https://w3c.github.io/permissions/#dom-permissionstate-; type: dfn;
handler will need to manually paste the data into the document.

Also note that, when pasting, the [=drag data store mode=] flag is
<a lt="concept dnd ro">read/only</a>, hence calling {{DataTransfer/setData()}} from a
<a lt="concept dnd ro">read-only</a>, hence calling {{DataTransfer/setData()}} from a
[=paste=] event handler will not modify the data that is
inserted, and not modify the data on the clipboard.

Expand Down Expand Up @@ -1367,7 +1367,7 @@ urlPrefix: https://w3c.github.io/permissions/#dom-permissionstate-; type: dfn;

1. Set the |clipboard-event-data|'s
internal [=drag data store mode=] flag to
<a lt="concept dnd rw">read/write</a>.
<a lt="concept dnd ro">read-only</a>.

1. If |trusted| is <em>true</em>, or the
implementation is configured to give script-generated events
Expand Down
4 changes: 2 additions & 2 deletions index.html
Expand Up @@ -1887,7 +1887,7 @@ <h3 class="heading settled" data-level="6.3" id="override-paste"><span class="se
<p>Note that canceling the <a data-link-type="dfn" href="#paste" id="ref-for-paste-8">paste</a> event will also prevent the document from
being updated (i.e., nothing will be pasted into the document). The event
handler will need to manually paste the data into the document.</p>
<p>Also note that, when pasting, the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/interaction.html#drag-data-store-mode">drag data store mode</a> flag is <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/interaction.html#concept-dnd-ro">read/only</a>, hence calling <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/interaction.html#dom-datatransfer-setdata">setData()</a></code> from a <a data-link-type="dfn" href="#paste" id="ref-for-paste-9">paste</a> event handler will not modify the data that is
<p>Also note that, when pasting, the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/interaction.html#drag-data-store-mode">drag data store mode</a> flag is <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/interaction.html#concept-dnd-ro">read-only</a>, hence calling <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/interaction.html#dom-datatransfer-setdata">setData()</a></code> from a <a data-link-type="dfn" href="#paste" id="ref-for-paste-9">paste</a> event handler will not modify the data that is
inserted, and not modify the data on the clipboard.</p>
<pre class="example javascript" id="example-ce8e183c"><a class="self-link" href="#example-ce8e183c"></a>// Overwrite what is being pasted onto the clipboard.
document.addEventListener('paste', function(e) {
Expand Down Expand Up @@ -2775,7 +2775,7 @@ <h3 class="heading settled" id="to-fire-a-clipboard-event"><span class="content"
<ol>
<li data-md="">
<p>Set the <var>clipboard-event-data</var>’s
internal <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/interaction.html#drag-data-store-mode">drag data store mode</a> flag to <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/interaction.html#concept-dnd-rw">read/write</a>.</p>
internal <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/interaction.html#drag-data-store-mode">drag data store mode</a> flag to <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/interaction.html#concept-dnd-ro">read-only</a>.</p>
<li data-md="">
<p>If <var>trusted</var> is <em>true</em>, or the
implementation is configured to give script-generated events
Expand Down

0 comments on commit b6bf11a

Please sign in to comment.