From 99b1207e57f31c2f642219c2f2bce855d7bca20b Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Wed, 16 Aug 2006 00:18:14 +0000 Subject: [PATCH] Changed set_browser_preferences to use the "user" branch rather than the "default" branch, where changes are mostly ignored. Overrode preference style rules on Mozilla 1.8 by increasing priority of our agent stylesheet and setting browser.underline_anchors=false. --- style_sheets.cpp | 2 +- videolink.cpp | 26 +++++++++++++++----------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/style_sheets.cpp b/style_sheets.cpp index 4b00ce4..9c59982 100644 --- a/style_sheets.cpp +++ b/style_sheets.cpp @@ -42,7 +42,7 @@ void apply_style_sheet(nsIStyleSheet * style_sheet, nsIPresShell * pres_shell) { nsCOMArray style_sheets; check(pres_shell->GetAgentStyleSheets(style_sheets)); - check(style_sheets.InsertObjectAt(style_sheet, 0)); + check(style_sheets.AppendObject(style_sheet)); check(pres_shell->SetAgentStyleSheets(style_sheets)); // FIXME: We need to find an alternative that works in Mozilla 1.8. diff --git a/videolink.cpp b/videolink.cpp index f26bd5d..59956c7 100644 --- a/videolink.cpp +++ b/videolink.cpp @@ -864,17 +864,22 @@ namespace check(CallGetService(pref_service_cid, getter_AddRefs(pref_service))); nsCOMPtr pref_branch; + check(pref_service->GetBranch("", getter_AddRefs(pref_branch))); - // Disable IE-compatibility kluge that causes backgrounds to - // sometimes/usually be missing from snapshots. This is only - // effective from Mozilla 1.8 onward. # if MOZ_VERSION_MAJOR > 1 \ || (MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR >= 8) - check(pref_service->GetDefaultBranch("layout", - getter_AddRefs(pref_branch))); - check(pref_branch->SetBoolPref( - "fire_onload_after_image_background_loads", - true)); + // Disable IE-compatibility kluge that causes backgrounds to + // sometimes/usually be missing from snapshots. This is only + // effective from Mozilla 1.8 onward. + check(pref_branch->SetBoolPref( + "layout.fire_onload_after_image_background_loads", + true)); + + // Turn off link underlining. This is also set in the agent + // stylesheet, but seems to be overridden by preferences in + // Mozilla 1.8. + check(pref_branch->SetBoolPref("browser.underline_anchors", + false)); # endif // Set display resolution. With standard-definition video we @@ -885,9 +890,8 @@ namespace // slightly different but unfortunately Mozilla doesn't // support non-square pixels (and neither do fontconfig or Xft // anyway). - check(pref_service->GetDefaultBranch("browser.display", - getter_AddRefs(pref_branch))); - check(pref_branch->SetIntPref("screen_resolution", 40)); + check(pref_branch->SetIntPref("browser.display.screen_resolution", + 40)); } } // namespace -- 2.39.5