Backed out changeset 6f964a309e55 (bug 1233046) for winxp m(gl) bustage
authorWes Kocher <wkocher@mozilla.com>
Wed, 03 Feb 2016 14:17:56 -0800
changeset 305927 f17d207b1a3310630ab364be22acc2c1ab58901b
parent 305926 653df21ca86195f23cadc2fc180bff0c6831da25
child 305928 65e84ada79e41a3afdcb0d8148a84a7152888df1
push id9214
push userraliiev@mozilla.com
push dateMon, 07 Mar 2016 14:25:21 +0000
treeherdermozilla-aurora@8849dd1a4a79 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1233046
milestone47.0a1
backs out6f964a309e55f201693b9674a07ca8426798b29c
Backed out changeset 6f964a309e55 (bug 1233046) for winxp m(gl) bustage
dom/canvas/WebGLContext.cpp
dom/canvas/WebGLContext.h
dom/canvas/WebGLContextGL.cpp
dom/canvas/WebGLContextState.cpp
dom/canvas/WebGLExtensionTextureFloat.cpp
dom/canvas/WebGLExtensionTextureHalfFloat.cpp
dom/canvas/moz.build
dom/canvas/test/webgl-mochitest.ini
dom/canvas/test/webgl-mochitest/ensure-exts/ensure-ext.js
dom/canvas/test/webgl-mochitest/ensure-exts/test_ANGLE_instanced_arrays.html
dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_blend_minmax.html
dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_color_buffer_half_float.html
dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_disjoint_timer_query.html
dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_frag_depth.html
dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_sRGB.html
dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_shader_texture_lod.html
dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_texture_filter_anisotropic.html
dom/canvas/test/webgl-mochitest/ensure-exts/test_OES_standard_derivatives.html
dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_color_buffer_float.html
dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_atc.html
dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_es3.html
dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_etc1.html
dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_pvrtc.html
dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_s3tc.html
dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_depth_texture.html
dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_draw_buffers.html
dom/canvas/test/webgl-mochitest/ensure-exts/test_common.html
dom/canvas/test/webgl-mochitest/mochi-to-testcase.py
--- a/dom/canvas/WebGLContext.cpp
+++ b/dom/canvas/WebGLContext.cpp
@@ -1299,29 +1299,30 @@ WebGLContext::MozGetUnderlyingParamStrin
 void
 WebGLContext::ClearScreen()
 {
     MakeContextCurrent();
     ScopedBindFramebuffer autoFB(gl, 0);
 
     const bool changeDrawBuffers = (mDefaultFB_DrawBuffer0 != LOCAL_GL_BACK);
     if (changeDrawBuffers) {
-        gl->Screen()->SetDrawBuffer(LOCAL_GL_BACK);
+        const GLenum back = LOCAL_GL_BACK;
+        gl->fDrawBuffers(1, &back);
     }
 
     GLbitfield bufferBits = LOCAL_GL_COLOR_BUFFER_BIT;
     if (mOptions.depth)
         bufferBits |= LOCAL_GL_DEPTH_BUFFER_BIT;
     if (mOptions.stencil)
         bufferBits |= LOCAL_GL_STENCIL_BUFFER_BIT;
 
     ForceClearFramebufferWithDefaultValues(bufferBits, mNeedsFakeNoAlpha);
 
     if (changeDrawBuffers) {
-        gl->Screen()->SetDrawBuffer(mDefaultFB_DrawBuffer0);
+        gl->fDrawBuffers(1, &mDefaultFB_DrawBuffer0);
     }
 }
 
 void
 WebGLContext::ForceClearFramebufferWithDefaultValues(GLbitfield clearBits,
                                                      bool fakeNoAlpha)
 {
     MakeContextCurrent();
--- a/dom/canvas/WebGLContext.h
+++ b/dom/canvas/WebGLContext.h
@@ -822,18 +822,17 @@ protected:
     WebGLRefPtr<WebGLQuery> mActiveOcclusionQuery;
     WebGLRefPtr<WebGLQuery> mActiveTransformFeedbackQuery;
 
 // -----------------------------------------------------------------------------
 // State and State Requests (WebGLContextState.cpp)
 public:
     void Disable(GLenum cap);
     void Enable(GLenum cap);
-    bool GetStencilBits(GLint* const out_stencilBits);
-    bool GetChannelBits(const char* funcName, GLenum pname, GLint* const out_val);
+    bool GetStencilBits(GLint* out_stencilBits);
     virtual JS::Value GetParameter(JSContext* cx, GLenum pname, ErrorResult& rv);
 
     void GetParameter(JSContext* cx, GLenum pname,
                       JS::MutableHandle<JS::Value> retval, ErrorResult& rv)
     {
         retval.set(GetParameter(cx, pname, rv));
     }
 
--- a/dom/canvas/WebGLContextGL.cpp
+++ b/dom/canvas/WebGLContextGL.cpp
@@ -989,20 +989,16 @@ WebGLContext::Hint(GLenum target, GLenum
 {
     if (IsContextLost())
         return;
 
     bool isValid = false;
 
     switch (target) {
     case LOCAL_GL_GENERATE_MIPMAP_HINT:
-        // Deprecated and removed in desktop GL Core profiles.
-        if (gl->IsCoreProfile())
-            return;
-
         isValid = true;
         break;
 
     case LOCAL_GL_FRAGMENT_SHADER_DERIVATIVE_HINT:
         if (IsWebGL2() ||
             IsExtensionEnabled(WebGLExtensionID::OES_standard_derivatives))
         {
             isValid = true;
--- a/dom/canvas/WebGLContextState.cpp
+++ b/dom/canvas/WebGLContextState.cpp
@@ -68,17 +68,17 @@ StringValue(JSContext* cx, const nsAStri
         rv.Throw(NS_ERROR_OUT_OF_MEMORY);
         return JS::NullValue();
     }
 
     return JS::StringValue(jsStr);
 }
 
 bool
-WebGLContext::GetStencilBits(GLint* const out_stencilBits)
+WebGLContext::GetStencilBits(GLint* out_stencilBits)
 {
     *out_stencilBits = 0;
     if (mBoundDrawFramebuffer) {
         if (mBoundDrawFramebuffer->StencilAttachment().IsDefined() &&
             mBoundDrawFramebuffer->DepthStencilAttachment().IsDefined())
         {
             // Error, we don't know which stencil buffer's bits to use
             ErrorInvalidFramebufferOperation("getParameter: framebuffer has two stencil buffers bound");
@@ -92,117 +92,19 @@ WebGLContext::GetStencilBits(GLint* cons
         }
     } else if (mOptions.stencil) {
         *out_stencilBits = 8;
     }
 
     return true;
 }
 
-bool
-WebGLContext::GetChannelBits(const char* funcName, GLenum pname, GLint* const out_val)
-{
-    if (mBoundDrawFramebuffer) {
-        if (!mBoundDrawFramebuffer->ValidateAndInitAttachments(funcName))
-            return false;
-    }
-
-    if (!mBoundDrawFramebuffer) {
-        switch (pname) {
-        case LOCAL_GL_RED_BITS:
-        case LOCAL_GL_GREEN_BITS:
-        case LOCAL_GL_BLUE_BITS:
-            *out_val = 8;
-            break;
-
-        case LOCAL_GL_ALPHA_BITS:
-            *out_val = (mOptions.alpha ? 8 : 0);
-            break;
-
-        case LOCAL_GL_DEPTH_BITS:
-            if (mOptions.depth) {
-                const auto& glFormats = gl->GetGLFormats();
-
-                GLenum depthFormat = glFormats.depth;
-                if (mOptions.stencil && glFormats.depthStencil) {
-                    depthFormat = glFormats.depthStencil;
-                }
-
-                if (depthFormat == LOCAL_GL_DEPTH_COMPONENT16) {
-                    *out_val = 16;
-                } else {
-                    *out_val = 24;
-                }
-            } else {
-                *out_val = 0;
-            }
-            break;
-
-        case LOCAL_GL_STENCIL_BITS:
-            *out_val = (mOptions.stencil ? 8 : 0);
-            break;
-
-        default:
-            MOZ_CRASH("bad pname");
-        }
-        return true;
-    }
-
-    if (!gl->IsCoreProfile()) {
-        gl->fGetIntegerv(pname, out_val);
-        return true;
-    }
-
-    GLenum fbAttachment = 0;
-    GLenum fbPName = 0;
-    switch (pname) {
-    case LOCAL_GL_RED_BITS:
-        fbAttachment = LOCAL_GL_COLOR_ATTACHMENT0;
-        fbPName = LOCAL_GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE;
-        break;
-
-    case LOCAL_GL_GREEN_BITS:
-        fbAttachment = LOCAL_GL_COLOR_ATTACHMENT0;
-        fbPName = LOCAL_GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE;
-        break;
-
-    case LOCAL_GL_BLUE_BITS:
-        fbAttachment = LOCAL_GL_COLOR_ATTACHMENT0;
-        fbPName = LOCAL_GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE;
-        break;
-
-    case LOCAL_GL_ALPHA_BITS:
-        fbAttachment = LOCAL_GL_COLOR_ATTACHMENT0;
-        fbPName = LOCAL_GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE;
-        break;
-
-    case LOCAL_GL_DEPTH_BITS:
-        fbAttachment = LOCAL_GL_DEPTH_ATTACHMENT;
-        fbPName = LOCAL_GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE;
-        break;
-
-    case LOCAL_GL_STENCIL_BITS:
-        fbAttachment = LOCAL_GL_STENCIL_ATTACHMENT;
-        fbPName = LOCAL_GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE;
-        break;
-
-    default:
-        MOZ_CRASH("bad pname");
-    }
-
-    gl->fGetFramebufferAttachmentParameteriv(LOCAL_GL_DRAW_FRAMEBUFFER, fbAttachment,
-                                             fbPName, out_val);
-    return true;
-}
-
 JS::Value
 WebGLContext::GetParameter(JSContext* cx, GLenum pname, ErrorResult& rv)
 {
-    const char funcName[] = "getParameter";
-
     if (IsContextLost())
         return JS::NullValue();
 
     MakeContextCurrent();
 
     if (MinCapabilityMode()) {
         switch(pname) {
             ////////////////////////////
@@ -449,46 +351,52 @@ WebGLContext::GetParameter(JSContext* cx
             // Assuming stencils have 8 bits
             const GLint stencilMask = (1 << stencilBits) - 1;
 
             GLint refValue = 0;
             gl->fGetIntegerv(pname, &refValue);
 
             return JS::Int32Value(refValue & stencilMask);
         }
-
+        case LOCAL_GL_STENCIL_BITS: {
+            GLint stencilBits = 0;
+            GetStencilBits(&stencilBits);
+            return JS::Int32Value(stencilBits);
+        }
         case LOCAL_GL_STENCIL_CLEAR_VALUE:
         case LOCAL_GL_UNPACK_ALIGNMENT:
         case LOCAL_GL_PACK_ALIGNMENT:
         case LOCAL_GL_SUBPIXEL_BITS:
         case LOCAL_GL_SAMPLE_BUFFERS:
         case LOCAL_GL_SAMPLES:
         case LOCAL_GL_MAX_VERTEX_ATTRIBS:
         case LOCAL_GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS:
         case LOCAL_GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS:
-        case LOCAL_GL_MAX_TEXTURE_IMAGE_UNITS: {
+        case LOCAL_GL_MAX_TEXTURE_IMAGE_UNITS:
+        case LOCAL_GL_RED_BITS:
+        case LOCAL_GL_GREEN_BITS:
+        case LOCAL_GL_BLUE_BITS: {
             GLint i = 0;
             gl->fGetIntegerv(pname, &i);
             return JS::Int32Value(i);
         }
-
-        case LOCAL_GL_RED_BITS:
-        case LOCAL_GL_GREEN_BITS:
-        case LOCAL_GL_BLUE_BITS:
-        case LOCAL_GL_ALPHA_BITS:
-        case LOCAL_GL_DEPTH_BITS:
-        case LOCAL_GL_STENCIL_BITS: {
-            // Deprecated and removed in GL Core profiles, so special handling required.
-            GLint val;
-            if (!GetChannelBits(funcName, pname, &val))
-                return JS::NullValue();
-
-            return JS::Int32Value(val);
+        case LOCAL_GL_DEPTH_BITS: {
+            GLint i = 0;
+            if (!mNeedsFakeNoDepth) {
+                gl->fGetIntegerv(pname, &i);
+            }
+            return JS::Int32Value(i);
         }
-
+        case LOCAL_GL_ALPHA_BITS: {
+            GLint i = 0;
+            if (!mNeedsFakeNoAlpha) {
+                gl->fGetIntegerv(pname, &i);
+            }
+            return JS::Int32Value(i);
+        }
         case LOCAL_GL_MAX_TEXTURE_SIZE:
             return JS::Int32Value(mImplMaxTextureSize);
 
         case LOCAL_GL_MAX_CUBE_MAP_TEXTURE_SIZE:
             return JS::Int32Value(mImplMaxCubeMapTextureSize);
 
         case LOCAL_GL_MAX_RENDERBUFFER_SIZE:
             return JS::Int32Value(mImplMaxRenderbufferSize);
--- a/dom/canvas/WebGLExtensionTextureFloat.cpp
+++ b/dom/canvas/WebGLExtensionTextureFloat.cpp
@@ -27,96 +27,89 @@ WebGLExtensionTextureFloat::WebGLExtensi
     {
         auto usage = fua->EditUsage(effFormat);
         usage->textureSwizzleRGBA = swizzle;
         fua->AddTexUnpack(usage, pi, dui);
 
         fua->AllowUnsizedTexFormat(pi, usage);
     };
 
-    const bool needsSwizzle = gl->IsCoreProfile();
-    MOZ_ASSERT_IF(needsSwizzle, gl->IsSupported(gl::GLFeature::texture_swizzle));
-
-    const bool needsSizedFormat = !gl->IsGLES();
+    const bool needSizedInternal = !gl->IsGLES();
+    MOZ_ASSERT_IF(needSizedInternal, gl->IsSupported(gl::GLFeature::texture_swizzle));
 
     ////////////////
 
     pi = {LOCAL_GL_RGBA, LOCAL_GL_FLOAT};
     dui = {pi.format, pi.format, pi.type};
     swizzle = nullptr;
-    if (needsSizedFormat) {
+    if (needSizedInternal) {
         dui.internalFormat = LOCAL_GL_RGBA32F;
     }
     fnAdd(webgl::EffectiveFormat::RGBA32F);
 
     //////
 
     pi = {LOCAL_GL_RGB, LOCAL_GL_FLOAT};
     dui = {pi.format, pi.format, pi.type};
     swizzle = nullptr;
-    if (needsSizedFormat) {
+    if (needSizedInternal) {
         dui.internalFormat = LOCAL_GL_RGB32F;
     }
     fnAdd(webgl::EffectiveFormat::RGB32F);
 
     //////
 
     pi = {LOCAL_GL_LUMINANCE, LOCAL_GL_FLOAT};
     dui = {pi.format, pi.format, pi.type};
     swizzle = nullptr;
-    if (needsSwizzle) {
+    if (needSizedInternal) {
         dui = {LOCAL_GL_R32F, LOCAL_GL_RED, LOCAL_GL_FLOAT};
         swizzle = webgl::FormatUsageInfo::kLuminanceSwizzleRGBA;
-    } else if (needsSizedFormat) {
-        dui.internalFormat = LOCAL_GL_LUMINANCE32F_ARB;
     }
     fnAdd(webgl::EffectiveFormat::Luminance32F);
 
     //////
 
     pi = {LOCAL_GL_ALPHA, LOCAL_GL_FLOAT};
     dui = {pi.format, pi.format, pi.type};
     swizzle = nullptr;
-    if (needsSwizzle) {
+    if (needSizedInternal) {
         dui = {LOCAL_GL_R32F, LOCAL_GL_RED, LOCAL_GL_FLOAT};
         swizzle = webgl::FormatUsageInfo::kAlphaSwizzleRGBA;
-    } else if (needsSizedFormat) {
-        dui.internalFormat = LOCAL_GL_ALPHA32F_ARB;
     }
     fnAdd(webgl::EffectiveFormat::Alpha32F);
 
     //////
 
     pi = {LOCAL_GL_LUMINANCE_ALPHA, LOCAL_GL_FLOAT};
     dui = {pi.format, pi.format, pi.type};
     swizzle = nullptr;
-    if (needsSwizzle) {
+    if (needSizedInternal) {
         dui = {LOCAL_GL_RG32F, LOCAL_GL_RG, LOCAL_GL_FLOAT};
         swizzle = webgl::FormatUsageInfo::kLumAlphaSwizzleRGBA;
-    } else if (needsSizedFormat) {
-        dui.internalFormat = LOCAL_GL_LUMINANCE_ALPHA32F_ARB;
     }
     fnAdd(webgl::EffectiveFormat::Luminance32FAlpha32F);
 }
 
 WebGLExtensionTextureFloat::~WebGLExtensionTextureFloat()
 {
 }
 
 bool
 WebGLExtensionTextureFloat::IsSupported(const WebGLContext* webgl)
 {
     gl::GLContext* gl = webgl->GL();
 
     if (!gl->IsSupported(gl::GLFeature::texture_float))
         return false;
 
-    const bool needsSwizzle = gl->IsCoreProfile();
+    const bool needSizedInternal = !gl->IsGLES();
     const bool hasSwizzle = gl->IsSupported(gl::GLFeature::texture_swizzle);
-    if (needsSwizzle && !hasSwizzle)
+
+    if (needSizedInternal && !hasSwizzle)
         return false;
 
     return true;
 }
 
 IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionTextureFloat, OES_texture_float)
 
 } // namespace mozilla
--- a/dom/canvas/WebGLExtensionTextureHalfFloat.cpp
+++ b/dom/canvas/WebGLExtensionTextureHalfFloat.cpp
@@ -25,83 +25,75 @@ WebGLExtensionTextureHalfFloat::WebGLExt
     {
         auto usage = fua->EditUsage(effFormat);
         usage->textureSwizzleRGBA = swizzle;
         fua->AddTexUnpack(usage, pi, dui);
 
         fua->AllowUnsizedTexFormat(pi, usage);
     };
 
-    const bool needsSwizzle = gl->IsCoreProfile();
-    MOZ_ASSERT_IF(needsSwizzle, gl->IsSupported(gl::GLFeature::texture_swizzle));
-
-    const bool needsSizedFormat = !gl->IsGLES();
+    const bool needSizedInternal = !gl->IsGLES();
+    MOZ_ASSERT_IF(needSizedInternal, gl->IsSupported(gl::GLFeature::texture_swizzle));
 
     GLenum driverUnpackType = LOCAL_GL_HALF_FLOAT;
     if (!gl->IsSupported(gl::GLFeature::texture_half_float)) {
         MOZ_ASSERT(gl->IsExtensionSupported(gl::GLContext::OES_texture_half_float));
         driverUnpackType = LOCAL_GL_HALF_FLOAT_OES;
     }
 
     ////////////////
 
     pi = {LOCAL_GL_RGBA, LOCAL_GL_HALF_FLOAT_OES};
     dui = {pi.format, pi.format, driverUnpackType};
     swizzle = nullptr;
-    if (needsSizedFormat) {
+    if (needSizedInternal) {
         dui.internalFormat = LOCAL_GL_RGBA16F;
     }
     fnAdd(webgl::EffectiveFormat::RGBA16F);
 
     //////
 
     pi = {LOCAL_GL_RGB, LOCAL_GL_HALF_FLOAT_OES};
     dui = {pi.format, pi.format, driverUnpackType};
     swizzle = nullptr;
-    if (needsSizedFormat) {
+    if (needSizedInternal) {
         dui.internalFormat = LOCAL_GL_RGB16F;
     }
     fnAdd(webgl::EffectiveFormat::RGB16F);
 
     //////
 
     pi = {LOCAL_GL_LUMINANCE, LOCAL_GL_HALF_FLOAT_OES};
     dui = {pi.format, pi.format, driverUnpackType};
     swizzle = nullptr;
-    if (needsSwizzle) {
+    if (needSizedInternal) {
         dui = {LOCAL_GL_R16F, LOCAL_GL_RED, driverUnpackType};
         swizzle = webgl::FormatUsageInfo::kLuminanceSwizzleRGBA;
-    } else if (needsSizedFormat) {
-        dui.internalFormat = LOCAL_GL_LUMINANCE16F_ARB;
     }
     fnAdd(webgl::EffectiveFormat::Luminance16F);
 
     //////
 
     pi = {LOCAL_GL_ALPHA, LOCAL_GL_HALF_FLOAT_OES};
     dui = {pi.format, pi.format, driverUnpackType};
     swizzle = nullptr;
-    if (needsSwizzle) {
+    if (needSizedInternal) {
         dui = {LOCAL_GL_R16F, LOCAL_GL_RED, driverUnpackType};
         swizzle = webgl::FormatUsageInfo::kAlphaSwizzleRGBA;
-    } else if (needsSizedFormat) {
-        dui.internalFormat = LOCAL_GL_ALPHA16F_ARB;
     }
     fnAdd(webgl::EffectiveFormat::Alpha16F);
 
     //////
 
     pi = {LOCAL_GL_LUMINANCE_ALPHA, LOCAL_GL_HALF_FLOAT_OES};
     dui = {pi.format, pi.format, driverUnpackType};
     swizzle = nullptr;
-    if (needsSwizzle) {
+    if (needSizedInternal) {
         dui = {LOCAL_GL_RG16F, LOCAL_GL_RG, driverUnpackType};
         swizzle = webgl::FormatUsageInfo::kLumAlphaSwizzleRGBA;
-    } else if (needsSizedFormat) {
-        dui.internalFormat = LOCAL_GL_LUMINANCE_ALPHA16F_ARB;
     }
     fnAdd(webgl::EffectiveFormat::Luminance16FAlpha16F);
 }
 
 WebGLExtensionTextureHalfFloat::~WebGLExtensionTextureHalfFloat()
 {
 }
 
@@ -111,19 +103,20 @@ WebGLExtensionTextureHalfFloat::IsSuppor
     gl::GLContext* gl = webgl->GL();
 
     if (!gl->IsSupported(gl::GLFeature::texture_half_float) &&
         !gl->IsExtensionSupported(gl::GLContext::OES_texture_half_float))
     {
         return false;
     }
 
-    const bool needsSwizzle = gl->IsCoreProfile();
+    const bool needSizedInternal = !gl->IsGLES();
     const bool hasSwizzle = gl->IsSupported(gl::GLFeature::texture_swizzle);
-    if (needsSwizzle && !hasSwizzle)
+
+    if (needSizedInternal && !hasSwizzle)
         return false;
 
     return true;
 }
 
 IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionTextureHalfFloat, OES_texture_half_float)
 
 } // namespace mozilla
--- a/dom/canvas/moz.build
+++ b/dom/canvas/moz.build
@@ -2,17 +2,17 @@
 # vim: set filetype=python:
 # 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/.
 
 TEST_DIRS += ['compiledtest']
 
 # Number changes to this file to avoid bug 1081323 (clobber after changing a manifest):
-# 4
+# 3
 
 MOCHITEST_MANIFESTS += [
     'test/crossorigin/mochitest.ini',
     'test/mochitest-subsuite-webgl.ini',
     'test/mochitest.ini',
 ]
 
 MOCHITEST_CHROME_MANIFESTS += ['test/chrome/chrome.ini']
--- a/dom/canvas/test/webgl-mochitest.ini
+++ b/dom/canvas/test/webgl-mochitest.ini
@@ -1,58 +1,17 @@
 [DEFAULT]
 subsuite = webgl
 skip-if = ((os == 'linux') && (buildapp == 'b2g'))
 
 support-files =
-  webgl-mochitest/ensure-exts/ensure-ext.js
   webgl-mochitest/driver-info.js
   webgl-mochitest/es3-data.js
   webgl-mochitest/webgl-util.js
 
-[webgl-mochitest/ensure-exts/test_ANGLE_instanced_arrays.html]
-fail-if = (os == 'android') || (os == 'mac')
-[webgl-mochitest/ensure-exts/test_EXT_blend_minmax.html]
-fail-if = (os == 'android')
-[webgl-mochitest/ensure-exts/test_EXT_color_buffer_half_float.html]
-fail-if = (os == 'android')
-[webgl-mochitest/ensure-exts/test_EXT_disjoint_timer_query.html]
-fail-if = (os == 'android') || (os == 'linux') || (os == 'mac') || (os == 'win')
-[webgl-mochitest/ensure-exts/test_EXT_frag_depth.html]
-fail-if = (os == 'android')
-[webgl-mochitest/ensure-exts/test_EXT_sRGB.html]
-fail-if = (os == 'android') || (os == 'linux') || (os == 'mac') || (os == 'win')
-[webgl-mochitest/ensure-exts/test_EXT_shader_texture_lod.html]
-fail-if = (os == 'android') || (os == 'linux') || (os == 'mac')
-[webgl-mochitest/ensure-exts/test_EXT_texture_filter_anisotropic.html]
-fail-if = (os == 'android') || (os == 'linux')
-[webgl-mochitest/ensure-exts/test_OES_standard_derivatives.html]
-fail-if = (os == 'android')
-[webgl-mochitest/ensure-exts/test_WEBGL_color_buffer_float.html]
-fail-if = (os == 'android')
-[webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_atc.html]
-fail-if = (os == 'android') || (os == 'linux') || (os == 'mac') || (os == 'win')
-[webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_es3.html]
-fail-if = (os == 'android') || (os == 'linux') || (os == 'mac') || (os == 'win')
-[webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_etc1.html]
-# Win7 is 6.1
-fail-if = (os == 'linux') || (os == 'mac') || (os == 'win' && os_version == '6.1')
-[webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_pvrtc.html]
-fail-if = (os == 'android') || (os == 'linux') || (os == 'mac') || (os == 'win')
-[webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_s3tc.html]
-fail-if = (os == 'android') || (os == 'linux')
-[webgl-mochitest/ensure-exts/test_WEBGL_depth_texture.html]
-fail-if = (os == 'mac')
-[webgl-mochitest/ensure-exts/test_WEBGL_draw_buffers.html]
-# Win7 is 6.1
-fail-if = (os == 'android') || (os == 'win' && os_version == '6.1')
-
-[webgl-mochitest/ensure-exts/test_common.html]
-
-
 [webgl-mochitest/test_backbuffer_channels.html]
 fail-if = (os == 'b2g')
 [webgl-mochitest/test_depth_readpixels.html]
 [webgl-mochitest/test_capture.html]
 support-files = captureStream_common.js
 [webgl-mochitest/test_cubemap_must_be_square.html]
 [webgl-mochitest/test_depth_tex_lazy_clear.html]
 [webgl-mochitest/test_draw.html]
deleted file mode 100644
--- a/dom/canvas/test/webgl-mochitest/ensure-exts/ensure-ext.js
+++ /dev/null
@@ -1,32 +0,0 @@
-'use strict';
-
-function EnsureExt(name, shouldBe = true) {
-    var c = document.createElement('canvas');
-    var gl = c.getContext('experimental-webgl');
-
-    if (shouldBe) {
-        ok(gl.getExtension(name), 'Should have extension ' + name + '.');
-    } else {
-        ok(!gl.getExtension(name), 'Should not have extension ' + name + '.');
-    }
-}
-
-function EnsureDraftExt(name, shouldBe = true) {
-    SimpleTest.waitForExplicitFinish();
-
-    var fnEnsure = function() {
-        EnsureExt(name, shouldBe);
-        SimpleTest.finish();
-    };
-
-    if ('SpecialPowers' in window) {
-        var prefStateList = [
-            ['webgl.enable-draft-extensions', true],
-        ];
-        var prefEnv = {'set': prefStateList};
-        SpecialPowers.pushPrefEnv(prefEnv, fnEnsure);
-    } else {
-        console.log('Couldn\'t use SpecialPowers to enable draft extensions.');
-        fnEnsure();
-    }
-}
deleted file mode 100644
--- a/dom/canvas/test/webgl-mochitest/ensure-exts/test_ANGLE_instanced_arrays.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <meta charset='utf-8'/>
-    <script src='/tests/SimpleTest/SimpleTest.js'></script>
-    <link rel='stylesheet' href='/tests/SimpleTest/test.css'>
-    <script src='ensure-ext.js'></script>
-  </head>
-  <body>
-    <script>
-
-'use strict';
-EnsureExt('ANGLE_instanced_arrays');
-
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_blend_minmax.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <meta charset='utf-8'/>
-    <script src='/tests/SimpleTest/SimpleTest.js'></script>
-    <link rel='stylesheet' href='/tests/SimpleTest/test.css'>
-    <script src='ensure-ext.js'></script>
-  </head>
-  <body>
-    <script>
-
-'use strict';
-EnsureExt('EXT_blend_minmax');
-
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_color_buffer_half_float.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <meta charset='utf-8'/>
-    <script src='/tests/SimpleTest/SimpleTest.js'></script>
-    <link rel='stylesheet' href='/tests/SimpleTest/test.css'>
-    <script src='ensure-ext.js'></script>
-  </head>
-  <body>
-    <script>
-
-'use strict';
-EnsureExt('EXT_color_buffer_half_float');
-
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_disjoint_timer_query.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <meta charset='utf-8'/>
-    <script src='/tests/SimpleTest/SimpleTest.js'></script>
-    <link rel='stylesheet' href='/tests/SimpleTest/test.css'>
-    <script src='ensure-ext.js'></script>
-  </head>
-  <body>
-    <script>
-
-'use strict';
-EnsureDraftExt('EXT_disjoint_timer_query');
-
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_frag_depth.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <meta charset='utf-8'/>
-    <script src='/tests/SimpleTest/SimpleTest.js'></script>
-    <link rel='stylesheet' href='/tests/SimpleTest/test.css'>
-    <script src='ensure-ext.js'></script>
-  </head>
-  <body>
-    <script>
-
-'use strict';
-EnsureExt('EXT_frag_depth');
-
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_sRGB.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <meta charset='utf-8'/>
-    <script src='/tests/SimpleTest/SimpleTest.js'></script>
-    <link rel='stylesheet' href='/tests/SimpleTest/test.css'>
-    <script src='ensure-ext.js'></script>
-  </head>
-  <body>
-    <script>
-
-'use strict';
-EnsureExt('EXT_sRGB');
-
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_shader_texture_lod.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <meta charset='utf-8'/>
-    <script src='/tests/SimpleTest/SimpleTest.js'></script>
-    <link rel='stylesheet' href='/tests/SimpleTest/test.css'>
-    <script src='ensure-ext.js'></script>
-  </head>
-  <body>
-    <script>
-
-'use strict';
-EnsureExt('EXT_shader_texture_lod');
-
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_texture_filter_anisotropic.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <meta charset='utf-8'/>
-    <script src='/tests/SimpleTest/SimpleTest.js'></script>
-    <link rel='stylesheet' href='/tests/SimpleTest/test.css'>
-    <script src='ensure-ext.js'></script>
-  </head>
-  <body>
-    <script>
-
-'use strict';
-EnsureExt('EXT_texture_filter_anisotropic');
-
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/dom/canvas/test/webgl-mochitest/ensure-exts/test_OES_standard_derivatives.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <meta charset='utf-8'/>
-    <script src='/tests/SimpleTest/SimpleTest.js'></script>
-    <link rel='stylesheet' href='/tests/SimpleTest/test.css'>
-    <script src='ensure-ext.js'></script>
-  </head>
-  <body>
-    <script>
-
-'use strict';
-EnsureExt('OES_standard_derivatives');
-
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_color_buffer_float.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <meta charset='utf-8'/>
-    <script src='/tests/SimpleTest/SimpleTest.js'></script>
-    <link rel='stylesheet' href='/tests/SimpleTest/test.css'>
-    <script src='ensure-ext.js'></script>
-  </head>
-  <body>
-    <script>
-
-'use strict';
-EnsureExt('WEBGL_color_buffer_float');
-
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_atc.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <meta charset='utf-8'/>
-    <script src='/tests/SimpleTest/SimpleTest.js'></script>
-    <link rel='stylesheet' href='/tests/SimpleTest/test.css'>
-    <script src='ensure-ext.js'></script>
-  </head>
-  <body>
-    <script>
-
-'use strict';
-EnsureExt('WEBGL_compressed_texture_atc');
-
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_es3.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <meta charset='utf-8'/>
-    <script src='/tests/SimpleTest/SimpleTest.js'></script>
-    <link rel='stylesheet' href='/tests/SimpleTest/test.css'>
-    <script src='ensure-ext.js'></script>
-  </head>
-  <body>
-    <script>
-
-'use strict';
-EnsureDraftExt('WEBGL_compressed_texture_es3');
-
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_etc1.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <meta charset='utf-8'/>
-    <script src='/tests/SimpleTest/SimpleTest.js'></script>
-    <link rel='stylesheet' href='/tests/SimpleTest/test.css'>
-    <script src='ensure-ext.js'></script>
-  </head>
-  <body>
-    <script>
-
-'use strict';
-EnsureExt('WEBGL_compressed_texture_etc1');
-
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_pvrtc.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <meta charset='utf-8'/>
-    <script src='/tests/SimpleTest/SimpleTest.js'></script>
-    <link rel='stylesheet' href='/tests/SimpleTest/test.css'>
-    <script src='ensure-ext.js'></script>
-  </head>
-  <body>
-    <script>
-
-'use strict';
-EnsureExt('WEBGL_compressed_texture_pvrtc');
-
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_s3tc.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <meta charset='utf-8'/>
-    <script src='/tests/SimpleTest/SimpleTest.js'></script>
-    <link rel='stylesheet' href='/tests/SimpleTest/test.css'>
-    <script src='ensure-ext.js'></script>
-  </head>
-  <body>
-    <script>
-
-'use strict';
-EnsureExt('WEBGL_compressed_texture_s3tc');
-
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_depth_texture.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <meta charset='utf-8'/>
-    <script src='/tests/SimpleTest/SimpleTest.js'></script>
-    <link rel='stylesheet' href='/tests/SimpleTest/test.css'>
-    <script src='ensure-ext.js'></script>
-  </head>
-  <body>
-    <script>
-
-'use strict';
-EnsureExt('WEBGL_depth_texture');
-
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_draw_buffers.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <meta charset='utf-8'/>
-    <script src='/tests/SimpleTest/SimpleTest.js'></script>
-    <link rel='stylesheet' href='/tests/SimpleTest/test.css'>
-    <script src='ensure-ext.js'></script>
-  </head>
-  <body>
-    <script>
-
-'use strict';
-EnsureExt('WEBGL_draw_buffers');
-
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/dom/canvas/test/webgl-mochitest/ensure-exts/test_common.html
+++ /dev/null
@@ -1,75 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <meta charset='utf-8'/>
-    <script src='/tests/SimpleTest/SimpleTest.js'></script>
-    <link rel='stylesheet' href='/tests/SimpleTest/test.css'>
-  </head>
-  <body>
-    <script>
-
-'use strict';
-
-var c = document.createElement('canvas');
-var gl = c.getContext('experimental-webgl');
-
-function ensureExt(name) {
-  ok(gl.getExtension(name), 'Should have extension ' + name + '.');
-}
-
-function ensureNoExt(name) {
-  ok(!gl.getExtension(name), 'Should not have extension ' + name + '.');
-}
-
-do {
-  if (!gl)
-    break;
-
-  // These aren't all guaranteed, but they're common to all our test slaves.
-  // If you're adding a slave config that is missing one of these, comment the line out
-  // and split it into its own test.
-
-  // Implemented. (commented out if not test-slave-universal)
-  //ensureExt('ANGLE_instanced_arrays');
-  //ensureExt('EXT_blend_minmax');
-  //ensureExt('EXT_color_buffer_half_float');
-  //ensureExt('EXT_frag_depth');
-  //ensureExt('EXT_shader_texture_lod');
-  //ensureExt('EXT_sRGB');
-  //ensureExt('EXT_texture_filter_anisotropic');
-  ensureExt('OES_element_index_uint');
-  //ensureExt('OES_standard_derivatives');
-  ensureExt('OES_texture_float');
-  ensureExt('OES_texture_float_linear');
-  ensureExt('OES_texture_half_float');
-  ensureExt('OES_texture_half_float_linear');
-  ensureExt('OES_vertex_array_object');
-  //ensureExt('WEBGL_color_buffer_float');
-  //ensureExt('WEBGL_compressed_texture_atc');
-  //ensureExt('WEBGL_compressed_texture_es3');
-  //ensureExt('WEBGL_compressed_texture_etc1');
-  //ensureExt('WEBGL_compressed_texture_pvrtc');
-  //ensureExt('WEBGL_compressed_texture_s3tc');
-  //ensureExt('WEBGL_depth_texture');
-  //ensureExt('WEBGL_draw_buffers');
-  ensureExt('WEBGL_lose_context');
-
-  // Draft extensions, which should not be exposed by default.
-  ensureNoExt('EXT_disjoint_timer_query');
-  ensureNoExt('WEBGL_compressed_texture_es3');
-
-  // Not implemented.
-  ensureNoExt('EXT_color_buffer_float');
-  ensureNoExt('OES_fbo_render_mipmap');
-  ensureNoExt('WEBGL_compressed_texture_astc');
-  ensureNoExt('WEBGL_security_sensitive_resources');
-  ensureNoExt('WEBGL_shared_resources');
-
-  // Privileged
-  //ensureExt('WEBGL_debug_renderer_info');
-  //ensureExt('WEBGL_debug_shaders');
-} while (false);
-
-    </script>
-  </body>
-</html>
--- a/dom/canvas/test/webgl-mochitest/mochi-to-testcase.py
+++ b/dom/canvas/test/webgl-mochitest/mochi-to-testcase.py
@@ -23,18 +23,17 @@ def ReadLocalFile(include):
 
     try:
         f.close()
     except:
         pass
 
     return data
 
-kSimpleTestReplacement = '''
-
+kSimpleTestReplacement = '''\n
 <script>
 // SimpleTest.js replacement
 
 function debug(text) {
   var elem = document.getElementById('mochi-to-testcase-output');
   elem.innerHTML += '\\n<br/>\\n' + text;
 }
 
@@ -48,22 +47,20 @@ function todo(val, text) {
   var status = val ? 'Test <font color=\\'orange\\'>UNEXPECTED PASS</font>: '
                    : 'Test <font color=\\'blue\\'  >todo</font>: ';
   debug(status + text);
 }
 
 SimpleTest = {
   waitForExplicitFinish: function() {},
   finish: function() {},
-  requestFlakyTimeout: function() {},
 };
 </script>
 <div id='mochi-to-testcase-output'></div>
-
-'''
+\n'''
 
 fin = open(mochiPath, 'rb')
 fout = open(testPath, 'wb')
 includePattern = re.compile('<script\\s*src=[\'"](.*)\\.js[\'"]>\\s*</script>')
 cssPattern = re.compile('<link\\s*rel=[\'"]stylesheet[\'"]\\s*href=[\'"]([^=>]*)[\'"]>')
 for line in fin:
     skipLine = False
     for css in cssPattern.findall(line):