Closed
Bug 612205
Opened 15 years ago
Closed 14 years ago
Camino does not handle .fileloc files consistently
Categories
(Camino Graveyard :: Drag & Drop, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: lthompson.22, Assigned: alqahira)
Details
Attachments
(3 files)
|
4.42 KB,
patch
|
moz
:
review+
stuart.morgan+bugzilla
:
superreview+
|
Details | Diff | Splinter Review |
|
893 bytes,
application/zip
|
Details | |
|
1.68 KB,
application/zip
|
Details |
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en; rv:1.9.2.13pre) Gecko/20101114 Camino/2.1a1pre (like Firefox/3.6.13pre)
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en; rv:1.9.2.13pre) Gecko/20101114 Camino/2.1a1pre (like Firefox/3.6.13pre)
This is a discrepancy I noticed while writing an applescript.
AR: Dragging a .fileloc file into the browser window content area or onto Camino's dock icon will open the referenced file. But dragging a .fileloc onto the tab bar (existing tab or blank area) opens the .fileloc itself (as XML).
ER: I would expect to get the same results whether the file (any file, for that matter) is dropped on the content area or the tab bar.
The above is also true of .inetloc files (except drops of those aren't accepted by the Dock icon), but I don't know enough about .inetloc files to even guess or what the real-world cases are outside of applescript-generated ones (whereas .fileloc's can come from drags out of Safari).
Same AR 1.6.11 to today's 2.1a1pre, tested only in 10.6.
Reproducible: Always
| Assignee | ||
Comment 1•15 years ago
|
||
On 10.5, the fileloc is downloaded instead. I'm not sure why it works some places and not others, given that we don't ever look for fileloc files ourselves, but conceivably drags to the tab bar somehow avoid hitting either NSPasteboard+Utils or NSURL+Utils code where we handle the other *loc types.
Status: UNCONFIRMED → NEW
Ever confirmed: true
| Reporter | ||
Comment 2•15 years ago
|
||
Upon further testing (10.6), it seems that .fileloc's that come from (drags out of) Safari are indeed downloaded when dropped on the tab bar. I was testing mostly .fileloc's generated via applescript, and those get loaded as XML as I described. Moreover, .fileloc's that come from Safari also get downloaded when dropped on Camino's Dock icon, whereas those generated by applescript open the referenced file when dropped on the Dock icon, same as when dropped on the content area. (Sorry for the confusion, it never occurred to me there'd be a difference.)
Could this be because the applescript-generated .fileloc's are assigned a file type of 'ilfi' and creator code 'MACS', whereas Safari-generated .fileloc's are not assigned any type or creator codes?
| Assignee | ||
Comment 3•15 years ago
|
||
(In reply to comment #2)
> Could this be because the applescript-generated .fileloc's are assigned a file
> type of 'ilfi' and creator code 'MACS', whereas Safari-generated .fileloc's are
> not assigned any type or creator codes?
It could be because the ones from Safari are binary plists, and we'd have to have something decode them to even parse them (vs. XML plists, which Gecko will treat as text and parse as XML).
So far all I've found here is that we register for the drag types we accept on the tabs and the bar:
http://mxr.mozilla.org/camino/source/camino/src/browser/TabButtonView.mm#129
http://mxr.mozilla.org/camino/source/camino/src/browser/BrowserTabBarView.mm#126
I really don't know how that works, and if we can make them go through our file-decoding code or not.
| Assignee | ||
Comment 4•14 years ago
|
||
(In reply to comment #3)
> So far all I've found here is that we register for the drag types we accept on
> the tabs and the bar:
> http://mxr.mozilla.org/camino/source/camino/src/browser/TabButtonView.mm#129
> http://mxr.mozilla.org/camino/source/camino/src/browser/BrowserTabBarView.mm#126
>
> I really don't know how that works, and if we can make them go through our
> file-decoding code or not.
What I'd really like to know is where we register for the drag types we accept on the content view.
However, I noticed that when I drag a .fileloc (of completely unknown provenance) to the location bar, I get the URL from the .fileloc inserted into the bar. AutoCompleteTextField also registers for kCorePasteboardFlavorType_url here:
http://mxr.mozilla.org/camino/source/camino/src/browser/AutoCompleteTextField.mm#328
and those two do not controls do not. The fix may be as simple as that. Someone implement !clone and I'll have my !clone get right on it :P
| Assignee | ||
Comment 5•14 years ago
|
||
(In reply to comment #4)
> The fix may be as simple as that.
Nope, that doesn't fix it.
The problem turned out to be that NSPasteboard+Utils's |getURLs:andTitles:| didn't consider filelocs as things that needed to be decoded when it called |URLFromInetloc:| on other *loc files, so I fixed that. I then added complete support for filelocs in NSURL+Utils's |decodeLocalFileURL:| (for parity's sake), and, finally, just to tidy things up everywhere, I enabled filelocs in the Open panel.
I'm still not sure how the content-area drops work/worked before. The Dock icon/app icon drags, though, work/worked because the Dock/Finder apparently gave us a file:// URL to begin with (and we called |decodeLocalFileURL:| in MainController's |application:openFile:| on it, but that's mostly irrelevant since we had a URL to begin with):
> Camino[5828]: Decoding local file “file://localhost/Users/smokey/WWW%20Page/index.html”, pathString “/Users/smokey/WWW Page/index.html”
Lisa, just for the sake of completeness, can you zip one of your AppleScript-created filelocs (make it point to somewhere that would work independent of user, e.g. /Library/Preferences/com.apple.headerdoc.exampletocteplate.html). This patch should fix everything, but I'd like to be able to test against one of those just to be sure.
Wevah, can you give this a look-over?
| Reporter | ||
Comment 6•14 years ago
|
||
10.6 Applescript-created .fileloc pointing to the prefs file Smokey suggested.
| Assignee | ||
Comment 7•14 years ago
|
||
Thanks, Lisa! My fix does indeed handle that one correctly, too.
Just for reference, so we'll have the full set archived in this bug, here are filelocs for that same file generated by Camino and Safari.
Comment 8•14 years ago
|
||
Comment on attachment 511925 [details] [diff] [review]
Fix
Looks good to me; r+
Attachment #511925 -
Flags: review?(moz) → review+
| Assignee | ||
Updated•14 years ago
|
Attachment #511925 -
Flags: superreview?(stuart.morgan+bugzilla)
Comment 9•14 years ago
|
||
Comment on attachment 511925 [details] [diff] [review]
Fix
sr=smorgan
Attachment #511925 -
Flags: superreview?(stuart.morgan+bugzilla) → superreview+
| Assignee | ||
Comment 10•14 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•