Skip to content

Commit

Permalink
Bug 1160200 - APNG can't be used with type switching. r=mcaceres,r=jr…
Browse files Browse the repository at this point in the history
…muizel
  • Loading branch information
nwtn committed Apr 20, 2016
1 parent 8da6e99 commit 21e4502
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions image/DecoderFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
1 change: 1 addition & 0 deletions image/build/nsImageModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,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 }
Expand Down
Binary file added layout/reftests/apng-mime/animated.apng
Binary file not shown.
3 changes: 3 additions & 0 deletions layout/reftests/apng-mime/expected.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!doctype html>
<title>apng expected</title>
<img src="animated.apng">
1 change: 1 addition & 0 deletions layout/reftests/apng-mime/reftest.list
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
== test.html expected.html
Binary file added layout/reftests/apng-mime/static.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions layout/reftests/apng-mime/test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!doctype html>
<title>apng test</title>
<picture>
<source type="image/apng" srcset="animated.apng">
<img src="static.png">
</picture>
3 changes: 3 additions & 0 deletions layout/reftests/reftest.list
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
1 change: 1 addition & 0 deletions netwerk/mime/nsMimeTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
#define IMAGE_JPG "image/jpg"
#define IMAGE_PJPEG "image/pjpeg"
#define IMAGE_PNG "image/png"
#define IMAGE_APNG "image/apng"
#define IMAGE_X_PNG "image/x-png"
#define IMAGE_PPM "image/x-portable-pixmap"
#define IMAGE_XBM "image/x-xbitmap"
Expand Down
1 change: 1 addition & 0 deletions uriloader/exthandler/nsExternalHelperAppService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ static const 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" },
Expand Down

0 comments on commit 21e4502

Please sign in to comment.