[AppleWin] Assertion failure in defaultSupportedImageTypes in UTIRegistry.cpp
authorHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Sep 2019 03:05:13 +0000 (03:05 +0000)
committerHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Sep 2019 03:05:13 +0000 (03:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=198286

Reviewed by Brent Fulgham.

Some image types aren't supported by CG for Windows.

No new tests, covered by existing tests.

* platform/graphics/cg/ImageSourceCGWin.cpp:
(WebCore::MIMETypeForImageType): Return the correct MIME types for
com.microsoft.cur and com.microsoft.ico.
* platform/graphics/cg/UTIRegistry.cpp:
(WebCore::defaultSupportedImageTypes): Excluded public.jpeg-2000 and public.mpo-image if PLATFORM(WIN).

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249938 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cg/ImageSourceCGWin.cpp
Source/WebCore/platform/graphics/cg/UTIRegistry.cpp

index 136b91c..d8bc68a 100644 (file)
@@ -1,5 +1,22 @@
 2019-09-16  Fujii Hironori  <Hironori.Fujii@sony.com>
 
+        [AppleWin] Assertion failure in defaultSupportedImageTypes in UTIRegistry.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=198286
+
+        Reviewed by Brent Fulgham.
+
+        Some image types aren't supported by CG for Windows.
+
+        No new tests, covered by existing tests.
+
+        * platform/graphics/cg/ImageSourceCGWin.cpp:
+        (WebCore::MIMETypeForImageType): Return the correct MIME types for
+        com.microsoft.cur and com.microsoft.ico.
+        * platform/graphics/cg/UTIRegistry.cpp:
+        (WebCore::defaultSupportedImageTypes): Excluded public.jpeg-2000 and public.mpo-image if PLATFORM(WIN).
+
+2019-09-16  Fujii Hironori  <Hironori.Fujii@sony.com>
+
         [Cairo] Image::drawTiled → Cairo::drawSurface → cairo_paint_with_alpha → segfault happens in pixman
         https://bugs.webkit.org/show_bug.cgi?id=201755
 
index f0206ea..5fe8252 100644 (file)
@@ -39,7 +39,9 @@ String MIMETypeForImageType(const String& type)
     // a MIME type like image/type will work for common image UTIs like jpeg, 
     // png, tiff, gif but won't work for UTIs like: public.jpeg-2000,
     // public.xbitmap-image, com.apple.quicktime-image, and others.
-    if (int dotLocation = type.reverseFind('.'))
+    if (type == "com.microsoft.cur" || type == "com.microsoft.ico")
+        mimeType = "image/vnd.microsoft.icon"_s;
+    else if (int dotLocation = type.reverseFind('.'))
         mimeType = "image/" + type.substring(dotLocation + 1);
     return mimeType;
 }
index b8c2ab5..8501da0 100644 (file)
@@ -50,10 +50,12 @@ const HashSet<String>& defaultSupportedImageTypes()
         "com.microsoft.cur",
         "com.microsoft.ico",
         "public.jpeg",
-        "public.jpeg-2000",
-        "public.mpo-image",
         "public.png",
         "public.tiff",
+#if !PLATFORM(WIN)
+        "public.jpeg-2000",
+        "public.mpo-image",
+#endif
     };
 
 #ifndef NDEBUG