Bug 1171228 - Expose WEBGL_debug_renderer_info to web content on non-RELEASE_BUILDs. r=kamidphish, sr=jst, a=ritu
authorJeff Gilbert <jgilbert@mozilla.com>
Tue, 21 Jul 2015 17:41:57 -0700
changeset 281740 8cf5636886f0c32c3538c6988b83a5b3dcfffd59
parent 281739 16c7bedeca10bb48e4e0a5d6f9b16d5868e83bbb
child 281741 11446d89a3ad8b4ae50b277394f3616495e1a964
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskamidphish, jst, ritu
bugs1171228
milestone41.0a2
Bug 1171228 - Expose WEBGL_debug_renderer_info to web content on non-RELEASE_BUILDs. r=kamidphish, sr=jst, a=ritu
dom/canvas/WebGLContextExtensions.cpp
dom/canvas/WebGLContextState.cpp
dom/canvas/test/chrome/nonchrome_webgl_debug_renderer_info.html
dom/canvas/test/chrome/test_webgl_debug_renderer_info.html
dom/canvas/test/webgl-mochitest.ini
dom/canvas/test/webgl-mochitest/test_privileged_exts.html
dom/canvas/test/webgl-mochitest/test_renderer_strings.html
modules/libpref/init/all.js
--- a/dom/canvas/WebGLContextExtensions.cpp
+++ b/dom/canvas/WebGLContextExtensions.cpp
@@ -154,16 +154,30 @@ WebGLContext::IsExtensionSupported(WebGL
         return gl->IsExtensionSupported(gl::GLContext::IMG_texture_compression_pvrtc);
     case WebGLExtensionID::WEBGL_compressed_texture_s3tc:
         if (gl->IsExtensionSupported(gl::GLContext::EXT_texture_compression_s3tc))
             return true;
 
         return gl->IsExtensionSupported(gl::GLContext::EXT_texture_compression_dxt1) &&
                gl->IsExtensionSupported(gl::GLContext::ANGLE_texture_compression_dxt3) &&
                gl->IsExtensionSupported(gl::GLContext::ANGLE_texture_compression_dxt5);
+
+    case WebGLExtensionID::WEBGL_debug_renderer_info:
+        {
+            bool isEnabled = true;
+
+#ifdef RELEASE_BUILD
+            // Keep this disabled on Release and Beta for now. (see bug 1171228)
+            isEnabled = false;
+#endif
+            if (Preferences::GetBool("webgl.disable-debug-renderer-info", false))
+                isEnabled = false;
+
+            return isEnabled;
+        }
     case WebGLExtensionID::WEBGL_depth_texture:
         // WEBGL_depth_texture supports DEPTH_STENCIL textures
         if (!gl->IsSupported(gl::GLFeature::packed_depth_stencil))
             return false;
 
         return gl->IsSupported(gl::GLFeature::depth_texture) ||
                gl->IsExtensionSupported(gl::GLContext::ANGLE_depth_texture);
     case WebGLExtensionID::WEBGL_draw_buffers:
--- a/dom/canvas/WebGLContextState.cpp
+++ b/dom/canvas/WebGLContextState.cpp
@@ -1,24 +1,27 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "WebGLContext.h"
+
+#include "GLContext.h"
+#include "mozilla/dom/ToJSValue.h"
+#include "mozilla/Preferences.h"
+#include "nsString.h"
+#include "WebGLBuffer.h"
 #include "WebGLContextUtils.h"
-#include "WebGLBuffer.h"
+#include "WebGLFramebuffer.h"
+#include "WebGLProgram.h"
+#include "WebGLRenderbuffer.h"
 #include "WebGLShader.h"
-#include "WebGLProgram.h"
-#include "WebGLFramebuffer.h"
-#include "WebGLRenderbuffer.h"
 #include "WebGLTexture.h"
 #include "WebGLVertexArray.h"
-#include "GLContext.h"
-#include "mozilla/dom/ToJSValue.h"
 
 using namespace mozilla;
 using namespace dom;
 
 void
 WebGLContext::Disable(GLenum cap)
 {
     if (IsContextLost())
@@ -53,16 +56,28 @@ WebGLContext::Enable(GLenum cap)
     {
         *trackingSlot = 1;
     }
 
     MakeContextCurrent();
     gl->fEnable(cap);
 }
 
+static JS::Value
+StringValue(JSContext* cx, const nsAString& str, ErrorResult& rv)
+{
+    JSString* jsStr = JS_NewUCStringCopyN(cx, str.BeginReading(), str.Length());
+    if (!jsStr) {
+        rv.Throw(NS_ERROR_OUT_OF_MEMORY);
+        return JS::NullValue();
+    }
+
+    return JS::StringValue(jsStr);
+}
+
 bool
 WebGLContext::GetStencilBits(GLint* out_stencilBits)
 {
     *out_stencilBits = 0;
     if (mBoundDrawFramebuffer) {
         if (mBoundDrawFramebuffer->HasDepthStencilConflict()) {
             // Error, we don't know which stencil buffer's bits to use
             ErrorInvalidFramebufferOperation("getParameter: framebuffer has two stencil buffers bound");
@@ -172,29 +187,57 @@ WebGLContext::GetParameter(JSContext* cx
             realGLboolean disjoint = LOCAL_GL_FALSE;
             if (gl->IsExtensionSupported(gl::GLContext::EXT_disjoint_timer_query)) {
                 gl->fGetBooleanv(pname, &disjoint);
             }
             return JS::BooleanValue(bool(disjoint));
         }
     }
 
-    // Privileged string params exposed by WEBGL_debug_renderer_info:
+    // Privileged string params exposed by WEBGL_debug_renderer_info.
+    // The privilege check is done in WebGLContext::IsExtensionSupported.
+    // So here we just have to check that the extension is enabled.
     if (IsExtensionEnabled(WebGLExtensionID::WEBGL_debug_renderer_info)) {
         switch (pname) {
         case UNMASKED_VENDOR_WEBGL:
         case UNMASKED_RENDERER_WEBGL:
-            GLenum glstringname = LOCAL_GL_NONE;
-            if (pname == UNMASKED_VENDOR_WEBGL) {
-                glstringname = LOCAL_GL_VENDOR;
-            } else if (pname == UNMASKED_RENDERER_WEBGL) {
-                glstringname = LOCAL_GL_RENDERER;
+            {
+                const char* overridePref = nullptr;
+                GLenum driverEnum = LOCAL_GL_NONE;
+
+                switch (pname) {
+                case UNMASKED_RENDERER_WEBGL:
+                    overridePref = "webgl.renderer-string-override";
+                    driverEnum = LOCAL_GL_RENDERER;
+                    break;
+                case UNMASKED_VENDOR_WEBGL:
+                    overridePref = "webgl.vendor-string-override";
+                    driverEnum = LOCAL_GL_VENDOR;
+                    break;
+                default:
+                    MOZ_CRASH("bad `pname`");
+                }
+
+                bool hasRetVal = false;
+
+                nsAutoString ret;
+                if (overridePref) {
+                    nsresult res = Preferences::GetString(overridePref, &ret);
+                    if (NS_SUCCEEDED(res) && ret.Length() > 0)
+                        hasRetVal = true;
+                }
+
+                if (!hasRetVal) {
+                    const char* chars = reinterpret_cast<const char*>(gl->fGetString(driverEnum));
+                    ret = NS_ConvertASCIItoUTF16(chars);
+                    hasRetVal = true;
+                }
+
+                return StringValue(cx, ret, rv);
             }
-            const GLchar* string = (const GLchar*) gl->fGetString(glstringname);
-            return StringValue(cx, string, rv);
         }
     }
 
     if (IsExtensionEnabled(WebGLExtensionID::OES_standard_derivatives)) {
         if (pname == LOCAL_GL_FRAGMENT_SHADER_DERIVATIVE_HINT) {
             GLint i = 0;
             gl->fGetIntegerv(pname, &i);
             return JS::Int32Value(i);
--- a/dom/canvas/test/chrome/nonchrome_webgl_debug_renderer_info.html
+++ b/dom/canvas/test/chrome/nonchrome_webgl_debug_renderer_info.html
@@ -1,12 +1,18 @@
 <!DOCTYPE HTML>
 <html>
 <script>
 
+var Cu = parent.Components.utils;
+Cu.import("resource://gre/modules/AppConstants.jsm");
+// This gives us `AppConstants` in the global scope.
+// We need this because we only expose debug_renderer_info #ifndef MOZ_RELEASE_BUILD.
+// This should match AppConstants.RELEASE_BUILD.
+
 // This file has the portion of the test_webgl_renderer_info chrome mochitest
 // that has to run as non-chrome to check that this WebGL extension is not exposed to content
 
 // we can't call the chrome Mochitest ok() function ourselves from non-chrome code.
 // So we remote it to the chrome test.
 
 function ok(res, msg) {
   // Note we post to ourselves as posting to the chrome code doesn't seem to work here.
@@ -23,35 +29,63 @@ function messageListener(e) {
 }
 
 window.addEventListener("message", messageListener, true);
 
 function run() {
   const UNMASKED_VENDOR_WEBGL = 0x9245;
   const UNMASKED_RENDERER_WEBGL = 0x9246;
 
+  var shouldHaveRendererInfo = false;
+  if (!AppConstants.RELEASE_BUILD)
+    shouldHaveRendererInfo = true;
+
   var canvas = document.createElement("canvas");
   var gl = canvas.getContext("experimental-webgl");
 
   ok(!gl.getError(), "getError on newly created WebGL context should return NO_ERROR");
 
   ok(!gl.getParameter(UNMASKED_VENDOR_WEBGL) && gl.getError() == gl.INVALID_ENUM,
-      "Should not be able to query UNMASKED_VENDOR_WEBGL without having enabled the WEBGL_debug_renderer_info extension");
+      "Should not be able to query UNMASKED_VENDOR_WEBGL without having enabled the"
+      + " WEBGL_debug_renderer_info extension");
   ok(!gl.getParameter(UNMASKED_RENDERER_WEBGL) && gl.getError() == gl.INVALID_ENUM,
-      "Should not be able to query UNMASKED_RENDERER_WEBGL without having enabled the WEBGL_debug_renderer_info extension");
+      "Should not be able to query UNMASKED_RENDERER_WEBGL without having enabled the"
+      + " WEBGL_debug_renderer_info extension");
 
   var exts = gl.getSupportedExtensions();
-  ok(exts.indexOf("WEBGL_debug_renderer_info") == -1,
-      "WEBGL_debug_renderer_info should not be listed by getSupportedExtensions in non-chrome contexts");
-  var debugRendererInfoExtension = gl.getExtension("WEBGL_debug_renderer_info");
-  ok(!debugRendererInfoExtension,
-      "WEBGL_debug_renderer_info should not be available through getExtension in non-chrome contexts");
+  if (shouldHaveRendererInfo) {
+    ok(exts.indexOf("WEBGL_debug_renderer_info") != -1,
+       "WEBGL_debug_renderer_info should be listed by getSupportedExtensions in"
+       + " non-chrome contexts on non-RELEASE_BUILDs");
+
+    var ext = gl.getExtension("WEBGL_debug_renderer_info");
+    ok(!!ext,
+       "WEBGL_debug_renderer_info should be available through getExtension in non-chrome"
+       + " contexts on non-RELEASE_BUILDs");
 
-  ok(!gl.getParameter(UNMASKED_VENDOR_WEBGL) && gl.getError() == gl.INVALID_ENUM,
-      "Should not be able to query UNMASKED_VENDOR_WEBGL if enabling WEBGL_debug_renderer_info failed");
-  ok(!gl.getParameter(UNMASKED_RENDERER_WEBGL) && gl.getError() == gl.INVALID_ENUM,
-      "Should not be able to query UNMASKED_RENDERER_WEBGL if enabling WEBGL_debug_renderer_info failed");
+    ok(gl.getParameter(UNMASKED_VENDOR_WEBGL) && gl.getError() == gl.NO_ERROR,
+       "Should be able to query UNMASKED_VENDOR_WEBGL if enabling"
+       + " WEBGL_debug_renderer_info succeeded");
+    ok(gl.getParameter(UNMASKED_RENDERER_WEBGL) && gl.getError() == gl.NO_ERROR,
+       "Should be able to query UNMASKED_RENDERER_WEBGL if enabling"
+       + " WEBGL_debug_renderer_info succeeded");
+  } else {
+    ok(exts.indexOf("WEBGL_debug_renderer_info") == -1,
+       "WEBGL_debug_renderer_info should not be listed by getSupportedExtensions in"
+       + " non-chrome contexts");
+    var ext = gl.getExtension("WEBGL_debug_renderer_info");
+    ok(!ext,
+       "WEBGL_debug_renderer_info should not be available through getExtension in"
+       + " non-chrome contexts");
 
+    ok(!gl.getParameter(UNMASKED_VENDOR_WEBGL) && gl.getError() == gl.INVALID_ENUM,
+        "Should not be able to query UNMASKED_VENDOR_WEBGL if enabling"
+        + " WEBGL_debug_renderer_info failed");
+    ok(!gl.getParameter(UNMASKED_RENDERER_WEBGL) && gl.getError() == gl.INVALID_ENUM,
+        "Should not be able to query UNMASKED_RENDERER_WEBGL if enabling"
+        + " WEBGL_debug_renderer_info failed");
+
+  }
   window.postMessage({allTestsFinished: true}, "*");
 }
 
 </script>
-</html>
\ No newline at end of file
+</html>
--- a/dom/canvas/test/chrome/test_webgl_debug_renderer_info.html
+++ b/dom/canvas/test/chrome/test_webgl_debug_renderer_info.html
@@ -38,23 +38,23 @@ function checkChromeCase(canvas) {
   ok(!gl.getParameter(UNMASKED_VENDOR_WEBGL) && gl.getError() == gl.INVALID_ENUM,
      "Should not be able to query UNMASKED_VENDOR_WEBGL without having enabled the WEBGL_debug_renderer_info extension");
   ok(!gl.getParameter(UNMASKED_RENDERER_WEBGL) && gl.getError() == gl.INVALID_ENUM,
      "Should not be able to query UNMASKED_RENDERER_WEBGL without having enabled the WEBGL_debug_renderer_info extension");
 
   var exts = gl.getSupportedExtensions();
   ok(exts.indexOf("WEBGL_debug_renderer_info") != -1,
      "WEBGL_debug_renderer_info should be listed by getSupportedExtensions in chrome contexts");
-  var debugRendererInfoExtension = gl.getExtension("WEBGL_debug_renderer_info");
-  ok(debugRendererInfoExtension,
+  var ext = gl.getExtension("WEBGL_debug_renderer_info");
+  ok(ext,
      "WEBGL_debug_renderer_info should be available through getExtension in chrome contexts");
 
-  ok(debugRendererInfoExtension.UNMASKED_VENDOR_WEBGL == UNMASKED_VENDOR_WEBGL,
+  ok(ext.UNMASKED_VENDOR_WEBGL == UNMASKED_VENDOR_WEBGL,
      "UNMASKED_VENDOR_WEBGL has the correct value");
-  ok(debugRendererInfoExtension.UNMASKED_RENDERER_WEBGL == UNMASKED_RENDERER_WEBGL,
+  ok(ext.UNMASKED_RENDERER_WEBGL == UNMASKED_RENDERER_WEBGL,
      "UNMASKED_RENDERER_WEBGL has the correct value");
 
   ok(isNonEmptyString(gl.getParameter(UNMASKED_VENDOR_WEBGL)) && gl.getError() == gl.NO_ERROR,
      "Should be able to query UNMASKED_VENDOR_WEBGL in chrome context with WEBGL_debug_renderer_info enabled");
   ok(isNonEmptyString(gl.getParameter(UNMASKED_RENDERER_WEBGL)) && gl.getError() == gl.NO_ERROR,
      "Should be able to query UNMASKED_RENDERER_WEBGL in chrome context with WEBGL_debug_renderer_info enabled");
 }
 
@@ -62,17 +62,17 @@ function main()
 {
   SimpleTest.waitForExplicitFinish();
 
   checkChromeCase(document.createElement("canvas"));
 
   // Now run the non-chrome code to verify the security of this WebGL chrome-only extension.
 
   var iframe = document.createElement("iframe");
-  iframe.src = "http://mochi.test:8888/chrome/dom/canvas/test/chrome/nonchrome_webgl_debug_renderer_info.html";
+  iframe.src = "chrome://mochitests/content/chrome/dom/canvas/test/chrome/nonchrome_webgl_debug_renderer_info.html";
 
   iframe.onload = function () {
 
     // test that chrome can get WEBGL_debug_renderer_info on a canvas on the iframe...
     // this is useful to check in itself, and is also useful so the subsequent non-chrome test
     // will also test that doing so doesn't confuse our chrome-only check.
     checkChromeCase(iframe.contentDocument.createElement("canvas"));
 
--- a/dom/canvas/test/webgl-mochitest.ini
+++ b/dom/canvas/test/webgl-mochitest.ini
@@ -17,16 +17,17 @@ support-files = captureStream_common.js
 [webgl-mochitest/test_hidden_alpha.html]
 skip-if = (os == 'b2g') || buildapp == 'mulet' # Mulet - bug 1093639 (crashes in libLLVM-3.0.so)
 [webgl-mochitest/test_implicit_color_buffer_float.html]
 [webgl-mochitest/test_highp_fs.html]
 [webgl-mochitest/test_no_arr_points.html]
 skip-if = android_version == '10' || android_version == '18' #Android 2.3 and 4.3 aws only; bug 1030942
 [webgl-mochitest/test_noprog_draw.html]
 [webgl-mochitest/test_privileged_exts.html]
+[webgl-mochitest/test_renderer_strings.html]
 [webgl-mochitest/test_texsubimage_float.html]
 [webgl-mochitest/test_uninit_data.html]
 [webgl-mochitest/test_webgl_available.html]
 skip-if = toolkit == 'android' #bug 865443- seperate suite - the non_conf* tests pass except for one on armv6 tests
 #[webgl-mochitest/test_webgl_color_buffer_float.html]
 # We haven't cleaned up the Try results yet, but let's get this on the books first.
 [webgl-mochitest/test_webgl_conformance.html]
 skip-if = buildapp == 'mulet' || toolkit == 'android' #bug 865443- seperate suite - the non_conf* tests pass except for one on armv6 tests
--- a/dom/canvas/test/webgl-mochitest/test_privileged_exts.html
+++ b/dom/canvas/test/webgl-mochitest/test_privileged_exts.html
@@ -19,14 +19,14 @@ function TestExt(gl, name) {
 (function() {
   var gl = WebGLUtil.getWebGL('c');
   if (!gl) {
     todo(gl, 'Get GL working here first.');
     return;
   }
 
   // Privileged extensions:
-  TestExt(gl, 'WEBGL_debug_renderer_info');
+  TestExt(gl, 'WEBGL_debug_shaders');
 })();
 
 </script>
 </body>
 </html>
new file mode 100644
--- /dev/null
+++ b/dom/canvas/test/webgl-mochitest/test_renderer_strings.html
@@ -0,0 +1,98 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<script src="/tests/SimpleTest/SimpleTest.js"></script>
+<link rel="stylesheet" href="/tests/SimpleTest/test.css">
+</head>
+<body>
+<script>
+
+function AssertError(gl, expected, info) {
+  var actual = gl.getError();
+  while (gl.getError()) {}
+
+  ok(actual == expected,
+     'For ' + info + ', expected 0x' + expected.toString(16) + ', got 0x'
+      + actual.toString(16));
+}
+
+var gl;
+
+var RENDERER_OVERRIDE = 'overridden renderer';
+var VENDOR_OVERRIDE = 'overridden vendor';
+
+function TestExt() {
+  var ext = gl.getExtension('WEBGL_debug_renderer_info');
+  ok(ext, 'Should have access to \'WEBGL_debug_renderer_info\'.');
+  AssertError(gl, 0, 'start of test');
+
+  var renderer = gl.getParameter(ext.UNMASKED_RENDERER_WEBGL);
+  AssertError(gl, 0, 'UNMASKED_RENDERER_WEBGL');
+  ok(renderer,
+     'UNMASKED_RENDERER_WEBGL value should not be empty, was \'' + renderer + '\'');
+
+  var vendor = gl.getParameter(ext.UNMASKED_VENDOR_WEBGL);
+  AssertError(gl, 0, 'UNMASKED_VENDOR_WEBGL');
+  ok(vendor, 'UNMASKED_VENDOR_WEBGL value should not be empty, was \'' + vendor + '\'');
+
+  var prefArrArr = [
+    ['webgl.renderer-string-override', RENDERER_OVERRIDE],
+    ['webgl.vendor-string-override', VENDOR_OVERRIDE],
+  ];
+  var prefEnv = {'set': prefArrArr};
+  SpecialPowers.pushPrefEnv(prefEnv, TestOverrides);
+}
+
+function TestOverrides() {
+  var ext = gl.getExtension('WEBGL_debug_renderer_info');
+  ok(ext, 'Should have access to \'WEBGL_debug_renderer_info\'.');
+  AssertError(gl, 0, 'start of test');
+
+  var renderer = gl.getParameter(ext.UNMASKED_RENDERER_WEBGL);
+  AssertError(gl, 0, 'UNMASKED_RENDERER_WEBGL');
+  ok(renderer == RENDERER_OVERRIDE,
+     'UNMASKED_RENDERER_WEBGL value should be \'' + RENDERER_OVERRIDE + '\', was \''
+     + renderer + '\'');
+
+  var vendor = gl.getParameter(ext.UNMASKED_VENDOR_WEBGL);
+  AssertError(gl, 0, 'UNMASKED_VENDOR_WEBGL');
+  ok(vendor == VENDOR_OVERRIDE,
+     'UNMASKED_VENDOR_WEBGL value should be \'' + VENDOR_OVERRIDE + '\', was \'' + vendor
+     + '\'');
+
+  var prefArrArr = [
+    ['webgl.disable-debug-renderer-info', true],
+  ];
+  var prefEnv = {'set': prefArrArr};
+  SpecialPowers.pushPrefEnv(prefEnv, TestDisable);
+}
+
+function TestDisable() {
+  var ext = gl.getExtension('WEBGL_debug_renderer_info');
+  ok(!ext, 'Should not have access to \'WEBGL_debug_renderer_info\'.');
+
+  ok(true, 'Test complete.');
+  SimpleTest.finish();
+}
+
+(function() {
+  var canvas = document.createElement('canvas');
+  gl = canvas.getContext('experimental-webgl');
+  if (!gl) {
+    todo(gl, 'Get WebGL working here first.');
+    ok(true, 'Test complete.');
+    return;
+  }
+
+  SimpleTest.waitForExplicitFinish();
+
+  var prefArrArr = [
+    ['webgl.disable-debug-renderer-info', false],
+  ];
+  var prefEnv = {'set': prefArrArr};
+  SpecialPowers.pushPrefEnv(prefEnv, TestExt);
+})();
+
+</script>
+</body>
+</html>
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -4080,16 +4080,18 @@ pref("image.onload.decode.limit", 0);
 
 // WebGL prefs
 #ifdef ANDROID
 // Disable MSAA on mobile.
 pref("gl.msaa-level", 0);
 #else
 pref("gl.msaa-level", 2);
 #endif
+pref("gl.require-hardware", false);
+
 pref("webgl.force-enabled", false);
 pref("webgl.disabled", false);
 pref("webgl.disable-angle", false);
 pref("webgl.min_capability_mode", false);
 pref("webgl.disable-extensions", false);
 pref("webgl.msaa-force", false);
 pref("webgl.prefer-16bpp", false);
 pref("webgl.default-no-alpha", false);
@@ -4098,17 +4100,19 @@ pref("webgl.lose-context-on-memory-press
 pref("webgl.can-lose-context-in-foreground", true);
 pref("webgl.restore-context-when-visible", true);
 pref("webgl.max-warnings-per-context", 32);
 pref("webgl.enable-draft-extensions", false);
 pref("webgl.enable-privileged-extensions", false);
 pref("webgl.bypass-shader-validation", false);
 pref("webgl.enable-prototype-webgl2", false);
 pref("webgl.disable-fail-if-major-performance-caveat", false);
-pref("gl.require-hardware", false);
+pref("webgl.disable-debug-renderer-info", false);
+pref("webgl.renderer-string-override", "");
+pref("webgl.vendor-string-override", "");
 
 #ifdef XP_WIN
 pref("webgl.angle.try-d3d11", true);
 pref("webgl.angle.force-d3d11", false);
 #endif
 
 #ifdef MOZ_WIDGET_GONK
 pref("gfx.gralloc.fence-with-readpixels", false);