Closed Bug 44011 Opened 26 years ago Closed 26 years ago

the bookmark charset does not work correctly if we select sidebar first

Categories

(Core :: Internationalization, defect, P2)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: ftang, Assigned: shanjian)

Details

(Whiteboard: nsbeta3+, fix checked in)

Attachments

(1 file)

somehow the bookmark charset updating code does not get the correct charset, instead it always get UTF-8, if we select something in the sidebar first and then select the bookmark from the menu.
mark it as assign
Status: NEW → ASSIGNED
Keywords: nsbeta3
Priority: P3 → P2
Whiteboard: nsbeta3+
nsbeta3+ per bug meeting. Mark it as P2
This is related to the focus window. If we select the bookmark from the sidebar, then the focused window are set to the sidebar, and the document of the focus window is the bookmark listing instead of the newly loaded document. Reassign this to shanjian shanjian, could you please take a look at this ? The code which cause this bug is in xpfe/browser/resources/content/navigator.js The following function have problem- 142 function UpdateBookmarksLastVisitedDate(event) 143 { 144 if ((window._content.location.href) && (window._content.location.href != "")) 145 { 146 try 147 { 148 149 var wnd = document.commandDispatcher.focusedWindow; 150 if (window == wnd) wnd = window._content; 151 var docCharset = wnd.document.characterSet; 152 153 // if the URL is bookmarked, update its "Last Visited" date 154 var bmks = Components.classes["component://netscape/browser/bookmarks-service"].getService( ); 155 if (bmks) bmks = bmks.QueryInterface(Components.interfaces.nsIBookmarksService); 156 if (bmks) bmks.UpdateBookmarkLastVisitedDate(window._content.location.href, docCharset); 157 } 158 catch(ex) 159 { 160 dump("failed to update bookmark last visited date.\n"); 161 } 162 } 163 } put a dump(docCharset + "\n"); in line 152 and you will see we get UTF-8 when we select it from the sidebar boomark listing and the *correct* charet if we select from bookmark menu.
Assignee: ftang → shanjian
Status: ASSIGNED → NEW
shanjian have difficult to reporduce this. I need to retest this. Leave it as P2.
to reproduce 1. launch Netscape6 2. visit http://www.yahoo.co.jp 3. change your encidng to Japanse (EUC-JP) 4. add it to bookmark 5. go to other pages 6. change your encoding to others (say ISO-8859-1) 7. Select that yahoo page from the sidebar (not from boomark menu) 8. you should see it display correctly 9. go to other pages 10. select the yahoo page (from sidebar or bookmark) 11. you see the yahoo page display incorrectly If you do step 7 by using bookmark menu then step 11 will be correct. What happen is in step 8, we change the in-memory charset value in the bookmark data source to UTF-8 because the focused window is the sidebar bookmark tree. and the document of the sidebar bookmark tree is UTF-8. If you select it from the bookmark menu, then the focused window is the content area and the document charset is the one we load, which is EUC-JP.
Attached patch proposed fixSplinter Review
r=ftang. Check it in.
Whiteboard: nsbeta3+ → nsbeta3+, fix in hand and reviewed. Wait till tree open
Status: NEW → ASSIGNED
fix checked in
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Whiteboard: nsbeta3+, fix in hand and reviewed. Wait till tree open → nsbeta3+, fix checked in
I verified this in 2000-09-06-08 Win32 and Linux, and 2000-09-07-04 Mac build.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: