Closed Bug 977950 Opened 11 years ago Closed 11 years ago

Dragging text no longer works after Bug 923054

Categories

(Core :: DOM: Core & HTML, defect)

30 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla30
Tracking Status
firefox30 - ---

People

(Reporter: streetwolf52, Assigned: bzbarsky)

References

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0 (Beta/Release)
Build ID: 20140227163648

Steps to reproduce:

1. Install Super Drag 0.10 at https://addons.mozilla.org/en-US/firefox/addon/super-drag/?src=ss

2. Select some text and drag it.  Look below for what SD does.  


Actual results:

Dragging selected text does nothing.


Expected results:

Super Drag extends the feature of drag & drop. For example, you can drag a link to open it in a new background, foreground and current tab. You can also drag text to search, by using the default search engine, or select what you want. And for image, you can drag it to view in a background tab, foreground tab, or save it to the default download location.

Super Drag supports links, text and images.

    links - open it in background tab, foreground tab or current tab.
    text - search it in background tab, foreground tab or current tab.
    images - open it in background tab, foreground tab or save it.
Component: Untriaged → DOM
Keywords: regression
Product: Firefox → Core
Blocks: 923054
Thank you.  Looking.
Assignee: nobody → bzbarsky
ACtually, drag of text is just generally broken.  This is because the old logic in nsEventStateManager::DoDefaultDragStart allowed dragTarget to be a textnode (which could only happen when aDragTarget was a textnode) but the new logic requires it to be an element.
There are three changes here:

1) Fix a refcounting bug that snuck in in bug 923054.
2) Remove what I think is an incorrect null-check from bug 923054.
   Unless we really do want to force a non-null datatransfer there?  The
   XPCOM code doesn't seem to.
3) Fix this bug by allowing a non-element dragTarget.
Attachment #8383460 - Flags: review?(bugs)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Add-On 'Super Drag 0.10' no longer works after Bug 923054 → Dragging text no longer works after Bug 923054
Whiteboard: [need review]
Comment on attachment 8383460 [details] [diff] [review]
Fix dragging of text to work again.


> NS_IMETHODIMP
> DataTransfer::GetFiles(nsIDOMFileList** aFileList)
> {
>   ErrorResult rv;
>-  *aFileList = GetFiles(rv);
>+  NS_IF_ADDREF(*aFileList = GetFiles(rv));
>   return rv.ErrorCode();
> }
> 
yikes
Attachment #8383460 - Flags: review?(bugs) → review+
Blocks: 978069
https://hg.mozilla.org/integration/mozilla-inbound/rev/b87877dfeb49
Flags: in-testsuite?
OS: Windows 8.1 → All
Hardware: x86_64 → All
Whiteboard: [need review]
Patch appears to be working fine.
https://hg.mozilla.org/mozilla-central/rev/b87877dfeb49
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: