Bug 1160200 - APNG can't be used with type switching. r=mcaceres, sr=jrmuizel
☠☠ backed out by 7031e812cdfc ☠ ☠
authorDavid Newton <david@davidnewton.ca>
Fri, 25 Sep 2015 11:36:00 +0200
changeset 264895 b4f64c940524954c6c5030a74178344c7dad1375
parent 264894 5247e8b25d9bbbdd2b4101356af70f030bb7a556
child 264896 8f53bcade67e1824ef54ea95b1489f935910ece5
push id65781
push usercbook@mozilla.com
push dateTue, 29 Sep 2015 07:04:29 +0000
treeherdermozilla-inbound@1b689889510b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcaceres, jrmuizel
bugs1160200
milestone44.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 1160200 - APNG can't be used with type switching. r=mcaceres, sr=jrmuizel
image/DecoderFactory.cpp
image/build/nsImageModule.cpp
layout/reftests/apng-mime/animated.apng
layout/reftests/apng-mime/expected.html
layout/reftests/apng-mime/reftest.list
layout/reftests/apng-mime/static.png
layout/reftests/apng-mime/test.html
layout/reftests/reftest.list
netwerk/mime/nsMimeTypes.h
uriloader/exthandler/nsExternalHelperAppService.cpp
--- a/image/DecoderFactory.cpp
+++ b/image/DecoderFactory.cpp
@@ -29,16 +29,18 @@ DecoderFactory::GetDecoderType(const cha
   // By default we don't know.
   DecoderType type = DecoderType::UNKNOWN;
 
   // PNG
   if (!strcmp(aMimeType, IMAGE_PNG)) {
     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)) {
     type = DecoderType::GIF;
 
   // JPEG
   } else if (!strcmp(aMimeType, IMAGE_JPEG)) {
     type = DecoderType::JPEG;
--- a/image/build/nsImageModule.cpp
+++ b/image/build/nsImageModule.cpp
@@ -72,16 +72,17 @@ static const mozilla::Module::CategoryEn
   { "Gecko-Content-Viewers", IMAGE_PJPEG, "@mozilla.org/content/document-loader-factory;1" },
   { "Gecko-Content-Viewers", IMAGE_JPG, "@mozilla.org/content/document-loader-factory;1" },
   { "Gecko-Content-Viewers", IMAGE_ICO, "@mozilla.org/content/document-loader-factory;1" },
   { "Gecko-Content-Viewers", IMAGE_ICO_MS, "@mozilla.org/content/document-loader-factory;1" },
   { "Gecko-Content-Viewers", IMAGE_BMP, "@mozilla.org/content/document-loader-factory;1" },
   { "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 }
 };
 
 static bool sInitialized = false;
 nsresult
 mozilla::image::InitModule()
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a310055bb899e99249f157582bc4f7f873fcff2b
GIT binary patch
literal 361
zc%17D@N?(olHy`uVBq!ia0vp^DIm<j3?$ucQqzDGM`Ch_50GX8VusJXlM8?pXMj(L
z>pw;&hW|jw@M)f~98i$4B*-tA!Qt5rkS?h-h%N@0kqiuQ9*~_IeMl3?w)J#z49U3n
z_N*Z<0|O89f~Egl&%5@s@f2uI@K6!zbWxg!lS)yjT=L&faY>et7?O32*sc4fq45{U
zc1%lg3;}rsWTm4Z&`PESH}`*u`te}_!*nLR)`2LtN$k&z)CCVDi<SZnktlJEC<)F_
oD=AMbN@YmTOfyO>$V=BNPSeXvEt&RT_yovyPgg&ebxsLQ09ck?1^@s6
new file mode 100644
--- /dev/null
+++ b/layout/reftests/apng-mime/expected.html
@@ -0,0 +1,3 @@
+<!doctype html>
+<title>apng expected</title>
+<img src="animated.apng">
new file mode 100644
--- /dev/null
+++ b/layout/reftests/apng-mime/reftest.list
@@ -0,0 +1,1 @@
+== test.html expected.html
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..6f76d4438724111983a11860f13568361b52d9bc
GIT binary patch
literal 100
zc%17D@N?(olHy`uVBq!ia0vp^CqS5y8Awi_W^)%vF$egBxTd6}EPfSw1jv=~ba4!k
rkbHZv5y)XUyx@1R|3ikWAU1;^qeuV)<1IPC3=q%L)z4*}Q$iB}r??p{
new file mode 100644
--- /dev/null
+++ b/layout/reftests/apng-mime/test.html
@@ -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>
--- a/layout/reftests/reftest.list
+++ b/layout/reftests/reftest.list
@@ -14,16 +14,19 @@ include ../../image/test/reftest/reftest
 # CSSWG tests
 include w3c-css/submitted/reftest.list
 include w3c-css/received/reftest.list
 
 # relative and absolute positioning
 include abs-pos/reftest.list
 include position-relative/reftest.list
 
+# apng-mime
+include apng-mime/reftest.list
+
 include async-scrolling/reftest.list
 
 # backgrounds/
 include backgrounds/reftest.list
 
 # bidi/
 include bidi/reftest.list
 
--- a/netwerk/mime/nsMimeTypes.h
+++ b/netwerk/mime/nsMimeTypes.h
@@ -89,16 +89,17 @@
 
 #define BINARY_OCTET_STREAM                 "binary/octet-stream"
 
 #define IMAGE_GIF                           "image/gif"
 #define IMAGE_JPEG                          "image/jpeg"
 #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"
 #define IMAGE_XBM2                          "image/x-xbm"
 #define IMAGE_XBM3                          "image/xbm"
 #define IMAGE_ART                           "image/x-jg"
 #define IMAGE_TIFF                          "image/tiff"
 #define IMAGE_BMP                           "image/bmp"
--- a/uriloader/exthandler/nsExternalHelperAppService.cpp
+++ b/uriloader/exthandler/nsExternalHelperAppService.cpp
@@ -571,16 +571,17 @@ static nsExtraMimeTypeEntry extraMimeEnt
   { "application/vnd.android.package-archive", "apk", "Android Package" },
 #endif
   { IMAGE_ART, "art", "ART Image" },
   { IMAGE_BMP, "bmp", "BMP Image" },
   { IMAGE_GIF, "gif", "GIF Image" },
   { 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" },
   { MESSAGE_RFC822, "eml", "RFC-822 data" },
   { TEXT_PLAIN, "txt,text", "Text File" },
   { TEXT_HTML, "html,htm,shtml,ehtml", "HyperText Markup Language" },
   { "application/xhtml+xml", "xhtml,xht", "Extensible HyperText Markup Language" },
   { APPLICATION_MATHML_XML, "mml", "Mathematical Markup Language" },