style: Use static_prefs::pref!.

It's much nicer.

One nice thing about this is that the new code is subject to the existing
threadedness checking, which identified that several of these should be atomic
because they're accessed off the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D40792
This commit is contained in:
Nicholas Nethercote 2019-08-07 22:58:55 +00:00 committed by Emilio Cobos Álvarez
parent ad1d028e40
commit bb032c1ddc
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A
17 changed files with 26 additions and 60 deletions

View file

@ -673,7 +673,7 @@ impl<'a, 'b: 'a> Cascade<'a, 'b> {
#[inline]
#[cfg(feature = "gecko")]
fn recompute_default_font_family_type_if_needed(&mut self) {
use crate::gecko_bindings::{bindings, structs};
use crate::gecko_bindings::bindings;
use crate::values::computed::font::GenericFontFamily;
if !self.seen.contains(LonghandId::XLang) &&
@ -681,7 +681,7 @@ impl<'a, 'b: 'a> Cascade<'a, 'b> {
return;
}
let use_document_fonts = unsafe { structs::StaticPrefs::sVarCache_browser_display_use_document_fonts != 0 };
let use_document_fonts = static_prefs::pref!("browser.display.use_document_fonts") != 0;
let builder = &mut self.context.builder;
let (default_font_type, prioritize_user_fonts) = {
let font = builder.get_font().gecko();