Bug 759178 - WebGL extension strings should be case-insensitive - r=jgilbert
authorBenoit Jacob <bjacob@mozilla.com>
Wed, 30 May 2012 08:30:32 -0400
changeset 95280 d9e6d8a66f9ca18b29c8ce2d3c4133730d7690a3
parent 95279 d92215a6eea10cbed38fd24463347ebb40969fa8
child 95281 99ecf8cabde391ea056a11ca97aa8a6ccfed741c
push id22801
push useremorley@mozilla.com
push dateThu, 31 May 2012 12:15:52 +0000
treeherdermozilla-central@d6ae9ef0eb50 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs759178
milestone15.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 759178 - WebGL extension strings should be case-insensitive - r=jgilbert
content/canvas/src/WebGLContext.cpp
--- a/content/canvas/src/WebGLContext.cpp
+++ b/content/canvas/src/WebGLContext.cpp
@@ -906,35 +906,37 @@ WebGLContext::GetExtension(const nsAStri
 {
     if (!IsContextStable())
         return nsnull;
     
     if (mDisableExtensions) {
         return nsnull;
     }
 
-    // handle simple extensions that don't need custom objects first
+    nsString lowerCaseName(aName);
+    ToLowerCase(lowerCaseName);
+
     WebGLExtensionID ei = WebGLExtensionID_Max;
-    if (aName.EqualsLiteral("OES_texture_float")) {
+    if (lowerCaseName.EqualsLiteral("oes_texture_float")) {
         if (IsExtensionSupported(WebGL_OES_texture_float))
             ei = WebGL_OES_texture_float;
     }
-    else if (aName.EqualsLiteral("OES_standard_derivatives")) {
+    else if (lowerCaseName.EqualsLiteral("oes_standard_derivatives")) {
         if (IsExtensionSupported(WebGL_OES_standard_derivatives))
             ei = WebGL_OES_standard_derivatives;
     }
-    else if (aName.EqualsLiteral("MOZ_EXT_texture_filter_anisotropic")) {
+    else if (lowerCaseName.EqualsLiteral("moz_ext_texture_filter_anisotropic")) {
         if (IsExtensionSupported(WebGL_EXT_texture_filter_anisotropic))
             ei = WebGL_EXT_texture_filter_anisotropic;
     }
-    else if (aName.EqualsLiteral("MOZ_WEBGL_lose_context")) {
+    else if (lowerCaseName.EqualsLiteral("moz_webgl_lose_context")) {
         if (IsExtensionSupported(WebGL_WEBGL_lose_context))
             ei = WebGL_WEBGL_lose_context;
     }
-    else if (aName.EqualsLiteral("MOZ_WEBGL_compressed_texture_s3tc")) {
+    else if (lowerCaseName.EqualsLiteral("moz_webgl_compressed_texture_s3tc")) {
         if (IsExtensionSupported(WebGL_WEBGL_compressed_texture_s3tc))
             ei = WebGL_WEBGL_compressed_texture_s3tc;
     }
 
     if (ei != WebGLExtensionID_Max) {
         if (!IsExtensionEnabled(ei)) {
             switch (ei) {
                 case WebGL_OES_standard_derivatives: