Bug 1403413 - Remove deprecated MOZ_ extension prefix aliases. - r=daoshengmu
MozReview-Commit-ID: JM5pVKW8po7
--- 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