[Webkit-unassigned] [Bug 33691] Drag and Drop source/destination code needs cleanup

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 14 15:13:29 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=33691





--- Comment #3 from Brian Weinstein <bweinstein at apple.com>  2010-01-14 15:13:29 PST ---
(In reply to comment #2)
> (From update of attachment 46611 [details])
> > -static DragOperation defaultOperationForDrag(DragOperation srcOpMask)
> > -{
> > -    // This is designed to match IE's operation fallback for the case where
> > -    // the page calls preventDefault() in a drag event but doesn't set dropEffect.
> > -    if (srcOpMask & DragOperationCopy)
> > -         return DragOperationCopy;
> > -    if (srcOpMask & DragOperationMove || srcOpMask & DragOperationGeneric)
> > -        return DragOperationMove;
> > -    if (srcOpMask & DragOperationLink)
> > -        return DragOperationLink;
> > -
> > -    // FIXME: Does IE really return "generic" even if no operations were allowed by the source?
> > -    return DragOperationGeneric;
> > -}
> > -
> >  bool DragController::tryDHTMLDrag(DragData* dragData, DragOperation& operation)
> >  {
> >      ASSERT(dragData);
> > @@ -517,10 +502,8 @@ bool DragController::tryDHTMLDrag(DragDa
> >          return false;
> >      }
> >  
> > -    if (!clipboard->destinationOperation(operation)) {
> > -        // The element accepted but they didn't pick an operation, so we pick one (to match IE).
> > -        operation = defaultOperationForDrag(srcOpMask);
> > -    } else if (!(srcOpMask & operation)) {
> > +    operation = clipboard->destinationOperation();
> > +    if (!(srcOpMask & operation)) {
> >          // The element picked an operation which is not supported by the source
> >          operation = DragOperationNone;
> >      }
> 
> Is it really OK to make this change? Will we break websites that call
> preventDefault() but don't set dropEffect?

That code will never be hit after r53287, because destinationOperation will
never return false. This makes it compliant with the spec, but I haven't found
any demos. I did have to make changes to some of our layout tests, that was why
I had to roll out the change and roll it back in. I feel like being more
compliant with the spec is important, but if there are a lot of websites that
use drag and drop, then I could drop this change, and make some changes to
r53287.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list