#8539 Config preferences backend restructure

This commit is contained in:
Peter Hall 2019-02-14 12:53:59 +00:00
parent 34fda66dfa
commit 8bfd4dc1e2
53 changed files with 1748 additions and 680 deletions

View file

@ -71,7 +71,7 @@ use net_traits::image_cache::ImageResponse;
use pixels::{self, PixelFormat};
use script_layout_interface::HTMLCanvasDataSource;
use serde::{Deserialize, Serialize};
use servo_config::prefs::PREFS;
use servo_config::pref;
use std::cell::Cell;
use std::cmp;
use std::ptr::{self, NonNull};
@ -173,10 +173,7 @@ impl WebGLRenderingContext {
size: Size2D<u32>,
attrs: GLContextAttributes,
) -> Result<WebGLRenderingContext, String> {
if let Some(true) = PREFS
.get("webgl.testing.context_creation_error")
.as_boolean()
{
if pref!(webgl.testing.context_creation_error) {
return Err("WebGL context creation error forced by pref `webgl.testing.context_creation_error`".into());
}