MediaPlayerPrivateQTKit claims it supports application/x-diskcopy, breaking downloads.
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Jan 2013 18:20:30 +0000 (18:20 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Jan 2013 18:20:30 +0000 (18:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=108237

Reviewed by Eric Carlson.

Disclaim any non-'video/' or 'audio/' types which QTKit purports to support.

* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::addFileTypesToCache):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm

index 5d630bb..4fd53e5 100644 (file)
@@ -1,3 +1,15 @@
+2013-01-29  Jer Noble  <jer.noble@apple.com>
+
+        MediaPlayerPrivateQTKit claims it supports application/x-diskcopy, breaking downloads.
+        https://bugs.webkit.org/show_bug.cgi?id=108237
+
+        Reviewed by Eric Carlson.
+
+        Disclaim any non-'video/' or 'audio/' types which QTKit purports to support.
+
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+        (WebCore::addFileTypesToCache):
+
 2013-01-30  Florin Malita  <fmalita@chromium.org>
 
         Do not restart the matched properties cache timer if active
index 4a7021a..59f73fa 100644 (file)
@@ -1476,8 +1476,15 @@ static void addFileTypesToCache(NSArray * fileTypes, HashSet<String> &cache)
             Vector<String> typesForExtension = MIMETypeRegistry::getMediaMIMETypesForExtension(ext);
             unsigned count = typesForExtension.size();
             for (unsigned ndx = 0; ndx < count; ++ndx) {
-                if (!cache.contains(typesForExtension[ndx]))
-                    cache.add(typesForExtension[ndx]);
+                String& type = typesForExtension[ndx];
+
+                // QTKit will return non-video MIME types which it claims to support, but which we
+                // do not support in the <video> element. Disclaim all non video/ or audio/ types.
+                if (!type.startsWith("video/") && !type.startsWith("audio/"))
+                    continue;
+
+                if (!cache.contains(type))
+                    cache.add(type);
             }
         }
     }