Bug 1160200 - APNG can't be used with type switching. r=mcaceres, sr=jrmuizel

This commit is contained in:
David Newton 2015-09-25 11:36:00 +02:00
parent 92113d4c99
commit 8d3167cc60
10 changed files with 18 additions and 0 deletions

View File

@ -34,6 +34,8 @@ DecoderFactory::GetDecoderType(const char* aMimeType)
type = DecoderType::PNG;
} else if (!strcmp(aMimeType, IMAGE_X_PNG)) {
type = DecoderType::PNG;
} else if (!strcmp(aMimeType, IMAGE_APNG)) {
type = DecoderType::PNG;
// GIF
} else if (!strcmp(aMimeType, IMAGE_GIF)) {

View File

@ -77,6 +77,7 @@ static const mozilla::Module::CategoryEntry kImageCategories[] = {
{ "Gecko-Content-Viewers", IMAGE_BMP_MS, "@mozilla.org/content/document-loader-factory;1" },
{ "Gecko-Content-Viewers", IMAGE_ICON_MS, "@mozilla.org/content/document-loader-factory;1" },
{ "Gecko-Content-Viewers", IMAGE_PNG, "@mozilla.org/content/document-loader-factory;1" },
{ "Gecko-Content-Viewers", IMAGE_APNG, "@mozilla.org/content/document-loader-factory;1" },
{ "Gecko-Content-Viewers", IMAGE_X_PNG, "@mozilla.org/content/document-loader-factory;1" },
{ "content-sniffing-services", "@mozilla.org/image/loader;1", "@mozilla.org/image/loader;1" },
{ nullptr }

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

View File

@ -0,0 +1,3 @@
<!doctype html>
<title>apng expected</title>
<img src="animated.apng">

View File

@ -0,0 +1 @@
== test.html expected.html

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

View File

@ -0,0 +1,6 @@
<!doctype html>
<title>apng test</title>
<picture>
<source type="video/vnd.mozilla.apng" srcset="animated.apng">
<img src="static.png">
</picture>

View File

@ -19,6 +19,9 @@ include w3c-css/received/reftest.list
include abs-pos/reftest.list
include position-relative/reftest.list
# apng-mime
include apng-mime/reftest.list
include async-scrolling/reftest.list
# backgrounds/

View File

@ -94,6 +94,7 @@
#define IMAGE_JPG "image/jpg"
#define IMAGE_PJPEG "image/pjpeg"
#define IMAGE_PNG "image/png"
#define IMAGE_APNG "video/vnd.mozilla.apng"
#define IMAGE_X_PNG "image/x-png"
#define IMAGE_PPM "image/x-portable-pixmap"
#define IMAGE_XBM "image/x-xbitmap"

View File

@ -576,6 +576,7 @@ static nsExtraMimeTypeEntry extraMimeEntries [] =
{ IMAGE_ICO, "ico,cur", "ICO Image" },
{ IMAGE_JPEG, "jpeg,jpg,jfif,pjpeg,pjp", "JPEG Image" },
{ IMAGE_PNG, "png", "PNG Image" },
{ IMAGE_APNG, "apng", "APNG Image" },
{ IMAGE_TIFF, "tiff,tif", "TIFF Image" },
{ IMAGE_XBM, "xbm", "XBM Image" },
{ IMAGE_SVG_XML, "svg", "Scalable Vector Graphics" },