The default bug view has changed. See this FAQ.

Remove browser dependency on nsDragAndDrop.js

RESOLVED FIXED

Status

()

Firefox
General
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: mak, Assigned: Neil Deakin)

Tracking

(Depends on: 2 bugs, Blocks: 1 bug)

Trunk
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [Ts])

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

7 years ago
We can get rid of this inclusion thanks to the new d&d API, i'll make this depend on single bugs about getting rid of the dependencies we have.

Currently:
- Places
- search.xml
- browser and tabbrowser files

the only things we can't replace atm are nsDragAndDrop.dragDropSecurityCheck and transferUtils.
The former ideally should be done automatically by the D&D API since it seems sensible, otherwise we could move it to an util file.
The latter is an util with just one method, can easily be moved, maybe to contentAreaUtils?
(Reporter)

Updated

7 years ago
Depends on: 545121
(Reporter)

Updated

7 years ago
Depends on: 545122
(Reporter)

Comment 1

7 years ago
other things inside nsDragAndDrop:
- nsTransferable is a wrapper for nsITransferable, used in nsClipboard.js
- FlavourSet is used only in Places, will get rid of it
- transferUtils is used in search.xml and tabbrowser.xml
(Reporter)

Updated

7 years ago
Depends on: 545125
(Reporter)

Comment 2

7 years ago
Places part is done (apart bug 545121), remaining work is waiting for bug 545714 that should make easier to implement bug 545125.
(Reporter)

Comment 3

7 years ago
http://mxr.mozilla.org/mozilla-central/search?string=nsDragAndDrop
http://mxr.mozilla.org/mozilla-central/search?string=transferUtils
http://mxr.mozilla.org/mozilla-central/search?string=nsTransferable&find=.js
http://mxr.mozilla.org/mozilla-central/search?string=FlavourSet
Blocks: 447581
(Assignee)

Comment 4

7 years ago
Created attachment 443390 [details] [diff] [review]
removes the last vestiges of nsDragAndDrop.js
Assignee: nobody → enndeakin
Status: NEW → ASSIGNED
Attachment #443390 - Flags: review?(gavin.sharp)
Comment on attachment 443390 [details] [diff] [review]
removes the last vestiges of nsDragAndDrop.js

>diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml

Can you expose canDropLink on browserDragAndDrop and use it in _setEffectAllowedForDataTransfer, and then get rid of _supportedLinkDropTypes entirely?

>diff --git a/browser/base/content/test/browser_drag.js b/browser/base/content/test/browser_drag.js

>+  tab1.control.selectedItem = tab1;

gBrowser.selectedTab = tab1 would be clearer, no?
Attachment #443390 - Flags: review?(gavin.sharp) → review+
(Assignee)

Comment 6

7 years ago
Created attachment 445366 [details] [diff] [review]
removes the last vestiges of nsDragAndDrop.js version 2

Like so?
Attachment #443390 - Attachment is obsolete: true
Attachment #445366 - Flags: review?(gavin.sharp)
Comment on attachment 445366 [details] [diff] [review]
removes the last vestiges of nsDragAndDrop.js version 2

>diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml

>+          if (!dt.types.contains("text/x-moz-text-internal") &&

Is there any harm in allowing this one? It is handled by drop(), right?
Attachment #445366 - Flags: review?(gavin.sharp) → review+
(Assignee)

Comment 8

7 years ago
Created attachment 447527 [details] [diff] [review]
address comment
Attachment #445366 - Attachment is obsolete: true
(Assignee)

Comment 9

7 years ago
http://hg.mozilla.org/mozilla-central/rev/13b292f9ab79
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.