Closed Bug 110512 Opened 24 years ago Closed 24 years ago

Always displays a blank page as ISO-8859-1 on startup

Categories

(Core :: Internationalization, defect, P1)

x86
All
defect

Tracking

()

VERIFIED FIXED
mozilla0.9.7

People

(Reporter: hansoodev, Assigned: tetsuroy)

References

Details

(Keywords: intl, topembed, Whiteboard: tETA-11/21)

Attachments

(1 file)

nsCOMPtr<nsIContentViewer> cv is always NULL in nsHTMLDocument::StartDocumentLoad()when a new browser window is open. As a result, nsCOMPtr<nsIMarkupDocumentViewer> muCV is NULL, also. It's bad b/c it prevents the new browser window from getting a right default characterset. nsAutoString charset; charset.AssignWithConversion("ISO-8859-1"); // fallback value in case webShell return error ... nsCOMPtr<nsIMarkupDocumentViewer> muCV; nsCOMPtr<nsIContentViewer> cv; docShell->GetContentViewer(getter_AddRefs(cv)); if (cv) { =================================> First time loading this is 0x00000000 muCV = do_QueryInterface(cv); ====> So as muCV b/c of cv !!! } else ... if(kCharsetFromUserDefault > charsetSource) { PRUnichar* defaultCharsetFromWebShell = NULL; if (muCV) { ===> fot the first time, No execution of this !! rv = muCV->GetDefaultCharacterSet(&defaultCharsetFromWebShell); if(NS_SUCCEEDED(rv)) { charset = defaultCharsetFromWebShell; Recycle(defaultCharsetFromWebShell); charsetSource = kCharsetFromUserDefault; } } } ... // ======> !!! So charset is always defaults to ("ISO-8859-1") rv = this->SetDocumentCharacterSet(charset);
This is necessary so that a new browser window gets a right default characterset with a fix made by Roy for 105113. Roy, would you be able to test this case in mozilla.exe too, which is not embedding case ? Thanks. /HK
Blocks: 105113
Keywords: edt0.9.4, intl, topembed
Priority: -- → P1
Target Milestone: --- → mozilla0.9.4
Status: UNCONFIRMED → NEW
Ever confirmed: true
Status: NEW → ASSIGNED
Target Milestone: mozilla0.9.4 → mozilla0.9.7
If we set a Pref in Moz, we can reproduce this problem. Goto Pref dlgbox, set navigator to display a blank page when start up. ( "Blank page" Radio button under "When Navigator starts up, display" ) The blank page is always ISO-8889-1 at the startup.
Summary: nsCOMPtr<nsIContentViewer> cv is always NULL in nsHTMLDocument::StartDocumentLoad() → Always displays a blank page as ISO-8859-1 on startup
ftang/jbetak: can you review the patch?
Comment on attachment 58158 [details] [diff] [review] Read fallback charset from Pref r=jbetak
Roy, the only thing that bugged me about this was the fact that we'll *always* spend a few cycles on this - whether we'll actually use the default or not. I looked into it and it seems like it might not be a good idea to change it now. I'd still mention the idea to you: perhaps the code could be changed to read the default at the end, only when it's needed. We would need to change error handling in a few places from "return(rv)" to something else to make sure we fetch the default. I'm not sure how big a win this would be - it would need some profiling - but probably not big, so it's probably not worth to bother. Just an idea - perhaps there will be a better time.
Comment on attachment 58158 [details] [diff] [review] Read fallback charset from Pref /r=jbetak
Attachment #58158 - Flags: review+
jbetak: thank for your input and you are right about the charset determination as a whole. As you can see in nsHTMLDocument::StartDocumentLoad() we have number of calls just to find out which charset we use for the document. - default - HTTP header - HTML Meta Tag - Forced/User Override - Auto-Detector - Cache - Inherit from Parent - Bookmark I believe I saw a bug to improve the charset detection code (not Auto-detect). I believe we should deal about this in later time. brendan: can your super review?
Whiteboard: tETA-11/21
Comment on attachment 58158 [details] [diff] [review] Read fallback charset from Pref Roy, can you record the bug number for that followup/future-improvement work? sr=brendan@mozilla.org. /be
Attachment #58158 - Flags: superreview+
*** Bug 111217 has been marked as a duplicate of this bug. ***
Checked into the trunk. Bug 111336 is filed to investigate for charset detection. teruko: please verify. thanks ---- However, leaving the bug open until we checkin to 0_9_4_BRANCH
ylong: can you verify this on the trunk? Teruko is on vacation.
Verified it on 11-26 trunk build(both windows and Mac): In preferences, when change the start up new window from home page to blank page, and change the default language charset to something other than iso-8859-1, the charset in new blank page window is followed the changed default charset. While 11-19 trunk build is always set to iso-8859-1 no matter how you change the default language setting. So I can see the check-in is working on 11-26 trunk build.
Permission to check in to branch
Keywords: edt0.9.4edt0.9.4+
checked into 0_9_4_BRANCH
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Verified as fixed in 2001-11-28-0.9.4ec Win32 build.
Status: RESOLVED → VERIFIED
adding fixed0.9.4 keyword
Keywords: fixed0.9.4
Keywords: verified0.9.4
Keywords: fixed0.9.4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: