user style sheets may not be imported from Safari

RESOLVED FIXED in Firefox 3 alpha1

Status

()

Firefox
Migration
RESOLVED FIXED
12 years ago
12 years ago

People

(Reporter: (not reading, please use seth@sspitzer.org instead), Assigned: (not reading, please use seth@sspitzer.org instead))

Tracking

Trunk
Firefox 3 alpha1
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(5 attachments)

user style sheets may not imported from Safari

the problem is an inititialized variable, which could also hork bug #344284

from my build:

/Users/sspitzer/Desktop/trunk/mozilla/browser/components/migration/src/nsSafariProfileMigrator.cpp:
In member function 'nsresult
nsSafariProfileMigrator::ParseBookmarksFolder(const __CFArray*,
nsIRDFResource*, nsIBookmarksService*, PRBool)':
/Users/sspitzer/Desktop/trunk/mozilla/browser/components/migration/src/nsSafariProfileMigrator.cpp:996:
warning: 'rv' may be used uninitialized in this function

if I initialize rv to anything other than NS_OK (a.k.a. 0, see http://lxr.mozilla.org/seamonkey/source/xpcom/base/nsError.h#159), then CopyBookmarks() will fail, and we will never call CopyFormData() or CopyOtherData(), and CopyOtherData() is what migrates the user style sheets.

elaborate steps to reproduce coming next!
elaborate steps to reproduce:

1) set up a userContent.css in safari (see attachment #1 [details] [diff] [review]).  put it in ~/Library/Safari/userContent.css (the one I attached will disable the blink tag)
2) verify that safari no longer blinks (see attachment #2 [details] [diff] [review] in safari)
3) make sure that firefox blinks (see attachment #2 [details] [diff] [review] in firefox)
4) import data from safari, including "other data" (see attachment #3 [details] [diff] [review])
5) restart Firefox and make sure that we imported userContent.css and make sure that firefox no longer blinks

when I forced import to fail, I got this on my console:

JavaScript error: , line 0: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIBrowserProfileMigrator.migrate]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: chrome://browser/content/migration/migration.js :: anonymous :: line 390"  data: no]

I initialized rv to NS_ERROR_FAILURE.  the fix is to initialize to NS_OK.

note, I am not certain what rv is going to be initialized too, so reproducing this (to verify the fix) may not be easy.
Status: NEW → ASSIGNED
Created attachment 246375 [details]
attachment #4 [details] [diff] [review] (setting up safari to use userContent.css)
Created attachment 246376 [details] [diff] [review]
patch to initialize rv (and fix another PLACES warning I created)

this has r=gavin over email
Attachment #246376 - Flags: review+
Summary: user style sheets may not imported from Safari → user style sheets may not be imported from Safari
Target Milestone: --- → Firefox 3 alpha1
fixed on the trunk.

Checking in nsOperaProfileMigrator.cpp;
/cvsroot/mozilla/browser/components/migration/src/nsOperaProfileMigrator.cpp,v  <--  nsOperaProfileMigrator.cpp
new revision: 1.58; previous revision: 1.57
done
Checking in nsSafariProfileMigrator.cpp;
/cvsroot/mozilla/browser/components/migration/src/nsSafariProfileMigrator.cpp,v  <--  nsSafariProfileMigrator.cpp
new revision: 1.33; previous revision: 1.32
done
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.