Closed Bug 506081 Opened 15 years ago Closed 15 years ago

dataTransfer.setData makes scrollbars draggable off of themselves on dragstart events

Categories

(Core :: DOM: Events, defect)

defect
Not set
major

Tracking

()

RESOLVED FIXED
Tracking Status
blocking1.9.1 --- -
status1.9.1 --- wanted

People

(Reporter: sephr, Assigned: smaug)

References

Details

(Keywords: regression)

Attachments

(4 files)

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US-Hixie; rv:1.9.1.2pre) Gecko/20090723 Shiretoko/3.5.2pre
Build Identifier: Mozilla/5.0 (X11; U; Linux x86_64; en-US-Hixie; rv:1.9.1.2pre) Gecko/20090723 Shiretoko/3.5.2pre

Scrollbars (and every part of their UI) become draggable akin the effect seen in bug 24024 when dataTransfer.setData is used in a dragstart event that was fired on a scrollbar.

This bug affects any website that uses the CiteDrag JavaScript library ( http://github.com/eligrey/CiteDrag/tree/master ), which includes my blog.

Reproducible: Always

Steps to Reproduce:
1. document.addEventListener("dragstart", function(e) {e.dataTransfer.setData("text/vnd.initech.foobar","")}, false)
2. Drag a part of a scrollbar UI
Actual Results:  
Scrollbar UI part is dragged off itself (copied, not removed).

Expected Results:  
Scrollbar UI part functions normally.


Side-question: Are scrollbars part of the DOM?
Attached file Testcase
Component: General → DOM: Events
Version: unspecified → Trunk
I copied and pasted the wrong bug ID. When I said bug 24024 I meant bug 324024.
Olli, would it be ok if I added a PreventDefault in nsSliderFrame::MouseDown, or would that break something?
Assignee: nobody → highmind63
Status: UNCONFIRMED → NEW
Ever confirmed: true
(In reply to comment #3)
> Olli, would it be ok if I added a PreventDefault in nsSliderFrame::MouseDown,
> or would that break something?
Why would you want to do that?
Dragging non-native-anonymous scrollbars should be probably possible.
So perhaps better would be to prevent default handling for native anonymous
scroll bars. So add something to nsXULElement::PreHandleEvent.
Hopefully preventing and cancelling dragstart should be enough.

FYI, I can't always reproduce the problem.
(In reply to comment #4)
> Hopefully preventing and cancelling dragstart should be enough.
Or something like that. I'm not quite sure what this bug is about, because
I can't really reproduce it easily (Linux/OSX)
Ok, now I can reproduce
Attached patch wipSplinter Review
We probably don't want to stop the propagation of all drag events, but
anyway this seems to fix this bug.
Attached patch patchSplinter Review
Enn, what do you think about this.
This way if dragging starts in a native anon scroll bar, and nothing is set to be
drag data, we don't really start drag process since InvokeDragSessionXXX doesn't
get called.
Assignee: highmind63 → Olli.Pettay
Attachment #390465 - Flags: review?(enndeakin)
Attachment #390465 - Flags: review?(enndeakin) → review+
Attachment #390465 - Flags: superreview?(neil)
Comment on attachment 390465 [details] [diff] [review]
patch

>+         aVisitor.mEvent->message == NS_CONTEXTMENU ||
>+         aVisitor.mEvent->message == NS_CONTEXTMENU ||
You're just double-checking that we don't open context menus on scrollbars, right? ;-)
Attachment #390465 - Flags: superreview?(neil) → superreview+
Uh, how did I do that o_O
Attached patch patchSplinter Review
http://hg.mozilla.org/mozilla-central/rev/682ac215c2e2
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Olli: do you think this can (and should) go into 1.9.1.x?
blocking1.9.1: --- → ?
status1.9.1: --- → ?
Regression from 1.9.0.
Keywords: regression
What bug regressed this?
Regression range:
2008-08-27 works
2008-08-28 broken
Pushlog: http://hg.mozilla.org/mozilla-central/pushloghtml?startdate=2008-08-27&enddate=2008-08-28
->Bug 356295 probably. The other drag crash bug was fixed on 1.9.0 and it still doesn't exhibit this bugs behavior.
Blocks: 356295
Olli: Is this worth fixing on 1.9.1? I don't think it blocks anyway, but if you think we should take it, please give it an approval1.9.1.4 request.
blocking1.9.1: ? → -
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: