diff --git a/mozilla/content/html/document/src/nsHTMLContentSink.cpp b/mozilla/content/html/document/src/nsHTMLContentSink.cpp index 8147b8a7cdf..37fe48fa95d 100644 --- a/mozilla/content/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/content/html/document/src/nsHTMLContentSink.cpp @@ -2352,24 +2352,25 @@ HTMLContentSink::Init(nsIDocument* aDoc, mWebShell = aContainer; NS_ADDREF(aContainer); - nsCOMPtr docShell(do_QueryInterface(mWebShell)); - NS_ASSERTION(docShell,"oops no docshell!"); - if (docShell) { - PRBool enabled; - - docShell->GetAllowJavascript(&enabled); + PRBool enabled = PR_TRUE; + nsCOMPtr prefs(do_GetService(NS_PREF_CONTRACTID)); + NS_ASSERTION(prefs, "oops no prefs!"); + if (prefs) { + prefs->GetBoolPref("javascript.enabled", &enabled); if (enabled) { mFlags |= NS_SINK_FLAG_SCRIPT_ENABLED; } - + } + + nsCOMPtr docShell(do_QueryInterface(mWebShell)); + NS_ASSERTION(docShell,"oops no docshell!"); + if (docShell) { docShell->GetAllowSubframes(&enabled); if (enabled) { mFlags |= NS_SINK_FLAG_FRAMES_ENABLED; } } - NS_WITH_SERVICE(nsIPref, prefs, kPrefServiceCID, &rv); - if (NS_FAILED(rv)) { MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::Init()\n")); MOZ_TIMER_STOP(mWatch); @@ -2377,10 +2378,14 @@ HTMLContentSink::Init(nsIDocument* aDoc, } mNotifyOnTimer = PR_TRUE; - prefs->GetBoolPref("content.notify.ontimer", &mNotifyOnTimer); + if (prefs) { + prefs->GetBoolPref("content.notify.ontimer", &mNotifyOnTimer); + } mBackoffCount = -1; // never - prefs->GetIntPref("content.notify.backoffcount", &mBackoffCount); + if (prefs) { + prefs->GetIntPref("content.notify.backoffcount", &mBackoffCount); + } // The mNotificationInterval has a dramatic effect on how long it // takes to initially display content for slow connections. @@ -2390,10 +2395,14 @@ HTMLContentSink::Init(nsIDocument* aDoc, // it starts to impact page load performance. // see bugzilla bug 72138 for more info. mNotificationInterval = 250000; - prefs->GetIntPref("content.notify.interval", &mNotificationInterval); + if (prefs) { + prefs->GetIntPref("content.notify.interval", &mNotificationInterval); + } mMaxTextRun = 8192; - prefs->GetIntPref("content.maxtextrun", &mMaxTextRun); + if (prefs) { + prefs->GetIntPref("content.maxtextrun", &mMaxTextRun); + } nsIHTMLContentContainer* htmlContainer = nsnull; if (NS_SUCCEEDED(aDoc->QueryInterface(NS_GET_IID(nsIHTMLContentContainer), (void**)&htmlContainer))) { diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index db160d76b0a..02933aa004c 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -1706,7 +1706,6 @@ NS_IMETHODIMP nsDocShell::Create() // so read it in once here and be done with it... mPrefs->GetBoolPref("network.protocols.useSystemDefaults", &mUseExternalProtocolHandler); mPrefs->GetBoolPref("browser.target_new_blocked", &mDisallowPopupWindows); - mPrefs->GetBoolPref("javascript.enabled", &mAllowJavascript); mPrefs->GetBoolPref("browser.frames.enabled", &mAllowSubframes); return NS_OK;