Skip to content

Commit

Permalink
Fix broken step reference in “fire a DND event” algorithm
Browse files Browse the repository at this point in the history
A step in the “fire a DND event” algorithm referred back to an action occurring
in the “first step” of the algorithm, but since the time when that reference was
first made, additional steps were apparently added to the beginning of the
algorithm such that what had been the first step is now step 3. So this change
refines the algorithm to instead set and use an internal flag rather than
relying on a hardcoded reference back to a specific step.

Credit to @rniwa for catching it.
  • Loading branch information
sideshowbarker authored and annevk committed Aug 19, 2017
1 parent cb8405e commit 0004894
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions source
Expand Up @@ -75709,6 +75709,8 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {

<ol>

<li>Let <var>dataDragStoreWasChanged</var> be false.</li>

<li><p>If no specific <var>related target</var> was provided, set <var>related target</var> to
null.</p></li>

Expand All @@ -75717,8 +75719,9 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {

<li>

<p>If <var>e</var> is <code data-x="event-dnd-dragstart">dragstart</code>, set the <span>drag
data store mode</span> to the <span data-x="concept-dnd-rw">read/write mode</span>.</p>
<p>If <var>e</var> is <code data-x="event-dnd-dragstart">dragstart</code>, then set the
<span>drag data store mode</span> to the <span data-x="concept-dnd-rw">read/write mode</span>
and set <var>dataDragStoreWasChanged</var> to true.</p>

<p>If <var>e</var> is <code data-x="event-dnd-drop">drop</code>, set the <span>drag data store
mode</span> to the <span data-x="concept-dnd-ro">read-only mode</span>.</p>
Expand Down Expand Up @@ -75850,8 +75853,8 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
attribute. (It can only have changed value if <var>e</var> is <code
data-x="event-dnd-dragstart">dragstart</code>.)</p></li>

<li><p>Set the <span>drag data store mode</span> back to the <span
data-x="concept-dnd-p">protected mode</span> if it was changed in the first step.</p></li>
<li><p>If <var>dataDragStoreWasChanged</var> is true, then set the <span>drag data store
mode</span> back to the <span data-x="concept-dnd-p">protected mode</span>.</p></li>

<li><p>Break the association between <var>dataTransfer</var> and the <span>drag data
store</span>.</p></li>
Expand Down

0 comments on commit 0004894

Please sign in to comment.