Bug 1403413 - Remove deprecated MOZ_ extension prefix aliases. - r=daoshengmu draft
authorJeff Gilbert <jgilbert@mozilla.com>
Tue, 26 Sep 2017 19:07:41 -0700
changeset 670886 80ca5570aa21c21d8a269ee9144b1598e4350c4f
parent 665088 8e818b5e9b6bef0fc1a5c527ecf30b0d56a02f14
child 733346 fe02b718bc8ab11007264d1ce5fda208b0cb206a
push id81750
push userbmo:jgilbert@mozilla.com
push dateWed, 27 Sep 2017 02:14:51 +0000
reviewersdaoshengmu
bugs1403413
milestone57.0a1
Bug 1403413 - Remove deprecated MOZ_ extension prefix aliases. - r=daoshengmu MozReview-Commit-ID: JM5pVKW8po7
dom/canvas/WebGLContextExtensions.cpp
--- a/dom/canvas/WebGLContextExtensions.cpp
+++ b/dom/canvas/WebGLContextExtensions.cpp
@@ -274,47 +274,16 @@ WebGLContext::GetExtension(JSContext* cx
         WebGLExtensionID extension = WebGLExtensionID(i);
 
         if (CompareWebGLExtensionName(name, GetExtensionString(extension))) {
             ext = extension;
             break;
         }
     }
 
-    if (ext == WebGLExtensionID::Unknown) {
-        // We keep backward compatibility for these deprecated vendor-prefixed
-        // alias. Do not add new ones anymore. Hide it behind the
-        // webgl.enable-draft-extensions flag instead.
-
-        if (CompareWebGLExtensionName(name, "MOZ_WEBGL_lose_context")) {
-            ext = WebGLExtensionID::WEBGL_lose_context;
-
-        } else if (CompareWebGLExtensionName(name, "MOZ_WEBGL_compressed_texture_s3tc")) {
-            ext = WebGLExtensionID::WEBGL_compressed_texture_s3tc;
-
-        } else if (CompareWebGLExtensionName(name, "MOZ_WEBGL_compressed_texture_atc")) {
-            ext = WebGLExtensionID::WEBGL_compressed_texture_atc;
-
-        } else if (CompareWebGLExtensionName(name, "MOZ_WEBGL_compressed_texture_pvrtc")) {
-            ext = WebGLExtensionID::WEBGL_compressed_texture_pvrtc;
-
-        } else if (CompareWebGLExtensionName(name, "MOZ_WEBGL_depth_texture")) {
-            ext = WebGLExtensionID::WEBGL_depth_texture;
-        }
-
-        if (ext != WebGLExtensionID::Unknown) {
-            GenerateWarning("getExtension('%s'): MOZ_ prefixed WebGL extension"
-                            " strings are deprecated. Support for them will be"
-                            " removed in the future. Use unprefixed extension"
-                            " strings. To get draft extensions, set the"
-                            " webgl.enable-draft-extensions preference.",
-                            name.get());
-        }
-    }
-
     if (ext == WebGLExtensionID::Unknown)
         return;
 
     // step 2: check if the extension is supported
     if (!IsExtensionSupported(callerType, ext))
         return;
 
     // step 3: if the extension hadn't been previously been created, create it now, thus enabling it
@@ -468,31 +437,11 @@ WebGLContext::GetSupportedExtensions(dom
     for (size_t i = 0; i < size_t(WebGLExtensionID::Max); i++) {
         WebGLExtensionID extension = WebGLExtensionID(i);
 
         if (IsExtensionSupported(callerType, extension)) {
             const char* extStr = GetExtensionString(extension);
             arr.AppendElement(NS_ConvertUTF8toUTF16(extStr));
         }
     }
-
-    /**
-     * We keep backward compatibility for these deprecated vendor-prefixed
-     * alias. Do not add new ones anymore. Hide it behind the
-     * webgl.enable-draft-extensions flag instead.
-     */
-    if (IsExtensionSupported(callerType, WebGLExtensionID::WEBGL_lose_context))
-        arr.AppendElement(NS_LITERAL_STRING("MOZ_WEBGL_lose_context"));
-    if (IsExtensionSupported(callerType,
-                             WebGLExtensionID::WEBGL_compressed_texture_s3tc))
-        arr.AppendElement(NS_LITERAL_STRING("MOZ_WEBGL_compressed_texture_s3tc"));
-    if (IsExtensionSupported(callerType,
-                             WebGLExtensionID::WEBGL_compressed_texture_atc))
-        arr.AppendElement(NS_LITERAL_STRING("MOZ_WEBGL_compressed_texture_atc"));
-    if (IsExtensionSupported(callerType,
-                             WebGLExtensionID::WEBGL_compressed_texture_pvrtc))
-        arr.AppendElement(NS_LITERAL_STRING("MOZ_WEBGL_compressed_texture_pvrtc"));
-    if (IsExtensionSupported(callerType,
-                             WebGLExtensionID::WEBGL_depth_texture))
-        arr.AppendElement(NS_LITERAL_STRING("MOZ_WEBGL_depth_texture"));
 }
 
 } // namespace mozilla