jj5@jj-dev:/var/export/jj-dev/mozilla/mozilla-unified$ hg diff diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -7955,6 +7955,21 @@ value: false mirror: always +- name: view_source.wrap_long_lines + type: bool + value: true + mirror: always + +- name: view_source.syntax_highlight + type: bool + value: true + mirror: always + +- name: view_source.tab_size + type: int32_t + value: 4 + mirror: always + #--------------------------------------------------------------------------- # Prefs starting with "webgl." (for pref access from Worker threads) #--------------------------------------------------------------------------- diff --git a/parser/html/nsHtml5ViewSourceUtils.cpp b/parser/html/nsHtml5ViewSourceUtils.cpp --- a/parser/html/nsHtml5ViewSourceUtils.cpp +++ b/parser/html/nsHtml5ViewSourceUtils.cpp @@ -6,6 +6,7 @@ #include "mozilla/Preferences.h" #include "nsHtml5AttributeName.h" #include "nsHtml5String.h" +#include "mozilla/StaticPrefs_view_source.h" // static nsHtml5HtmlAttributes* nsHtml5ViewSourceUtils::NewBodyAttributes() { @@ -14,10 +15,10 @@ nsHtml5HtmlAttributes* nsHtml5ViewSource bodyAttrs->addAttribute(nsHtml5AttributeName::ATTR_ID, id, -1); nsString klass; - if (mozilla::Preferences::GetBool("view_source.wrap_long_lines", true)) { + if (StaticPrefs::view_source_wrap_long_lines()) { klass.AppendLiteral(u"wrap "); } - if (mozilla::Preferences::GetBool("view_source.syntax_highlight", true)) { + if (StaticPrefs::view_source_syntax_highlight()) { klass.AppendLiteral(u"highlight"); } if (!klass.IsEmpty()) { @@ -25,7 +26,7 @@ nsHtml5HtmlAttributes* nsHtml5ViewSource nsHtml5String::FromString(klass), -1); } - int32_t tabSize = mozilla::Preferences::GetInt("view_source.tab_size", 4); + int32_t tabSize = StaticPrefs::view_source_tab_size(); if (tabSize > 0) { nsString style; style.AssignLiteral("-moz-tab-size: ");