<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[215211] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/215211">215211</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2017-04-10 17:24:17 -0700 (Mon, 10 Apr 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>CachedImage should stop decoding images when unknown type is detected
https://bugs.webkit.org/show_bug.cgi?id=170530

Patch by Said Abou-Hallawa &lt;sabouhallawa@apple.com&gt; on 2017-04-10
Reviewed by Tim Horton.

If the status of the encoded data is &quot;unknown type&quot;, WebKit should stop
decoding the rest of the data. Ideally WebKit should also cancel loading
the rest of the encoded data.

To do that we need to add a function to the ImageDecoder to return the
encodedDataStatus(). We also need to change the return type of Image::setData()
and Image::dataChanged() form bool to EncodedDataStatus.

* WebCore.xcodeproj/project.pbxproj: Add ImageTypes.h to the WebCore project.
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::addIncrementalDataBuffer): Replace checking !sizeAvailable
by checking if encodedDataStatus isn't an error but it has not reached
sizeAvailable state
* loader/cache/CachedResourceClientWalker.h:
(WebCore::CachedResourceClientWalker::CachedResourceClientWalker): Unrelated clean-up.
(WebCore::CachedResourceClientWalker::next): Ditto.
* loader/icon/IconRecord.cpp:
(WebCore::IconRecord::setImageData): Image::setData() used to return a bool. Now it returns
an EncodedDataStatus. !setData() now means setData() &lt; EncodedDataStatus::SizeAvailable.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::dataChanged): Replace the return of dataChanged() from bool
by EncodedDataStatus.
* platform/graphics/BitmapImage.h: Replace isSizeAvailable() by a new function
named encodedDataStatus().
* platform/graphics/Image.cpp:
(WebCore::Image::setData): Code clean-up and adding a clarification comment.
* platform/graphics/Image.h: Change the return of setData() and dataChanged() to be
EncodedDataStatus.
(WebCore::Image::dataChanged): Return EncodedDataStatus::Unknown as an indication
the size is not available but we do not have an error.
* platform/graphics/ImageTypes.h: Added.
Image definitions which are shared among Image, ImageDecoder, ImageSource,
ImageFrameCache and ImageFrame used to be added to ImageFrame.h. This has
been annoying since these definitions aren't related to ImageFrame only.
A new header file named ImageTypes.h is to the to include such definitions.
(WebCore::operator++):
* platform/graphics/ImageFrame.h:
(WebCore::operator++): Deleted.
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::ImageFrameCache): This is the case of a BitmapImage without
a decoder but with a NativeImage. The status has to be EncodedDataStatus::Complete.
(WebCore::ImageFrameCache::growFrames): Replace if (isSizeAvailable()) by
if (encodedDataStatus() &gt;= EncodedDataStatus::SizeAvailable).
(WebCore::ImageFrameCache::metadata): Ditto.
(WebCore::ImageFrameCache::encodedDataStatus): This is a replacement for isSizeAvailable().
Don't cache the EncodedDataStatus until it is Complete. Don't call didDecodeProperties()
until the status &gt;= EncodedDataStatus::SizeAvailable.
(WebCore::ImageFrameCache::isSizeAvailable): Deleted.
* platform/graphics/ImageFrameCache.h: Replace isSizeAvailable() by encodedDataStatus().
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::dataChanged): Make return an EncodedDataStatus instead of returning
a bool for isSizeAvailable.
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::encodedDataStatus): Replace isSizeAvailable() by encodedDataStatus().
(WebCore::ImageSource::isSizeAvailable): Deleted.
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoder::encodedDataStatus): Replace isSizeAvailable() by encodedDataStatus().
The logic of this function is the following:
    -- CGImageSourceGetStatus() can return kCGImageStatusUnexpectedEOF, kCGImageStatusInvalidData
    or kCGImageStatusReadingHeader even if CG will end up recovering form the error and drawing
    the image. Actually CG initializes the status of CGImageSource before receiving any data
    with kCGImageStatusInvalidData. So the status will be considered an error only if all the
    data is received but CG does not move the status of this CGImageSource to Complete.
    -- If CGImageSourceGetStatus() returns Incomplete, this means CG already created the image
    reader and therefore the image type is known.
    -- If CGImageSourceGetStatus() returns UnknownType, this means CG could not create the
    image reader and this should be considered an error.
(WebCore::ImageDecoder::isSizeAvailable): Deleted.
* platform/graphics/cg/ImageDecoderCG.h: Replace isSizeAvailable() by encodedDataStatus().
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::dataChanged): The PDFDocument is created only when allDataReceived.
* platform/graphics/cg/PDFDocumentImage.h: Change the return type from bool to EncodedDataStatus.
* platform/image-decoders/ImageDecoder.h:
(WebCore::ImageDecoder::encodedDataStatus): Add a new function encodedDataStatus(). Deduce the
status of the encoded data from the flags m_failed, m_isAllDataReceived and m_sizeAvailable in
this order.
(WebCore::ImageDecoder::isSizeAvailable): Make this function uses encodedDataStatus().
* platform/image-decoders/bmp/BMPImageDecoder.cpp:
(WebCore::BMPImageDecoder::encodedDataStatus): Replace isSizeAvailable() by encodedDataStatus().
(WebCore::BMPImageDecoder::isSizeAvailable): Deleted.
* platform/image-decoders/bmp/BMPImageDecoder.h:
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::encodedDataStatus): Ditto.
(WebCore::GIFImageDecoder::isSizeAvailable): Deleted.
* platform/image-decoders/gif/GIFImageDecoder.h:
* platform/image-decoders/ico/ICOImageDecoder.cpp:
(WebCore::ICOImageDecoder::encodedDataStatus): Ditto.
(WebCore::ICOImageDecoder::isSizeAvailable): Deleted.
* platform/image-decoders/ico/ICOImageDecoder.h:
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
(WebCore::JPEGImageDecoder::encodedDataStatus): Ditto.
(WebCore::JPEGImageDecoder::isSizeAvailable): Deleted.
* platform/image-decoders/jpeg/JPEGImageDecoder.h:
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageDecoder::encodedDataStatus): Ditto.
(WebCore::PNGImageDecoder::isSizeAvailable): Deleted.
* platform/image-decoders/png/PNGImageDecoder.h:
* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(WebCore::WEBPImageDecoder::encodedDataStatus): Ditto.
(WebCore::WEBPImageDecoder::isSizeAvailable): Deleted.
* platform/image-decoders/webp/WEBPImageDecoder.h:
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged): m_page is created only when allDataReceived is true.
* svg/graphics/SVGImage.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedImagecpp">trunk/Source/WebCore/loader/cache/CachedImage.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourceClientWalkerh">trunk/Source/WebCore/loader/cache/CachedResourceClientWalker.h</a></li>
<li><a href="#trunkSourceWebCoreloadericonIconRecordcpp">trunk/Source/WebCore/loader/icon/IconRecord.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsBitmapImagecpp">trunk/Source/WebCore/platform/graphics/BitmapImage.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsBitmapImageh">trunk/Source/WebCore/platform/graphics/BitmapImage.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsImagecpp">trunk/Source/WebCore/platform/graphics/Image.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsImageh">trunk/Source/WebCore/platform/graphics/Image.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsImageFrameh">trunk/Source/WebCore/platform/graphics/ImageFrame.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsImageFrameCachecpp">trunk/Source/WebCore/platform/graphics/ImageFrameCache.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsImageFrameCacheh">trunk/Source/WebCore/platform/graphics/ImageFrameCache.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsImageSourcecpp">trunk/Source/WebCore/platform/graphics/ImageSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsImageSourceh">trunk/Source/WebCore/platform/graphics/ImageSource.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgImageDecoderCGcpp">trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgImageDecoderCGh">trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgPDFDocumentImagecpp">trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgPDFDocumentImageh">trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.h</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecodersImageDecoderh">trunk/Source/WebCore/platform/image-decoders/ImageDecoder.h</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecodersbmpBMPImageDecodercpp">trunk/Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecodersbmpBMPImageDecoderh">trunk/Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.h</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecodersgifGIFImageDecodercpp">trunk/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecodersgifGIFImageDecoderh">trunk/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.h</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecodersicoICOImageDecodercpp">trunk/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecodersicoICOImageDecoderh">trunk/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecodersjpegJPEGImageDecodercpp">trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecodersjpegJPEGImageDecoderh">trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecoderspngPNGImageDecodercpp">trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecoderspngPNGImageDecoderh">trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecoderswebpWEBPImageDecodercpp">trunk/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecoderswebpWEBPImageDecoderh">trunk/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h</a></li>
<li><a href="#trunkSourceWebCoresvggraphicsSVGImagecpp">trunk/Source/WebCore/svg/graphics/SVGImage.cpp</a></li>
<li><a href="#trunkSourceWebCoresvggraphicsSVGImageh">trunk/Source/WebCore/svg/graphics/SVGImage.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicsImageTypesh">trunk/Source/WebCore/platform/graphics/ImageTypes.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/ChangeLog        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -1,3 +1,115 @@
</span><ins>+2017-04-10  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
+
+        CachedImage should stop decoding images when unknown type is detected
+        https://bugs.webkit.org/show_bug.cgi?id=170530
+
+        Reviewed by Tim Horton.
+
+        If the status of the encoded data is &quot;unknown type&quot;, WebKit should stop
+        decoding the rest of the data. Ideally WebKit should also cancel loading
+        the rest of the encoded data.
+        
+        To do that we need to add a function to the ImageDecoder to return the
+        encodedDataStatus(). We also need to change the return type of Image::setData()
+        and Image::dataChanged() form bool to EncodedDataStatus.
+
+        * WebCore.xcodeproj/project.pbxproj: Add ImageTypes.h to the WebCore project.
+        * loader/cache/CachedImage.cpp:
+        (WebCore::CachedImage::addIncrementalDataBuffer): Replace checking !sizeAvailable 
+        by checking if encodedDataStatus isn't an error but it has not reached
+        sizeAvailable state
+        * loader/cache/CachedResourceClientWalker.h:
+        (WebCore::CachedResourceClientWalker::CachedResourceClientWalker): Unrelated clean-up.
+        (WebCore::CachedResourceClientWalker::next): Ditto.
+        * loader/icon/IconRecord.cpp:
+        (WebCore::IconRecord::setImageData): Image::setData() used to return a bool. Now it returns
+        an EncodedDataStatus. !setData() now means setData() &lt; EncodedDataStatus::SizeAvailable.
+        * platform/graphics/BitmapImage.cpp:
+        (WebCore::BitmapImage::dataChanged): Replace the return of dataChanged() from bool
+        by EncodedDataStatus.
+        * platform/graphics/BitmapImage.h: Replace isSizeAvailable() by a new function
+        named encodedDataStatus().
+        * platform/graphics/Image.cpp:
+        (WebCore::Image::setData): Code clean-up and adding a clarification comment.
+        * platform/graphics/Image.h: Change the return of setData() and dataChanged() to be
+        EncodedDataStatus.
+        (WebCore::Image::dataChanged): Return EncodedDataStatus::Unknown as an indication
+        the size is not available but we do not have an error.
+        * platform/graphics/ImageTypes.h: Added.
+        Image definitions which are shared among Image, ImageDecoder, ImageSource,
+        ImageFrameCache and ImageFrame used to be added to ImageFrame.h. This has
+        been annoying since these definitions aren't related to ImageFrame only.
+        A new header file named ImageTypes.h is to the to include such definitions.
+        (WebCore::operator++):
+        * platform/graphics/ImageFrame.h:
+        (WebCore::operator++): Deleted.
+        * platform/graphics/ImageFrameCache.cpp:
+        (WebCore::ImageFrameCache::ImageFrameCache): This is the case of a BitmapImage without
+        a decoder but with a NativeImage. The status has to be EncodedDataStatus::Complete.
+        (WebCore::ImageFrameCache::growFrames): Replace if (isSizeAvailable()) by
+        if (encodedDataStatus() &gt;= EncodedDataStatus::SizeAvailable).
+        (WebCore::ImageFrameCache::metadata): Ditto.
+        (WebCore::ImageFrameCache::encodedDataStatus): This is a replacement for isSizeAvailable().
+        Don't cache the EncodedDataStatus until it is Complete. Don't call didDecodeProperties()
+        until the status &gt;= EncodedDataStatus::SizeAvailable.
+        (WebCore::ImageFrameCache::isSizeAvailable): Deleted.
+        * platform/graphics/ImageFrameCache.h: Replace isSizeAvailable() by encodedDataStatus().
+        * platform/graphics/ImageSource.cpp:
+        (WebCore::ImageSource::dataChanged): Make return an EncodedDataStatus instead of returning
+        a bool for isSizeAvailable.
+        * platform/graphics/ImageSource.h:
+        (WebCore::ImageSource::encodedDataStatus): Replace isSizeAvailable() by encodedDataStatus().
+        (WebCore::ImageSource::isSizeAvailable): Deleted.
+        * platform/graphics/cg/ImageDecoderCG.cpp:
+        (WebCore::ImageDecoder::encodedDataStatus): Replace isSizeAvailable() by encodedDataStatus().
+        The logic of this function is the following:
+            -- CGImageSourceGetStatus() can return kCGImageStatusUnexpectedEOF, kCGImageStatusInvalidData
+            or kCGImageStatusReadingHeader even if CG will end up recovering form the error and drawing
+            the image. Actually CG initializes the status of CGImageSource before receiving any data
+            with kCGImageStatusInvalidData. So the status will be considered an error only if all the
+            data is received but CG does not move the status of this CGImageSource to Complete.
+            -- If CGImageSourceGetStatus() returns Incomplete, this means CG already created the image
+            reader and therefore the image type is known.
+            -- If CGImageSourceGetStatus() returns UnknownType, this means CG could not create the
+            image reader and this should be considered an error.
+        (WebCore::ImageDecoder::isSizeAvailable): Deleted.
+        * platform/graphics/cg/ImageDecoderCG.h: Replace isSizeAvailable() by encodedDataStatus().
+        * platform/graphics/cg/PDFDocumentImage.cpp:
+        (WebCore::PDFDocumentImage::dataChanged): The PDFDocument is created only when allDataReceived.
+        * platform/graphics/cg/PDFDocumentImage.h: Change the return type from bool to EncodedDataStatus.
+        * platform/image-decoders/ImageDecoder.h: 
+        (WebCore::ImageDecoder::encodedDataStatus): Add a new function encodedDataStatus(). Deduce the
+        status of the encoded data from the flags m_failed, m_isAllDataReceived and m_sizeAvailable in
+        this order.
+        (WebCore::ImageDecoder::isSizeAvailable): Make this function uses encodedDataStatus().
+        * platform/image-decoders/bmp/BMPImageDecoder.cpp:
+        (WebCore::BMPImageDecoder::encodedDataStatus): Replace isSizeAvailable() by encodedDataStatus().
+        (WebCore::BMPImageDecoder::isSizeAvailable): Deleted.
+        * platform/image-decoders/bmp/BMPImageDecoder.h:
+        * platform/image-decoders/gif/GIFImageDecoder.cpp:
+        (WebCore::GIFImageDecoder::encodedDataStatus): Ditto.
+        (WebCore::GIFImageDecoder::isSizeAvailable): Deleted.
+        * platform/image-decoders/gif/GIFImageDecoder.h:
+        * platform/image-decoders/ico/ICOImageDecoder.cpp:
+        (WebCore::ICOImageDecoder::encodedDataStatus): Ditto.
+        (WebCore::ICOImageDecoder::isSizeAvailable): Deleted.
+        * platform/image-decoders/ico/ICOImageDecoder.h:
+        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
+        (WebCore::JPEGImageDecoder::encodedDataStatus): Ditto.
+        (WebCore::JPEGImageDecoder::isSizeAvailable): Deleted.
+        * platform/image-decoders/jpeg/JPEGImageDecoder.h:
+        * platform/image-decoders/png/PNGImageDecoder.cpp:
+        (WebCore::PNGImageDecoder::encodedDataStatus): Ditto.
+        (WebCore::PNGImageDecoder::isSizeAvailable): Deleted.
+        * platform/image-decoders/png/PNGImageDecoder.h:
+        * platform/image-decoders/webp/WEBPImageDecoder.cpp:
+        (WebCore::WEBPImageDecoder::encodedDataStatus): Ditto.
+        (WebCore::WEBPImageDecoder::isSizeAvailable): Deleted.
+        * platform/image-decoders/webp/WEBPImageDecoder.h:
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::dataChanged): m_page is created only when allDataReceived is true.
+        * svg/graphics/SVGImage.h:
+
</ins><span class="cx"> 2017-04-10  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Mark SVG-Within-OpenType as &quot;Under Consideration&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -2501,6 +2501,7 @@
</span><span class="cx">                 53EF766C16531994004CBE49 /* SettingsMacros.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 53EF766A16530A61004CBE49 /* SettingsMacros.h */; };
</span><span class="cx">                 550A0BC9085F6039007353D6 /* QualifiedName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 550A0BC7085F6039007353D6 /* QualifiedName.cpp */; };
</span><span class="cx">                 550A0BCA085F6039007353D6 /* QualifiedName.h in Headers */ = {isa = PBXBuildFile; fileRef = 550A0BC8085F6039007353D6 /* QualifiedName.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                5550CB421E955E3C00111AA0 /* ImageTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 5550CB411E955E3C00111AA0 /* ImageTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 555130011E7CCCCB00A69E38 /* DecodingOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 555130001E7CCCCA00A69E38 /* DecodingOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 555B87EC1CAAF0AB00349425 /* ImageDecoderCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 555B87EA1CAAF0AB00349425 /* ImageDecoderCG.cpp */; };
</span><span class="cx">                 555B87ED1CAAF0AB00349425 /* ImageDecoderCG.h in Headers */ = {isa = PBXBuildFile; fileRef = 555B87EB1CAAF0AB00349425 /* ImageDecoderCG.h */; };
</span><span class="lines">@@ -10203,6 +10204,7 @@
</span><span class="cx">                 53EF766A16530A61004CBE49 /* SettingsMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsMacros.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 550A0BC7085F6039007353D6 /* QualifiedName.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = QualifiedName.cpp; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</span><span class="cx">                 550A0BC8085F6039007353D6 /* QualifiedName.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = QualifiedName.h; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</span><ins>+                5550CB411E955E3C00111AA0 /* ImageTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageTypes.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 555130001E7CCCCA00A69E38 /* DecodingOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DecodingOptions.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 555B87EA1CAAF0AB00349425 /* ImageDecoderCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageDecoderCG.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 555B87EB1CAAF0AB00349425 /* ImageDecoderCG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageDecoderCG.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -23031,6 +23033,7 @@
</span><span class="cx">                                 43D2597613C816F400608559 /* ImageBuffer.cpp */,
</span><span class="cx">                                 B2A10B910B3818BD00099AA4 /* ImageBuffer.h */,
</span><span class="cx">                                 22BD9F7D1353625C009BD102 /* ImageBufferData.h */,
</span><ins>+                                5550CB411E955E3C00111AA0 /* ImageTypes.h */,
</ins><span class="cx">                                 5576A5621D88A70800CCC04C /* ImageFrame.cpp */,
</span><span class="cx">                                 5576A5631D88A70800CCC04C /* ImageFrame.h */,
</span><span class="cx">                                 5597F8241D91C3130066BC21 /* ImageFrameCache.cpp */,
</span><span class="lines">@@ -28754,6 +28757,7 @@
</span><span class="cx">                                 CE1252391A166FA000864480 /* QuickLookSPI.h in Headers */,
</span><span class="cx">                                 072AE1E8183C0741000A5988 /* QuickTimePluginReplacement.h in Headers */,
</span><span class="cx">                                 379E371713736A6600B9E919 /* QuotedPrintable.h in Headers */,
</span><ins>+                                5550CB421E955E3C00111AA0 /* ImageTypes.h in Headers */,
</ins><span class="cx">                                 5A574F29131DB96D00471B88 /* QuotesData.h in Headers */,
</span><span class="cx">                                 B22279720D00BF220071B782 /* RadialGradientAttributes.h in Headers */,
</span><span class="cx">                                 93F925430F7EF5B8007E37C9 /* RadioButtonGroups.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedImage.cpp (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedImage.cpp        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/loader/cache/CachedImage.cpp        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -399,11 +399,11 @@
</span><span class="cx">     // Have the image update its data from its internal buffer.
</span><span class="cx">     // It will not do anything now, but will delay decoding until
</span><span class="cx">     // queried for info (like size or specific image frames).
</span><del>-    bool sizeAvailable = m_image-&gt;setData(&amp;data, false);
-    if (!sizeAvailable)
</del><ins>+    EncodedDataStatus encodedDataStatus = m_image-&gt;setData(&amp;data, false);
+    if (encodedDataStatus &gt; EncodedDataStatus::Error &amp;&amp; encodedDataStatus &lt; EncodedDataStatus::SizeAvailable)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (m_image-&gt;isNull()) {
</del><ins>+    if (encodedDataStatus == EncodedDataStatus::Error || m_image-&gt;isNull()) {
</ins><span class="cx">         // Image decoding failed. Either we need more image data or the image data is malformed.
</span><span class="cx">         error(errorOccurred() ? status() : DecodeError);
</span><span class="cx">         if (inCache())
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceClientWalkerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResourceClientWalker.h (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResourceClientWalker.h        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/loader/cache/CachedResourceClientWalker.h        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -32,16 +32,16 @@
</span><span class="cx"> 
</span><span class="cx"> // Call this &quot;walker&quot; instead of iterator so people won't expect Qt or STL-style iterator interface.
</span><span class="cx"> // Just keep calling next() on this. It's safe from deletions of items.
</span><del>-template&lt;typename T&gt; class CachedResourceClientWalker {
</del><ins>+template&lt;typename T&gt;
+class CachedResourceClientWalker {
</ins><span class="cx"> public:
</span><del>-    CachedResourceClientWalker(const HashCountedSet&lt;CachedResourceClient*&gt;&amp; set)
-        : m_clientSet(set), m_clientVector(set.size()), m_index(0)
</del><ins>+    CachedResourceClientWalker(const HashCountedSet&lt;CachedResourceClient*&gt;&amp; clientSet)
+        : m_clientSet(clientSet)
+        , m_clientVector(clientSet.size())
</ins><span class="cx">     {
</span><del>-        typedef HashCountedSet&lt;CachedResourceClient*&gt;::const_iterator Iterator;
-        Iterator end = set.end();
</del><span class="cx">         size_t clientIndex = 0;
</span><del>-        for (Iterator current = set.begin(); current != end; ++current)
-            m_clientVector[clientIndex++] = current-&gt;key;
</del><ins>+        for (const auto&amp; client : clientSet)
+            m_clientVector[clientIndex++] = client.key;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     T* next()
</span><span class="lines">@@ -54,13 +54,12 @@
</span><span class="cx">                 return static_cast&lt;T*&gt;(next);
</span><span class="cx">             }
</span><span class="cx">         }
</span><del>-        
</del><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> private:
</span><span class="cx">     const HashCountedSet&lt;CachedResourceClient*&gt;&amp; m_clientSet;
</span><span class="cx">     Vector&lt;CachedResourceClient*&gt; m_clientVector;
</span><del>-    size_t m_index;
</del><ins>+    size_t m_index { 0 };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreloadericonIconRecordcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/icon/IconRecord.cpp (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/icon/IconRecord.cpp        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/loader/icon/IconRecord.cpp        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx">     m_image = BitmapImage::create();
</span><span class="cx"> 
</span><span class="cx">     // Copy the provided data into the buffer of the new Image object.
</span><del>-    if (!m_image-&gt;setData(WTFMove(data), true)) {
</del><ins>+    if (m_image-&gt;setData(WTFMove(data), true) &lt; EncodedDataStatus::SizeAvailable) {
</ins><span class="cx">         LOG(IconDatabase, &quot;Manual image data for iconURL '%s' FAILED - it was probably invalid image data&quot;, m_iconURL.ascii().data());
</span><span class="cx">         m_image = nullptr;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsBitmapImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/BitmapImage.cpp (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/BitmapImage.cpp        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/graphics/BitmapImage.cpp        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -97,7 +97,7 @@
</span><span class="cx">     destroyDecodedData(destroyAll);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool BitmapImage::dataChanged(bool allDataReceived)
</del><ins>+EncodedDataStatus BitmapImage::dataChanged(bool allDataReceived)
</ins><span class="cx"> {
</span><span class="cx">     return m_source.dataChanged(data(), allDataReceived);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsBitmapImageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/BitmapImage.h (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/BitmapImage.h        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/graphics/BitmapImage.h        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -68,10 +68,10 @@
</span><span class="cx">     
</span><span class="cx">     bool hasSingleSecurityOrigin() const override { return true; }
</span><span class="cx"> 
</span><del>-    bool dataChanged(bool allDataReceived) override;
</del><ins>+    EncodedDataStatus dataChanged(bool allDataReceived) override;
</ins><span class="cx">     unsigned decodedSize() const { return m_source.decodedSize(); }
</span><span class="cx"> 
</span><del>-    bool isSizeAvailable() const { return m_source.isSizeAvailable(); }
</del><ins>+    EncodedDataStatus encodedDataStatus() const { return m_source.encodedDataStatus(); }
</ins><span class="cx">     size_t frameCount() const { return m_source.frameCount(); }
</span><span class="cx">     RepetitionCount repetitionCount() const { return m_source.repetitionCount(); }
</span><span class="cx">     String filenameExtension() const override { return m_source.filenameExtension(); }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/Image.cpp (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/Image.cpp        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/graphics/Image.cpp        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -63,19 +63,17 @@
</span><span class="cx"> 
</span><span class="cx"> bool Image::supportsType(const String&amp; type)
</span><span class="cx"> {
</span><del>-    return MIMETypeRegistry::isSupportedImageResourceMIMEType(type); 
</del><ins>+    return MIMETypeRegistry::isSupportedImageResourceMIMEType(type);
</ins><span class="cx"> } 
</span><span class="cx"> 
</span><del>-bool Image::setData(RefPtr&lt;SharedBuffer&gt;&amp;&amp; data, bool allDataReceived)
</del><ins>+EncodedDataStatus Image::setData(RefPtr&lt;SharedBuffer&gt;&amp;&amp; data, bool allDataReceived)
</ins><span class="cx"> {
</span><span class="cx">     m_encodedImageData = WTFMove(data);
</span><del>-    if (!m_encodedImageData.get())
-        return true;
</del><span class="cx"> 
</span><del>-    int length = m_encodedImageData-&gt;size();
-    if (!length)
-        return true;
-    
</del><ins>+    // Don't do anything; it is an empty image.
+    if (!m_encodedImageData.get() || !m_encodedImageData-&gt;size())
+        return EncodedDataStatus::Complete;
+
</ins><span class="cx">     return dataChanged(allDataReceived);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsImageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/Image.h (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/Image.h        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/graphics/Image.h        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &quot;FloatSize.h&quot;
</span><span class="cx"> #include &quot;GraphicsTypes.h&quot;
</span><span class="cx"> #include &quot;ImageOrientation.h&quot;
</span><ins>+#include &quot;ImageTypes.h&quot;
</ins><span class="cx"> #include &quot;NativeImage.h&quot;
</span><span class="cx"> #include &lt;wtf/Optional.h&gt;
</span><span class="cx"> #include &lt;wtf/PassRefPtr.h&gt;
</span><span class="lines">@@ -115,9 +116,9 @@
</span><span class="cx">     virtual FloatSize originalSize() const { return size(); }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    WEBCORE_EXPORT bool setData(RefPtr&lt;SharedBuffer&gt;&amp;&amp; data, bool allDataReceived);
-    virtual bool dataChanged(bool /*allDataReceived*/) { return false; }
-    
</del><ins>+    WEBCORE_EXPORT EncodedDataStatus setData(RefPtr&lt;SharedBuffer&gt;&amp;&amp; data, bool allDataReceived);
+    virtual EncodedDataStatus dataChanged(bool /*allDataReceived*/) { return EncodedDataStatus::Unknown; }
+
</ins><span class="cx">     virtual String filenameExtension() const { return String(); } // null string if unknown
</span><span class="cx"> 
</span><span class="cx">     virtual void destroyDecodedData(bool destroyAll = true) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsImageFrameh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ImageFrame.h (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ImageFrame.h        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/graphics/ImageFrame.h        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include &quot;DecodingOptions.h&quot;
</span><span class="cx"> #include &quot;ImageBackingStore.h&quot;
</span><span class="cx"> #include &quot;ImageOrientation.h&quot;
</span><ins>+#include &quot;ImageTypes.h&quot;
</ins><span class="cx"> #include &quot;IntSize.h&quot;
</span><span class="cx"> #include &quot;NativeImage.h&quot;
</span><span class="cx"> #include &lt;wtf/Deque.h&gt;
</span><span class="lines">@@ -35,45 +36,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class Color;
-
-// There are four subsampling levels: 0 = 1x, 1 = 0.5x, 2 = 0.25x, 3 = 0.125x.
-enum class SubsamplingLevel {
-    First = 0,
-    Default = First,
-    Level0 = First,
-    Level1,
-    Level2,
-    Level3,
-    Last = Level3,
-    Max
-};
-
-inline SubsamplingLevel&amp; operator++(SubsamplingLevel&amp; subsamplingLevel)
-{
-    subsamplingLevel = static_cast&lt;SubsamplingLevel&gt;(static_cast&lt;int&gt;(subsamplingLevel) + 1);
-    ASSERT(subsamplingLevel &lt;= SubsamplingLevel::Max);
-    return subsamplingLevel;
-}
-
-typedef int RepetitionCount;
-
-enum {
-    RepetitionCountNone = 0,
-    RepetitionCountOnce = 1,
-    RepetitionCountInfinite = -1,
-};
-
-enum class AlphaOption {
-    Premultiplied,
-    NotPremultiplied
-};
-
-enum class GammaAndColorProfileOption {
-    Applied,
-    Ignored
-};
-
</del><span class="cx"> class ImageFrame {
</span><span class="cx">     friend class ImageFrameCache;
</span><span class="cx"> public:
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsImageFrameCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ImageFrameCache.cpp (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ImageFrameCache.cpp        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/graphics/ImageFrameCache.cpp        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx"> ImageFrameCache::ImageFrameCache(NativeImagePtr&amp;&amp; nativeImage)
</span><span class="cx"> {
</span><span class="cx">     m_frameCount = 1;
</span><del>-    m_isSizeAvailable = true;
</del><ins>+    m_encodedDataStatus = EncodedDataStatus::Complete;
</ins><span class="cx">     growFrames();
</span><span class="cx"> 
</span><span class="cx">     setNativeImage(WTFMove(nativeImage));
</span><span class="lines">@@ -435,17 +435,24 @@
</span><span class="cx">     return cachedValue-&gt;value();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool ImageFrameCache::isSizeAvailable()
</del><ins>+EncodedDataStatus ImageFrameCache::encodedDataStatus()
</ins><span class="cx"> {
</span><del>-    if (m_isSizeAvailable)
-        return m_isSizeAvailable.value();
</del><ins>+    if (m_encodedDataStatus)
+        return m_encodedDataStatus.value();
</ins><span class="cx">     
</span><del>-    if (!isDecoderAvailable() || !m_decoder-&gt;isSizeAvailable())
-        return false;
</del><ins>+    if (!isDecoderAvailable())
+        return EncodedDataStatus::Unknown;
</ins><span class="cx">     
</span><del>-    m_isSizeAvailable = true;
</del><ins>+    EncodedDataStatus status = m_decoder-&gt;encodedDataStatus();
+    if (status &lt; EncodedDataStatus::SizeAvailable)
+        return status;
+
</ins><span class="cx">     didDecodeProperties(m_decoder-&gt;bytesDecodedToDetermineProperties());
</span><del>-    return true;
</del><ins>+    if (status &lt; EncodedDataStatus::Complete)
+        return status;
+    
+    m_encodedDataStatus = status;
+    return status;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> size_t ImageFrameCache::frameCount()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsImageFrameCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ImageFrameCache.h (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ImageFrameCache.h        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/graphics/ImageFrameCache.h        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -77,7 +77,8 @@
</span><span class="cx"> 
</span><span class="cx">     // Image metadata which is calculated either by the ImageDecoder or directly
</span><span class="cx">     // from the NativeImage if this class was created for a memory image.
</span><del>-    bool isSizeAvailable();
</del><ins>+    EncodedDataStatus encodedDataStatus();
+    bool isSizeAvailable() { return encodedDataStatus() &gt;= EncodedDataStatus::SizeAvailable; }
</ins><span class="cx">     size_t frameCount();
</span><span class="cx">     RepetitionCount repetitionCount();
</span><span class="cx">     String filenameExtension();
</span><span class="lines">@@ -162,7 +163,7 @@
</span><span class="cx">     RefPtr&lt;WorkQueue&gt; m_decodingQueue;
</span><span class="cx"> 
</span><span class="cx">     // Image metadata.
</span><del>-    std::optional&lt;bool&gt; m_isSizeAvailable;
</del><ins>+    std::optional&lt;EncodedDataStatus&gt; m_encodedDataStatus;
</ins><span class="cx">     std::optional&lt;size_t&gt; m_frameCount;
</span><span class="cx">     std::optional&lt;RepetitionCount&gt; m_repetitionCount;
</span><span class="cx">     std::optional&lt;String&gt; m_filenameExtension;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsImageSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ImageSource.cpp (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ImageSource.cpp        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/graphics/ImageSource.cpp        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -111,7 +111,7 @@
</span><span class="cx">     m_decoder-&gt;setData(*data, allDataReceived);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool ImageSource::dataChanged(SharedBuffer* data, bool allDataReceived)
</del><ins>+EncodedDataStatus ImageSource::dataChanged(SharedBuffer* data, bool allDataReceived)
</ins><span class="cx"> {
</span><span class="cx">     m_frameCache-&gt;destroyIncompleteDecodedData();
</span><span class="cx"> 
</span><span class="lines">@@ -138,11 +138,12 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     m_frameCache-&gt;clearMetadata();
</span><del>-    if (!isSizeAvailable())
-        return false;
</del><ins>+    EncodedDataStatus status = encodedDataStatus();
+    if (status &lt; EncodedDataStatus::SizeAvailable)
+        return status;
</ins><span class="cx"> 
</span><span class="cx">     m_frameCache-&gt;growFrames();
</span><del>-    return true;
</del><ins>+    return status;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool ImageSource::isAllDataReceived()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsImageSourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ImageSource.h (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ImageSource.h        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/graphics/ImageSource.h        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx">     bool isDecoderAvailable() const { return m_decoder.get(); }
</span><span class="cx"> 
</span><span class="cx">     void setData(SharedBuffer* data, bool allDataReceived);
</span><del>-    bool dataChanged(SharedBuffer* data, bool allDataReceived);
</del><ins>+    EncodedDataStatus dataChanged(SharedBuffer* data, bool allDataReceived);
</ins><span class="cx"> 
</span><span class="cx">     unsigned decodedSize() const { return m_frameCache-&gt;decodedSize(); }
</span><span class="cx">     bool isAllDataReceived();
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx">     void stopAsyncDecodingQueue() { m_frameCache-&gt;stopAsyncDecodingQueue(); }
</span><span class="cx"> 
</span><span class="cx">     // Image metadata which is calculated by the decoder or can deduced by the case of the memory NativeImage.
</span><del>-    bool isSizeAvailable() { return m_frameCache-&gt;isSizeAvailable(); }
</del><ins>+    EncodedDataStatus encodedDataStatus() { return m_frameCache-&gt;encodedDataStatus(); }
</ins><span class="cx">     size_t frameCount() { return m_frameCache-&gt;frameCount(); }
</span><span class="cx">     RepetitionCount repetitionCount() { return m_frameCache-&gt;repetitionCount(); }
</span><span class="cx">     String filenameExtension() { return m_frameCache-&gt;filenameExtension(); }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsImageTypesh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/ImageTypes.h (0 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ImageTypes.h                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ImageTypes.h        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -0,0 +1,75 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+namespace WebCore {
+
+// There are four subsampling levels: 0 = 1x, 1 = 0.5x, 2 = 0.25x, 3 = 0.125x.
+enum class SubsamplingLevel {
+    First = 0,
+    Default = First,
+    Level0 = First,
+    Level1,
+    Level2,
+    Level3,
+    Last = Level3,
+    Max
+};
+
+inline SubsamplingLevel&amp; operator++(SubsamplingLevel&amp; subsamplingLevel)
+{
+    subsamplingLevel = static_cast&lt;SubsamplingLevel&gt;(static_cast&lt;int&gt;(subsamplingLevel) + 1);
+    ASSERT(subsamplingLevel &lt;= SubsamplingLevel::Max);
+    return subsamplingLevel;
+}
+
+typedef int RepetitionCount;
+
+enum {
+    RepetitionCountNone = 0,
+    RepetitionCountOnce = 1,
+    RepetitionCountInfinite = -1,
+};
+
+enum class AlphaOption {
+    Premultiplied,
+    NotPremultiplied
+};
+
+enum class GammaAndColorProfileOption {
+    Applied,
+    Ignored
+};
+    
+enum class EncodedDataStatus {
+    Error,
+    Unknown,
+    TypeAvailable,
+    SizeAvailable,
+    Complete
+};
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgImageDecoderCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -175,18 +175,38 @@
</span><span class="cx">     return WebCore::preferredExtensionForImageSourceType(imageSourceType);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool ImageDecoder::isSizeAvailable() const
</del><ins>+EncodedDataStatus ImageDecoder::encodedDataStatus() const
</ins><span class="cx"> {
</span><del>-    // Ragnaros yells: TOO SOON! You have awakened me TOO SOON, Executus!
-    if (CGImageSourceGetStatus(m_nativeDecoder.get()) &lt; kCGImageStatusIncomplete)
-        return false;
-    
-    RetainPtr&lt;CFDictionaryRef&gt; image0Properties = adoptCF(CGImageSourceCopyPropertiesAtIndex(m_nativeDecoder.get(), 0, imageSourceOptions().get()));
-    if (!image0Properties)
-        return false;
-    
-    return CFDictionaryContainsKey(image0Properties.get(), kCGImagePropertyPixelWidth)
-    &amp;&amp; CFDictionaryContainsKey(image0Properties.get(), kCGImagePropertyPixelHeight);
</del><ins>+    switch (CGImageSourceGetStatus(m_nativeDecoder.get())) {
+    case kCGImageStatusUnknownType:
+        return EncodedDataStatus::Error;
+
+    case kCGImageStatusUnexpectedEOF:
+    case kCGImageStatusInvalidData:
+    case kCGImageStatusReadingHeader:
+        // Ragnaros yells: TOO SOON! You have awakened me TOO SOON, Executus!
+        if (!m_isAllDataReceived)
+            return EncodedDataStatus::Unknown;
+
+        return EncodedDataStatus::Error;
+
+    case kCGImageStatusIncomplete: {
+        RetainPtr&lt;CFDictionaryRef&gt; image0Properties = adoptCF(CGImageSourceCopyPropertiesAtIndex(m_nativeDecoder.get(), 0, imageSourceOptions().get()));
+        if (!image0Properties)
+            return EncodedDataStatus::TypeAvailable;
+        
+        if (!CFDictionaryContainsKey(image0Properties.get(), kCGImagePropertyPixelWidth) || !CFDictionaryContainsKey(image0Properties.get(), kCGImagePropertyPixelHeight))
+            return EncodedDataStatus::TypeAvailable;
+        
+        return EncodedDataStatus::SizeAvailable;
+    }
+
+    case kCGImageStatusComplete:
+        return EncodedDataStatus::Complete;
+    }
+
+    ASSERT_NOT_REACHED();
+    return EncodedDataStatus::Unknown;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> size_t ImageDecoder::frameCount() const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgImageDecoderCGh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.h (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.h        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.h        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -47,7 +47,8 @@
</span><span class="cx">     
</span><span class="cx">     static size_t bytesDecodedToDetermineProperties();
</span><span class="cx"> 
</span><del>-    bool isSizeAvailable() const;
</del><ins>+    EncodedDataStatus encodedDataStatus() const;
+    bool isSizeAvailable() { return encodedDataStatus() &gt;= EncodedDataStatus::SizeAvailable; }
</ins><span class="cx">     size_t frameCount() const;
</span><span class="cx">     RepetitionCount repetitionCount() const;
</span><span class="cx">     String filenameExtension() const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgPDFDocumentImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx">     intrinsicRatio = FloatSize();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool PDFDocumentImage::dataChanged(bool allDataReceived)
</del><ins>+EncodedDataStatus PDFDocumentImage::dataChanged(bool allDataReceived)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!m_document);
</span><span class="cx">     if (allDataReceived &amp;&amp; !m_document) {
</span><span class="lines">@@ -98,7 +98,7 @@
</span><span class="cx">             computeBoundsForCurrentPage();
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-    return m_document; // Return true if size is available.
</del><ins>+    return m_document ? EncodedDataStatus::Complete : EncodedDataStatus::Unknown;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PDFDocumentImage::setPdfImageCachingPolicy(PDFImageCachingPolicy pdfImageCachingPolicy)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgPDFDocumentImageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.h (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.h        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.h        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool hasSingleSecurityOrigin() const override { return true; }
</span><span class="cx"> 
</span><del>-    bool dataChanged(bool allDataReceived) override;
</del><ins>+    EncodedDataStatus dataChanged(bool allDataReceived) override;
</ins><span class="cx"> 
</span><span class="cx">     void destroyDecodedData(bool /*destroyAll*/ = true) override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecodersImageDecoderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/ImageDecoder.h (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/ImageDecoder.h        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/image-decoders/ImageDecoder.h        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -81,11 +81,22 @@
</span><span class="cx">         // Lazily-decodes enough of the image to get the size (if possible).
</span><span class="cx">         // FIXME: Right now that has to be done by each subclass; factor the
</span><span class="cx">         // decode call out and use it here.
</span><del>-        virtual bool isSizeAvailable()
</del><ins>+        virtual EncodedDataStatus encodedDataStatus()
</ins><span class="cx">         {
</span><del>-            return !m_failed &amp;&amp; m_sizeAvailable;
</del><ins>+            if (m_failed)
+                return EncodedDataStatus::Error;
+
+            if (m_isAllDataReceived)
+                return EncodedDataStatus::Complete;
+
+            if (m_sizeAvailable)
+                return EncodedDataStatus::SizeAvailable;
+
+            return EncodedDataStatus::TypeAvailable;
</ins><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        bool isSizeAvailable() { return encodedDataStatus() &gt;= EncodedDataStatus::SizeAvailable; }
+
</ins><span class="cx">         virtual IntSize size() { return isSizeAvailable() ? m_size : IntSize(); }
</span><span class="cx"> 
</span><span class="cx">         IntSize scaledSize()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecodersbmpBMPImageDecodercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -56,12 +56,12 @@
</span><span class="cx">         m_reader-&gt;setData(&amp;data);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool BMPImageDecoder::isSizeAvailable()
</del><ins>+EncodedDataStatus BMPImageDecoder::encodedDataStatus()
</ins><span class="cx"> {
</span><span class="cx">     if (!ImageDecoder::isSizeAvailable())
</span><span class="cx">         decode(true);
</span><span class="cx"> 
</span><del>-    return ImageDecoder::isSizeAvailable();
</del><ins>+    return ImageDecoder::encodedDataStatus();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ImageFrame* BMPImageDecoder::frameBufferAtIndex(size_t index)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecodersbmpBMPImageDecoderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.h (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.h        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.h        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx">         // ImageDecoder
</span><span class="cx">         String filenameExtension() const override { return &quot;bmp&quot;; }
</span><span class="cx">         void setData(SharedBuffer&amp;, bool allDataReceived) override;
</span><del>-        bool isSizeAvailable() override;
</del><ins>+        EncodedDataStatus encodedDataStatus() override;
</ins><span class="cx">         ImageFrame* frameBufferAtIndex(size_t index) override;
</span><span class="cx">         // CAUTION: setFailed() deletes |m_reader|.  Be careful to avoid
</span><span class="cx">         // accessing deleted memory, especially when calling this from inside
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecodersgifGIFImageDecodercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -50,12 +50,12 @@
</span><span class="cx">         m_reader-&gt;setData(&amp;data);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool GIFImageDecoder::isSizeAvailable()
</del><ins>+EncodedDataStatus GIFImageDecoder::encodedDataStatus()
</ins><span class="cx"> {
</span><span class="cx">     if (!ImageDecoder::isSizeAvailable())
</span><del>-         decode(0, GIFSizeQuery);
</del><ins>+        decode(0, GIFSizeQuery);
</ins><span class="cx"> 
</span><del>-    return ImageDecoder::isSizeAvailable();
</del><ins>+    return ImageDecoder::encodedDataStatus();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool GIFImageDecoder::setSize(const IntSize&amp; size)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecodersgifGIFImageDecoderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.h (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.h        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.h        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx">         // ImageDecoder
</span><span class="cx">         String filenameExtension() const override { return &quot;gif&quot;; }
</span><span class="cx">         void setData(SharedBuffer&amp; data, bool allDataReceived) override;
</span><del>-        bool isSizeAvailable() override;
</del><ins>+        EncodedDataStatus encodedDataStatus() override;
</ins><span class="cx">         bool setSize(const IntSize&amp;) override;
</span><span class="cx">         size_t frameCount() const override;
</span><span class="cx">         RepetitionCount repetitionCount() const override;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecodersicoICOImageDecodercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -69,12 +69,12 @@
</span><span class="cx">         setDataForPNGDecoderAtIndex(i);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool ICOImageDecoder::isSizeAvailable()
</del><ins>+EncodedDataStatus ICOImageDecoder::encodedDataStatus()
</ins><span class="cx"> {
</span><span class="cx">     if (!ImageDecoder::isSizeAvailable())
</span><span class="cx">         decode(0, true);
</span><span class="cx"> 
</span><del>-    return ImageDecoder::isSizeAvailable();
</del><ins>+    return ImageDecoder::encodedDataStatus();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntSize ICOImageDecoder::size()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecodersicoICOImageDecoderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx">         // ImageDecoder
</span><span class="cx">         String filenameExtension() const override { return &quot;ico&quot;; }
</span><span class="cx">         void setData(SharedBuffer&amp;, bool allDataReceived) override;
</span><del>-        bool isSizeAvailable() override;
</del><ins>+        EncodedDataStatus encodedDataStatus() override;
</ins><span class="cx">         IntSize size() override;
</span><span class="cx">         IntSize frameSizeAtIndex(size_t, SubsamplingLevel) override;
</span><span class="cx">         bool setSize(const IntSize&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecodersjpegJPEGImageDecodercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -510,12 +510,12 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool JPEGImageDecoder::isSizeAvailable()
</del><ins>+EncodedDataStatus JPEGImageDecoder::encodedDataStatus()
</ins><span class="cx"> {
</span><span class="cx">     if (!ImageDecoder::isSizeAvailable())
</span><del>-         decode(true);
</del><ins>+        decode(true);
</ins><span class="cx"> 
</span><del>-    return ImageDecoder::isSizeAvailable();
</del><ins>+    return ImageDecoder::encodedDataStatus();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool JPEGImageDecoder::setSize(const IntSize&amp; size)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecodersjpegJPEGImageDecoderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx"> 
</span><span class="cx">         // ImageDecoder
</span><span class="cx">         String filenameExtension() const override { return &quot;jpg&quot;; }
</span><del>-        bool isSizeAvailable() override;
</del><ins>+        EncodedDataStatus encodedDataStatus() override;
</ins><span class="cx">         bool setSize(const IntSize&amp;) override;
</span><span class="cx">         ImageFrame* frameBufferAtIndex(size_t index) override;
</span><span class="cx">         // CAUTION: setFailed() deletes |m_reader|.  Be careful to avoid
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecoderspngPNGImageDecodercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -239,12 +239,12 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-bool PNGImageDecoder::isSizeAvailable()
</del><ins>+EncodedDataStatus PNGImageDecoder::encodedDataStatus()
</ins><span class="cx"> {
</span><span class="cx">     if (!ImageDecoder::isSizeAvailable())
</span><span class="cx">         decode(true, 0);
</span><span class="cx"> 
</span><del>-    return ImageDecoder::isSizeAvailable();
</del><ins>+    return ImageDecoder::encodedDataStatus();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool PNGImageDecoder::setSize(const IntSize&amp; size)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecoderspngPNGImageDecoderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx">         size_t frameCount() const override { return m_frameCount; }
</span><span class="cx">         RepetitionCount repetitionCount() const override;
</span><span class="cx"> #endif
</span><del>-        bool isSizeAvailable() override;
</del><ins>+        EncodedDataStatus encodedDataStatus() override;
</ins><span class="cx">         bool setSize(const IntSize&amp;) override;
</span><span class="cx">         ImageFrame* frameBufferAtIndex(size_t index) override;
</span><span class="cx">         // CAUTION: setFailed() deletes |m_reader|.  Be careful to avoid
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecoderswebpWEBPImageDecodercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -64,12 +64,12 @@
</span><span class="cx">     m_decoder = 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool WEBPImageDecoder::isSizeAvailable()
</del><ins>+EncodedDataStatus WEBPImageDecoder::encodedDataStatus()
</ins><span class="cx"> {
</span><span class="cx">     if (!ImageDecoder::isSizeAvailable())
</span><del>-         decode(true);
</del><ins>+        decode(true);
</ins><span class="cx"> 
</span><del>-    return ImageDecoder::isSizeAvailable();
</del><ins>+    return ImageDecoder::encodedDataStatus();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ImageFrame* WEBPImageDecoder::frameBufferAtIndex(size_t index)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecoderswebpWEBPImageDecoderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx">     virtual ~WEBPImageDecoder();
</span><span class="cx"> 
</span><span class="cx">     String filenameExtension() const override { return &quot;webp&quot;; }
</span><del>-    bool isSizeAvailable() override;
</del><ins>+    EncodedDataStatus encodedDataStatus() override;
</ins><span class="cx">     ImageFrame* frameBufferAtIndex(size_t index) override;
</span><span class="cx"> 
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCoresvggraphicsSVGImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/graphics/SVGImage.cpp (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/graphics/SVGImage.cpp        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/svg/graphics/SVGImage.cpp        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -416,11 +416,11 @@
</span><span class="cx">     vm.heap.deprecatedReportExtraMemory(decodedImageMemoryCost + data()-&gt;size());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool SVGImage::dataChanged(bool allDataReceived)
</del><ins>+EncodedDataStatus SVGImage::dataChanged(bool allDataReceived)
</ins><span class="cx"> {
</span><del>-    // Don't do anything if is an empty image.
</del><ins>+    // Don't do anything; it is an empty image.
</ins><span class="cx">     if (!data()-&gt;size())
</span><del>-        return true;
</del><ins>+        return EncodedDataStatus::Complete;
</ins><span class="cx"> 
</span><span class="cx">     if (allDataReceived) {
</span><span class="cx">         PageConfiguration pageConfiguration(
</span><span class="lines">@@ -466,7 +466,7 @@
</span><span class="cx">         reportApproximateMemoryCost();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return m_page != nullptr;
</del><ins>+    return m_page ? EncodedDataStatus::Complete : EncodedDataStatus::Unknown;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String SVGImage::filenameExtension() const
</span></span></pre></div>
<a id="trunkSourceWebCoresvggraphicsSVGImageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/graphics/SVGImage.h (215210 => 215211)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/graphics/SVGImage.h        2017-04-11 00:23:03 UTC (rev 215210)
+++ trunk/Source/WebCore/svg/graphics/SVGImage.h        2017-04-11 00:24:17 UTC (rev 215211)
</span><span class="lines">@@ -86,7 +86,7 @@
</span><span class="cx">     void computeIntrinsicDimensions(Length&amp; intrinsicWidth, Length&amp; intrinsicHeight, FloatSize&amp; intrinsicRatio) final;
</span><span class="cx"> 
</span><span class="cx">     void reportApproximateMemoryCost() const;
</span><del>-    bool dataChanged(bool allDataReceived) final;
</del><ins>+    EncodedDataStatus dataChanged(bool allDataReceived) final;
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: SVGImages will be unable to prune because this function is not implemented yet.
</span><span class="cx">     void destroyDecodedData(bool) final { }
</span></span></pre>
</div>
</div>

</body>
</html>