Refactor util::prefs operations to be methods on static struct.

This commit is contained in:
Corey Farwell 2016-07-02 13:51:17 -04:00
parent 307844a8c1
commit 22928f50ac
30 changed files with 166 additions and 162 deletions

View file

@ -29,7 +29,7 @@ use std::default::Default;
use string_cache::Atom;
use style::attr::AttrValue;
use url::Url;
use util::prefs::mozbrowser_enabled;
use util::prefs::PREFS;
#[dom_struct]
pub struct HTMLAnchorElement {
@ -575,7 +575,7 @@ fn follow_hyperlink(subject: &Element, hyperlink_suffix: Option<String>) {
// Step 8: navigate to the URL.
if let Some(target) = target {
if mozbrowser_enabled() && !is_current_browsing_context(target.Value()) {
if PREFS.is_mozbrowser_enabled() && !is_current_browsing_context(target.Value()) {
// https://developer.mozilla.org/en-US/docs/Web/Events/mozbrowseropenwindow
// TODO: referrer and opener
// TODO: should we send the normalized url or the non-normalized href?