Unreviewed, rolling out r215767.
authorryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Apr 2017 16:13:02 +0000 (16:13 +0000)
committerryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Apr 2017 16:13:02 +0000 (16:13 +0000)
The LayoutTest for this change is a flaky failure.

Reverted changeset:

"Restrict WebKit image formats to a known whitelist"
https://bugs.webkit.org/show_bug.cgi?id=170700
http://trac.webkit.org/changeset/215767

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

LayoutTests/ChangeLog
LayoutTests/fast/images/image-formats-support-expected.txt [deleted file]
LayoutTests/fast/images/image-formats-support.html [deleted file]
LayoutTests/fast/images/resources/100x100-red-psd-renamed.png [deleted file]
LayoutTests/fast/images/resources/100x100-red-tga-renamed.png [deleted file]
LayoutTests/fast/images/resources/100x100-red.psd [deleted file]
LayoutTests/fast/images/resources/100x100-red.tga [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/loader/cache/CachedImage.cpp
Source/WebCore/loader/cache/CachedImage.h

index 7a28fbd..61cb794 100644 (file)
@@ -1,3 +1,15 @@
+2017-04-26  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r215767.
+
+        The LayoutTest for this change is a flaky failure.
+
+        Reverted changeset:
+
+        "Restrict WebKit image formats to a known whitelist"
+        https://bugs.webkit.org/show_bug.cgi?id=170700
+        http://trac.webkit.org/changeset/215767
+
 2017-04-24  Sergio Villar Senin  <svillar@igalia.com>
 
         [css-grid] Remove most of the usage of SizingOperation
diff --git a/LayoutTests/fast/images/image-formats-support-expected.txt b/LayoutTests/fast/images/image-formats-support-expected.txt
deleted file mode 100644 (file)
index 26d0d6b..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-Test the whitelist of the image formats in WebKit.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS shouldBeSupported('resources/100x100-red.psd').toString() is 'false'
-PASS shouldBeSupported('resources/100x100-red.tga').toString() is 'false'
-PASS shouldBeSupported('resources/100x100-red-psd-renamed.png').toString() is 'false'
-PASS shouldBeSupported('resources/100x100-red-tga-renamed.png').toString() is 'false'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-      
diff --git a/LayoutTests/fast/images/image-formats-support.html b/LayoutTests/fast/images/image-formats-support.html
deleted file mode 100644 (file)
index 4d8faa6..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<style>
-    img {
-        width: 100px;
-        height: 100px;
-    }
-</style>
-</head>
-<body>
-    <img id="image-1" src="">
-    <img id="image-2" src="">
-    <img id="image-3" src="">
-    <img id="image-4" src="">
-    <script>
-        // The test finishes after getting the results of loading all the images.
-        jsTestIsAsync = true;
-
-        description("Test the whitelist of the image formats in WebKit.");
-
-        var images = [
-            { id: "image-1", src: "resources/100x100-red.psd", shouldBeSupported: false },
-            { id: "image-2", src: "resources/100x100-red.tga", shouldBeSupported: false },
-            { id: "image-3", src: "resources/100x100-red-psd-renamed.png", shouldBeSupported: false },
-            { id: "image-4", src: "resources/100x100-red-tga-renamed.png", shouldBeSupported: false },
-        ];
-
-        var finishedImages = 0;
-
-        function trimImageSource(src) {
-            var index = src.lastIndexOf('/');
-            if (index != -1)
-                index = src.lastIndexOf('/', index - 1);
-            return index != -1 ? src.slice(index + 1) : src;
-        }
-
-        function shouldBeSupported(src) {
-            var image = images.find(function(image) {
-                return image.src == src;
-            });
-
-            if (image == undefined) {
-                debug("Error: Unknown image src.");
-                return false;
-            }
-
-            return image.shouldBeSupported;
-        }
-
-        function onImageFinish(src, isSupported) {
-            shouldBe("shouldBeSupported('" + trimImageSource(src) + "').toString()", "'" + isSupported + "'");
-            if (++finishedImages == images.length)
-                finishJSTest();
-        }
-
-        function onImageLoad(event) {
-            onImageFinish(document.getElementById(event.target.id).src, true);
-        }
-
-        function onImageError() {
-            onImageFinish(document.getElementById(event.target.id).src, false);
-        }
-
-        images.forEach(function(image) {
-            var element = document.getElementById(image.id);
-            element.onload = onImageLoad;
-            element.onerror = onImageError;
-            document.getElementById(image.id).src = image.src;
-        });
-    </script>
-    <script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
diff --git a/LayoutTests/fast/images/resources/100x100-red-psd-renamed.png b/LayoutTests/fast/images/resources/100x100-red-psd-renamed.png
deleted file mode 100644 (file)
index f74ccaf..0000000
Binary files a/LayoutTests/fast/images/resources/100x100-red-psd-renamed.png and /dev/null differ
diff --git a/LayoutTests/fast/images/resources/100x100-red-tga-renamed.png b/LayoutTests/fast/images/resources/100x100-red-tga-renamed.png
deleted file mode 100644 (file)
index 06958ba..0000000
Binary files a/LayoutTests/fast/images/resources/100x100-red-tga-renamed.png and /dev/null differ
diff --git a/LayoutTests/fast/images/resources/100x100-red.psd b/LayoutTests/fast/images/resources/100x100-red.psd
deleted file mode 100644 (file)
index f74ccaf..0000000
Binary files a/LayoutTests/fast/images/resources/100x100-red.psd and /dev/null differ
diff --git a/LayoutTests/fast/images/resources/100x100-red.tga b/LayoutTests/fast/images/resources/100x100-red.tga
deleted file mode 100644 (file)
index 06958ba..0000000
Binary files a/LayoutTests/fast/images/resources/100x100-red.tga and /dev/null differ
index e1ef158..586fefa 100644 (file)
@@ -1,3 +1,15 @@
+2017-04-26  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r215767.
+
+        The LayoutTest for this change is a flaky failure.
+
+        Reverted changeset:
+
+        "Restrict WebKit image formats to a known whitelist"
+        https://bugs.webkit.org/show_bug.cgi?id=170700
+        http://trac.webkit.org/changeset/215767
+
 2017-04-26  Dave Hyatt  <hyatt@apple.com>
 
         Improve wavy underline rendering
index bbf504b..c5bea5e 100644 (file)
@@ -51,7 +51,6 @@
 
 #if USE(CG)
 #include "PDFDocumentImage.h"
-#include "UTIRegistry.h"
 #endif
 
 namespace WebCore {
@@ -402,7 +401,7 @@ void CachedImage::addIncrementalDataBuffer(SharedBuffer& data)
     // Have the image update its data from its internal buffer.
     // It will not do anything now, but will delay decoding until
     // queried for info (like size or specific image frames).
-    EncodedDataStatus encodedDataStatus = setImageDataBuffer(&data, false);
+    EncodedDataStatus encodedDataStatus = m_image->setData(&data, false);
     if (encodedDataStatus > EncodedDataStatus::Error && encodedDataStatus < EncodedDataStatus::SizeAvailable)
         return;
 
@@ -425,16 +424,6 @@ void CachedImage::addIncrementalDataBuffer(SharedBuffer& data)
     setEncodedSize(m_image->data() ? m_image->data()->size() : 0);
 }
 
-EncodedDataStatus CachedImage::setImageDataBuffer(SharedBuffer* data, bool allDataReceived)
-{
-    EncodedDataStatus encodedDataStatus = m_image ? m_image->setData(data, allDataReceived) : EncodedDataStatus::Error;
-#if USE(CG)
-    if (encodedDataStatus >= EncodedDataStatus::TypeAvailable && m_image->isBitmapImage() && !isAllowedImageUTI(m_image->uti()))
-        return EncodedDataStatus::Error;
-#endif
-    return encodedDataStatus;
-}
-
 void CachedImage::addDataBuffer(SharedBuffer& data)
 {
     ASSERT(dataBufferingPolicy() == BufferData);
@@ -455,7 +444,7 @@ void CachedImage::finishLoading(SharedBuffer* data)
     if (!m_image && data)
         createImage();
 
-    EncodedDataStatus encodedDataStatus = setImageDataBuffer(data, true);
+    EncodedDataStatus encodedDataStatus = m_image ? m_image->setData(data, true) : EncodedDataStatus::Error;
 
     if (encodedDataStatus == EncodedDataStatus::Error || m_image->isNull()) {
         // Image decoding failed; the image data is malformed.
index eb7d6d2..4c3ee85 100644 (file)
@@ -107,7 +107,6 @@ private:
     void allClientsRemoved() override;
     void destroyDecodedData() override;
 
-    EncodedDataStatus setImageDataBuffer(SharedBuffer*, bool allDataReceived);
     void addData(const char* data, unsigned length) override;
     void error(CachedResource::Status) override;
     void responseReceived(const ResourceResponse&) override;