Folders nested incorrectly when importing bookmarks from Firefox

RESOLVED FIXED in Camino0.9

Status

RESOLVED FIXED
15 years ago
14 years ago

People

(Reporter: rhostik, Assigned: mikepinkerton)

Tracking

unspecified
Camino0.9
PowerPC
Mac OS X

Details

(Whiteboard: needs to land on trunk and branch)

Attachments

(2 attachments)

(Reporter)

Description

15 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8a) Gecko/20040512 Camino/0.7+
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8a) Gecko/20040512 Camino/0.7+

When I try to import my Firefox bookmarks, the folders are always nested
incorrectly. Some of these bookmarks are over 5 years old, dating back to IE4.
Looking at the file, I can see at least 3 different types of formatting style.

I will attach a file showing a cut down version of the bookmarks.html file. As a
clue to what's going wrong, if you hover your cursor of the "Proxies" folder in
"Show All Bookmarks" window, the helper dialog shows "/H3>" instead of "Proxies".

This is how the nesting is supposed to look:

Bookmarks Toolbar
Internet
  Proxies
  Blogs
Shopping
  dvd and video
  music
    Hard to Find
    Amazon UK
    Amazon US
    Walmart
  comparison
  Retro Rebels
Football

And this is how it turns out:

Bookmarks Toolbar
Internet
  Proxies
    Blogs
    Shopping
      dvd and video
        music
          Hard to Find
            Amazon UK
            Amazon US
            Walmart
          comparison
          Retro Rebels
        Football  

Reproducible: Always
Steps to Reproduce:
1.Camino -> Import Bookmarks
2.Use the attached bookmarks.html file
3.

Actual Results:  
Bookmarks were imported but folder nesting was incorrect.


OS 10.3.3
(Reporter)

Comment 1

15 years ago
Created attachment 148410 [details]
Bookmarks file to demonstrate bug.

Have added bookmarks file as attachment.
(Assignee)

Updated

15 years ago
Target Milestone: --- → Camino0.9

Comment 2

15 years ago
I can't reproduce this problem with Firefox 0.8 and a bunch of nested folders.
They always import correctly.

Comment 3

15 years ago
I was using a Camino build from 5/14/04.

Comment 4

15 years ago
Josh: are you using the attached bookmark file?

I can reproduce with this file. Just glancing at where things go wrong and
looking at the file, I'd guess that the completely empty <dd> tags are fouling
up the parser.
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Reporter)

Comment 5

15 years ago
Stuart, your diagnosis seems to be correct. I removed all the empty <DD> tags.
The attached file and my complete bookmarks file were then imported correctly.
Thanks.

Comment 6

15 years ago
Over to Stuart, since he seems to know the most about what is going on here.
Assignee: pinkerton → stuart.morgan

Updated

15 years ago
Status: NEW → ASSIGNED

Comment 7

15 years ago
Giving my bugs back to pink.
Assignee: stuart.morgan → pinkerton
Status: ASSIGNED → NEW

Comment 8

14 years ago
Created attachment 157351 [details] [diff] [review]
patch v1.0

Updated

14 years ago
Attachment #157351 - Flags: review?(me)

Comment 9

14 years ago
The problem is that NSScanner ignores whitespace and newlines by default.
Whoever wrote the import code must have just forgotten that. So the parser
attempts to scan from a blank <DD> tag up to the next tag, but it doesn't
actually scan past any whitespace. Thus when it assumes its grabbing a tag's
text (e.g. "<TD" or whatever) its actually grabbing whitespace. The good news is
the author seems to have assumed it didn't skip whitespace in all the rest of
the code, so just making that assumption true doesn't seem to break anything else.

Comment 10

14 years ago
Patch work as advertised. Bug is gone using the attached test bookmarks file.
Comment on attachment 157351 [details] [diff] [review]
patch v1.0

This fix makes sense and works as described.
Attachment #157351 - Flags: review?(me) → review+
Attachment #157351 - Flags: superreview?(pinkerton)
(Assignee)

Comment 12

14 years ago
Comment on attachment 157351 [details] [diff] [review]
patch v1.0

sr=pink
Attachment #157351 - Flags: superreview?(pinkerton)
Attachment #157351 - Flags: superreview+

Updated

14 years ago
Whiteboard: needs to land on trunk and branch
(Assignee)

Comment 13

14 years ago
landed on trunk and branch.
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
(Assignee)

Updated

14 years ago
Blocks: 261393
You need to log in before you can comment on or make changes to this bug.