Closed
Bug 418592
Opened 17 years ago
Closed 17 years ago
"Bookmarks Menu" folder can be dropped into itself
Categories
(Firefox :: Bookmarks & History, defect, P2)
Firefox
Bookmarks & History
Tracking
()
VERIFIED
FIXED
Firefox 3
People
(Reporter: dao, Assigned: dev)
References
Details
Attachments
(1 file, 6 obsolete files)
(deleted),
patch
|
Details | Diff | Splinter Review |
STR:
1. Open the Library
2. Click "All Bookmarks" in the left tree.
3. Drag the "Bookmarks Menu" folder in the content tree and drop it into itself or into "Bookmarks Menu" in the left tree.
Expected:
Dropping is not permitted.
Actual results:
The folder disappears from "All Bookmarks" on the left side. It's still shown on the right side, temporarily. While it's there, you can still drag it back to "All Bookmarks". Otherwise "Bookmarks Menu" also appears in the Bookmarks menu, from where you can drag it.
Flags: blocking-firefox3?
Comment 1•17 years ago
|
||
Blocking for another potential to hoark one's Places database ...
Priority: -- → P2
Updated•17 years ago
|
Flags: blocking-firefox3? → blocking-firefox3+
Comment 2•17 years ago
|
||
mconnor told a terrific story about how the Mac menu indexer followed this to infinity and beyond.
OS: Windows XP → Windows 95
Hardware: PC → All
Updated•17 years ago
|
OS: Windows 95 → All
Assignee | ||
Comment 3•17 years ago
|
||
Assignee | ||
Updated•17 years ago
|
Attachment #306020 -
Flags: review?(mano)
Assignee | ||
Comment 4•17 years ago
|
||
Postponing review until resolution of bug 384370, due to changes in the wrapNode function.
Updated•17 years ago
|
Target Milestone: --- → Firefox 3
Assignee | ||
Comment 5•17 years ago
|
||
On top of not allowing a folder to be dropped on it self, the patch will also disable the option of dropping a folder on any of its descendants.
Attachment #306020 -
Attachment is obsolete: true
Attachment #309442 -
Flags: review?(mano)
Comment 6•17 years ago
|
||
Comment on attachment 309442 [details] [diff] [review]
v2
>+ // Get the information of the dragged item
>+ var xferable = this._initTransferable(session);
>+ session.getData(xferable, 0);
>+ var data = { }, flavor = { };
>+ xferable.getAnyTransferData(flavor, data, { });
>+ data.value.QueryInterface(Ci.nsISupportsString);
>+ var dragged = PlacesUtils.unwrapNodes(data.value.data, flavor.value)[0];
Each dragged node should be checked (and then you should disallow dropping if _any_ of the items cannot be dropped).
>+ // The following loop disallows the dropping of a folder on itself or
>+ // on any of its descendants
>+ if (dragged.type == PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER ||
>+ /^place/.test(dragged.uri)) {
nit: "^place:".
Attachment #309442 -
Flags: review?(mano) → review-
Assignee | ||
Comment 7•17 years ago
|
||
Attachment #309442 -
Attachment is obsolete: true
Attachment #309457 -
Flags: review?(mano)
Comment 8•17 years ago
|
||
Comment on attachment 309457 [details] [diff] [review]
v2.1
>Index: browser/components/places/content/controller.js
>===================================================================
>- canDrop: function PCDH_canDrop() {
>+ canDrop: function PCDH_canDrop(ip) {
> var session = this.getSession();
>- if (session) {
>- var types = PlacesUIUtils.GENERIC_VIEW_DROP_TYPES;
>- for (var i = 0; i < types.length; ++i) {
>- if (session.isDataFlavorSupported(types[i]))
>- return true;
>+ var xferable = this._initTransferable(session);
>+ var dropCount = session.numDropItems;
>+ if (!session)
>+ return false;
>+
The order here is wrong, numDropItems should be used only once |session| is known to be non null.
r=mano otherwise.
Attachment #309457 -
Flags: review?(mano) → review+
Assignee | ||
Comment 9•17 years ago
|
||
Attachment #309457 -
Attachment is obsolete: true
Comment 10•17 years ago
|
||
> + for (var i = 0; i < types.length; ++i) {
I'm changing this to for(i =0 ... on checkin, |i| is declared in the first loop within this function.
Comment 11•17 years ago
|
||
Also, do the type-check first.
Attachment #309460 -
Attachment is obsolete: true
Updated•17 years ago
|
Attachment #309489 -
Attachment is patch: true
Attachment #309489 -
Attachment mime type: application/octet-stream → text/plain
Comment 13•17 years ago
|
||
I forgot to change the last return statement.
Attachment #309489 -
Attachment is obsolete: true
Comment 14•17 years ago
|
||
mozilla/browser/base/content/browser-places.js 1.119
mozilla/browser/components/places/content/controller.js 1.222
mozilla/browser/components/places/content/menu.xml 1.122
mozilla/browser/components/places/content/toolbar.xml 1.145
mozilla/browser/components/places/content/treeView.js 1.59
mozilla/toolkit/components/places/src/utils.js 1.4
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Comment 15•17 years ago
|
||
verified with: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9b5pre) Gecko/2008031704 Minefield/3.0b5pre and Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b5pre) Gecko/2008031704 Minefield/3.0b5pre
Windows displays the circle / symbol. Mac provides no discouraging feedback btu doesn't permit the drop.
Status: RESOLVED → VERIFIED
Flags: in-litmus?
Updated•16 years ago
|
Flags: in-litmus? → in-litmus+
Comment 16•16 years ago
|
||
Test case 5947 has been updated to take this bug into account.
Comment 17•15 years ago
|
||
Bug 451915 - move Firefox/Places bugs to Firefox/Bookmarks and History. Remove all bugspam from this move by filtering for the string "places-to-b-and-h".
In Thunderbird 3.0b, you do that as follows:
Tools | Message Filters
Make sure the correct account is selected. Click "New"
Conditions: Body contains places-to-b-and-h
Change the action to "Delete Message".
Select "Manually Run" from the dropdown at the top.
Click OK.
Select the filter in the list, make sure "Inbox" is selected at the bottom, and click "Run Now". This should delete all the bugspam. You can then delete the filter.
Gerv
Component: Places → Bookmarks & History
QA Contact: places → bookmarks
You need to log in
before you can comment on or make changes to this bug.
Description
•