<!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>[166665] trunk</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/166665">166665</a></dd>
<dt>Author</dt> <dd>dbates@webkit.org</dd>
<dt>Date</dt> <dd>2014-04-02 14:06:33 -0700 (Wed, 02 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove Settings::maximumDecodedImageSize()
https://bugs.webkit.org/show_bug.cgi?id=131057
&lt;rdar://problem/15626368&gt;

Source/WebCore:

Reviewed by Darin Adler.

The setting Settings::maximumDecodedImageSize() and its related logic have various
shortcomings, including the inability to cancel an image load when the estimated
decoded image size exceeds the maximum decoded image size. In the iOS port, this
setting is less useful given image subsampling support. For now, we remove this
setting and its related logic. Should it turn out that such a setting is useful
then we can implement it again taking care to address the shortcomings in the
original design.

* html/HTMLCanvasElement.cpp: For the iOS port, define MaxCanvasArea to be 4580 * 1145
pixels such that the maximum size of the image buffer is 20 MB (assumes 4 bytes per pixel).
(WebCore::HTMLCanvasElement::HTMLCanvasElement):
(WebCore::HTMLCanvasElement::createImageBuffer):
* html/HTMLCanvasElement.h:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::createImageData):
(WebCore::CanvasRenderingContext2D::getImageData):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::addIncrementalDataBuffer):
(WebCore::CachedImage::finishLoading):
* loader/cache/CachedImage.h:
* page/Settings.in:

Source/WebKit/mac:

Reviewed by Darin Adler.

Remove preferences key WebKitMaximumImageSize.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences _maximumImageSize:]): Deleted.
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

LayoutTests:

Reviewed by Darin Adler.

Remove test LayoutTests/fast/images/decoded-size-exceeds-max-decoded-size.html as it
isn't applicable following the removal of the setting Settings::maximumDecodedImageSize().
Additionally update the test fast/images/bag-png.html to ensure that we dispatch
a DOM Error event when we fail to decode a malformed image.

* fast/images/bad-png.html:
* fast/images/decoded-size-exceeds-max-decoded-size-expected.txt: Removed.
* fast/images/decoded-size-exceeds-max-decoded-size.html: Removed.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastimagesbadpnghtml">trunk/LayoutTests/fast/images/bad-png.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLCanvasElementcpp">trunk/Source/WebCore/html/HTMLCanvasElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLCanvasElementh">trunk/Source/WebCore/html/HTMLCanvasElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dcpp">trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedImagecpp">trunk/Source/WebCore/loader/cache/CachedImage.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedImageh">trunk/Source/WebCore/loader/cache/CachedImage.h</a></li>
<li><a href="#trunkSourceWebCorepageSettingsin">trunk/Source/WebCore/page/Settings.in</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebPreferenceKeysPrivateh">trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebPreferencesmm">trunk/Source/WebKit/mac/WebView/WebPreferences.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebPreferencesPrivateh">trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewmm">trunk/Source/WebKit/mac/WebView/WebView.mm</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastimagesdecodedsizeexceedsmaxdecodedsizeexpectedtxt">trunk/LayoutTests/fast/images/decoded-size-exceeds-max-decoded-size-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastimagesdecodedsizeexceedsmaxdecodedsizehtml">trunk/LayoutTests/fast/images/decoded-size-exceeds-max-decoded-size.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (166664 => 166665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-04-02 21:02:22 UTC (rev 166664)
+++ trunk/LayoutTests/ChangeLog        2014-04-02 21:06:33 UTC (rev 166665)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2014-04-02  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        Remove Settings::maximumDecodedImageSize()
+        https://bugs.webkit.org/show_bug.cgi?id=131057
+        &lt;rdar://problem/15626368&gt;
+
+        Reviewed by Darin Adler.
+
+        Remove test LayoutTests/fast/images/decoded-size-exceeds-max-decoded-size.html as it
+        isn't applicable following the removal of the setting Settings::maximumDecodedImageSize().
+        Additionally update the test fast/images/bag-png.html to ensure that we dispatch
+        a DOM Error event when we fail to decode a malformed image.
+
+        * fast/images/bad-png.html:
+        * fast/images/decoded-size-exceeds-max-decoded-size-expected.txt: Removed.
+        * fast/images/decoded-size-exceeds-max-decoded-size.html: Removed.
+
</ins><span class="cx"> 2014-04-02  Timothy Hatcher  &lt;timothy@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove Input domain from the Web Inspector protocol.
</span></span></pre></div>
<a id="trunkLayoutTestsfastimagesbadpnghtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/images/bad-png.html (166664 => 166665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/images/bad-png.html        2014-04-02 21:02:22 UTC (rev 166664)
+++ trunk/LayoutTests/fast/images/bad-png.html        2014-04-02 21:06:33 UTC (rev 166665)
</span><span class="lines">@@ -1,8 +1,17 @@
</span><span class="cx"> &lt;html&gt;
</span><span class="cx">   &lt;head&gt;
</span><span class="cx">     &lt;script&gt;
</span><del>-      if (window.testRunner)
</del><ins>+      if (window.testRunner) {
+        testRunner.waitUntilDone();
</ins><span class="cx">         testRunner.dumpAsText();
</span><ins>+      }
+
+      function testPassed()
+      {
+        document.getElementById(&quot;result&quot;).innerText = &quot;PASS&quot;;
+        if (window.testRunner)
+          testRunner.notifyDone();
+      }
</ins><span class="cx">     &lt;/script&gt;
</span><span class="cx"> 
</span><span class="cx">    &lt;/head&gt;
</span><span class="lines">@@ -10,7 +19,7 @@
</span><span class="cx">      &lt;!-- This previously tried to recursively decode the PNG, leading to heap
</span><span class="cx">           corruption when trying to unwind the stack through a member of a
</span><span class="cx">           destroyed object. --&gt;
</span><del>-     &lt;img src=&quot;resources/bad-png.png&quot;&gt;
-     &lt;p&gt;PASS&lt;/p&gt;
</del><ins>+     &lt;img src=&quot;resources/bad-png.png&quot; onerror=&quot;testPassed()&quot;&gt;
+     &lt;p id=&quot;result&quot;&gt;FAIL&lt;/p&gt;
</ins><span class="cx">    &lt;/body&gt;
</span><span class="cx">  &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastimagesdecodedsizeexceedsmaxdecodedsizeexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/images/decoded-size-exceeds-max-decoded-size-expected.txt (166664 => 166665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/images/decoded-size-exceeds-max-decoded-size-expected.txt        2014-04-02 21:02:22 UTC (rev 166664)
+++ trunk/LayoutTests/fast/images/decoded-size-exceeds-max-decoded-size-expected.txt        2014-04-02 21:06:33 UTC (rev 166665)
</span><span class="lines">@@ -1,10 +0,0 @@
</span><del>-Tests that an image whose size exceeds the maximum decoded size dispatches a DOM error event.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS event.type is 'error'.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestsfastimagesdecodedsizeexceedsmaxdecodedsizehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/images/decoded-size-exceeds-max-decoded-size.html (166664 => 166665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/images/decoded-size-exceeds-max-decoded-size.html        2014-04-02 21:02:22 UTC (rev 166664)
+++ trunk/LayoutTests/fast/images/decoded-size-exceeds-max-decoded-size.html        2014-04-02 21:06:33 UTC (rev 166665)
</span><span class="lines">@@ -1,26 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;script&gt;
-window.jsTestIsAsync = true;
-if (window.internals)
-    window.internals.settings.setMaximumDecodedImageSize(0); // bytes
-&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;img src=&quot;resources/red-256x256.jpg&quot; width=&quot;256&quot; height=&quot;256&quot; onerror=&quot;checkDispatchedEvent(event)&quot; onload=&quot;checkDispatchedEvent(event)&quot;&gt;
-&lt;script&gt;
-description(&quot;Tests that an image whose size exceeds the maximum decoded size dispatches a DOM error event.&quot;);
-function checkDispatchedEvent(event)
-{
-    if (event.type === &quot;error&quot;)
-        testPassed(&quot;event.type is 'error'.&quot;);
-    else
-        testPassed(&quot;event.type should have been 'error'. Was '&quot; + event.type + &quot;'.&quot;);
-    finishJSTest();
-}
-&lt;/script&gt;
-&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (166664 => 166665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-04-02 21:02:22 UTC (rev 166664)
+++ trunk/Source/WebCore/ChangeLog        2014-04-02 21:06:33 UTC (rev 166665)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2014-04-02  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        Remove Settings::maximumDecodedImageSize()
+        https://bugs.webkit.org/show_bug.cgi?id=131057
+        &lt;rdar://problem/15626368&gt;
+
+        Reviewed by Darin Adler.
+
+        The setting Settings::maximumDecodedImageSize() and its related logic have various
+        shortcomings, including the inability to cancel an image load when the estimated
+        decoded image size exceeds the maximum decoded image size. In the iOS port, this
+        setting is less useful given image subsampling support. For now, we remove this
+        setting and its related logic. Should it turn out that such a setting is useful
+        then we can implement it again taking care to address the shortcomings in the
+        original design.
+
+        * html/HTMLCanvasElement.cpp: For the iOS port, define MaxCanvasArea to be 4580 * 1145
+        pixels such that the maximum size of the image buffer is 20 MB (assumes 4 bytes per pixel).
+        (WebCore::HTMLCanvasElement::HTMLCanvasElement):
+        (WebCore::HTMLCanvasElement::createImageBuffer):
+        * html/HTMLCanvasElement.h:
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::createImageData):
+        (WebCore::CanvasRenderingContext2D::getImageData):
+        * loader/cache/CachedImage.cpp:
+        (WebCore::CachedImage::addIncrementalDataBuffer):
+        (WebCore::CachedImage::finishLoading):
+        * loader/cache/CachedImage.h:
+        * page/Settings.in:
+
</ins><span class="cx"> 2014-04-02  Martin Hock  &lt;mhock@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unify private browsing with sessions.
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLCanvasElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLCanvasElement.cpp (166664 => 166665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLCanvasElement.cpp        2014-04-02 21:02:22 UTC (rev 166664)
+++ trunk/Source/WebCore/html/HTMLCanvasElement.cpp        2014-04-02 21:06:33 UTC (rev 166665)
</span><span class="lines">@@ -67,9 +67,11 @@
</span><span class="cx"> 
</span><span class="cx"> // Firefox limits width/height to 32767 pixels, but slows down dramatically before it
</span><span class="cx"> // reaches that limit. We limit by area instead, giving us larger maximum dimensions,
</span><del>-// in exchange for a smaller maximum canvas size.
-#if !PLATFORM(IOS)
-static const float MaxCanvasArea = 32768 * 8192; // Maximum canvas area in CSS pixels
</del><ins>+// in exchange for a smaller maximum canvas size. The maximum canvas size is in CSS pixels.
+#if PLATFORM(IOS)
+static const float MaxCanvasArea = 4580 * 1145; // 20 MB assuming 4 bytes per pixel
+#else
+static const float MaxCanvasArea = 32768 * 8192;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> HTMLCanvasElement::HTMLCanvasElement(const QualifiedName&amp; tagName, Document&amp; document)
</span><span class="lines">@@ -79,10 +81,6 @@
</span><span class="cx">     , m_ignoreReset(false)
</span><span class="cx">     , m_deviceScaleFactor(targetDeviceScaleFactor())
</span><span class="cx">     , m_originClean(true)
</span><del>-#if PLATFORM(IOS)
-    // FIXME: We should look to reconcile usage of MaxCanvasArea and m_maximumDecodedImageSize.
-    , m_maximumDecodedImageSize(document.settings() ? document.settings()-&gt;maximumDecodedImageSize() : 0)
-#endif
</del><span class="cx">     , m_hasCreatedImageBuffer(false)
</span><span class="cx">     , m_didClearImageBuffer(false)
</span><span class="cx"> {
</span><span class="lines">@@ -574,13 +572,8 @@
</span><span class="cx">     if (!deviceSize.isExpressibleAsIntSize())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-    if (deviceSize.width() * deviceSize.height() * 4 &gt; m_maximumDecodedImageSize)
-        return;
-#else
</del><span class="cx">     if (deviceSize.width() * deviceSize.height() &gt; MaxCanvasArea)
</span><span class="cx">         return;
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx">     IntSize bufferSize(deviceSize.width(), deviceSize.height());
</span><span class="cx">     if (!bufferSize.width() || !bufferSize.height())
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLCanvasElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLCanvasElement.h (166664 => 166665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLCanvasElement.h        2014-04-02 21:02:22 UTC (rev 166664)
+++ trunk/Source/WebCore/html/HTMLCanvasElement.h        2014-04-02 21:06:33 UTC (rev 166665)
</span><span class="lines">@@ -128,12 +128,6 @@
</span><span class="cx">     void setOriginTainted() { m_originClean = false; }
</span><span class="cx">     bool originClean() const { return m_originClean; }
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-    // FIXME: Can we use unsigned data types, unsigned or size_t?
-    void setMaximumDecodedImageSize(float maximumDecodedImageSize) { m_maximumDecodedImageSize = maximumDecodedImageSize; }
-    float maximumDecodedImageSize() { return m_maximumDecodedImageSize; }
-#endif
-
</del><span class="cx">     AffineTransform baseTransform() const;
</span><span class="cx"> 
</span><span class="cx">     void makeRenderingResultsAvailable();
</span><span class="lines">@@ -182,11 +176,6 @@
</span><span class="cx">     float m_deviceScaleFactor;
</span><span class="cx">     bool m_originClean;
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-    // FIXME: Can we use a unsigned data type, unsigned or size_t?
-    float m_maximumDecodedImageSize;
-#endif
-
</del><span class="cx">     // m_createdImageBuffer means we tried to malloc the buffer.  We didn't necessarily get it.
</span><span class="cx">     mutable bool m_hasCreatedImageBuffer;
</span><span class="cx">     mutable bool m_didClearImageBuffer;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (166664 => 166665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp        2014-04-02 21:02:22 UTC (rev 166664)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp        2014-04-02 21:06:33 UTC (rev 166665)
</span><span class="lines">@@ -1857,15 +1857,6 @@
</span><span class="cx">         return 0;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-    // If the canvas element was created before Document had a Frame,
-    // then no maximumDecodedImageSize was set.
-    if (!canvas()-&gt;maximumDecodedImageSize()) {
-        if (Settings* settings = canvas()-&gt;document().settings())
-            canvas()-&gt;setMaximumDecodedImageSize(settings-&gt;maximumDecodedImageSize());
-    }
-#endif
-
</del><span class="cx">     FloatSize logicalSize(fabs(sw), fabs(sh));
</span><span class="cx">     if (!logicalSize.isExpressibleAsIntSize())
</span><span class="cx">         return 0;
</span><span class="lines">@@ -1916,15 +1907,6 @@
</span><span class="cx">         sh = -sh;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-    // If the canvas element was created before Document had a Frame,
-    // then no maximumDecodedImageSize was set.
-    if (!canvas()-&gt;maximumDecodedImageSize()) {
-        if (Settings* settings = canvas()-&gt;document().settings())
-            canvas()-&gt;setMaximumDecodedImageSize(settings-&gt;maximumDecodedImageSize());
-    }
-#endif
-
</del><span class="cx">     FloatRect logicalRect(sx, sy, sw, sh);
</span><span class="cx">     if (logicalRect.width() &lt; 1)
</span><span class="cx">         logicalRect.setWidth(1);
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedImage.cpp (166664 => 166665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedImage.cpp        2014-04-02 21:02:22 UTC (rev 166664)
+++ trunk/Source/WebCore/loader/cache/CachedImage.cpp        2014-04-02 21:06:33 UTC (rev 166665)
</span><span class="lines">@@ -381,18 +381,6 @@
</span><span class="cx">     m_image.clear();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool CachedImage::canBeDrawn() const
-{
-    if (!m_image || m_image-&gt;isNull())
-        return false;
-
-    if (!m_loader || m_loader-&gt;reachedTerminalState())
-        return true;
-
-    size_t estimatedDecodedImageSize = m_image-&gt;width() * m_image-&gt;height() * 4; // no overflow check
-    return estimatedDecodedImageSize &lt;= m_loader-&gt;frameLoader()-&gt;frame().settings().maximumDecodedImageSize();
-}
-
</del><span class="cx"> void CachedImage::addIncrementalDataBuffer(ResourceBuffer* data)
</span><span class="cx"> {
</span><span class="cx">     m_data = data;
</span><span class="lines">@@ -408,8 +396,8 @@
</span><span class="cx">     if (!sizeAvailable)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (!canBeDrawn()) {
-        // There's no image to draw or its decoded size is bigger than the maximum allowed.
</del><ins>+    if (m_image-&gt;isNull()) {
+        // Image decoding failed. Either we need more image data or the image data is malformed.
</ins><span class="cx">         error(errorOccurred() ? status() : DecodeError);
</span><span class="cx">         if (inCache())
</span><span class="cx">             memoryCache()-&gt;remove(this);
</span><span class="lines">@@ -447,8 +435,8 @@
</span><span class="cx">     if (m_image)
</span><span class="cx">         m_image-&gt;setData(m_data-&gt;sharedBuffer(), true);
</span><span class="cx"> 
</span><del>-    if (!canBeDrawn()) {
-        // There's no image to draw or its decoded size is bigger than the maximum allowed.
</del><ins>+    if (!m_image || m_image-&gt;isNull()) {
+        // Image decoding failed; the image data is malformed.
</ins><span class="cx">         error(errorOccurred() ? status() : DecodeError);
</span><span class="cx">         if (inCache())
</span><span class="cx">             memoryCache()-&gt;remove(this);
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedImageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedImage.h (166664 => 166665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedImage.h        2014-04-02 21:02:22 UTC (rev 166664)
+++ trunk/Source/WebCore/loader/cache/CachedImage.h        2014-04-02 21:06:33 UTC (rev 166665)
</span><span class="lines">@@ -99,7 +99,6 @@
</span><span class="cx"> 
</span><span class="cx">     void createImage();
</span><span class="cx">     void clearImage();
</span><del>-    bool canBeDrawn() const;
</del><span class="cx">     // If not null, changeRect is the changed part of the image.
</span><span class="cx">     void notifyObservers(const IntRect* changeRect = 0);
</span><span class="cx">     virtual PurgePriority purgePriority() const override { return PurgeFirst; }
</span></span></pre></div>
<a id="trunkSourceWebCorepageSettingsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Settings.in (166664 => 166665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Settings.in        2014-04-02 21:02:22 UTC (rev 166664)
+++ trunk/Source/WebCore/page/Settings.in        2014-04-02 21:06:33 UTC (rev 166665)
</span><span class="lines">@@ -25,7 +25,6 @@
</span><span class="cx"> minimumAccelerated2dCanvasSize type=int, initial=257*256
</span><span class="cx"> 
</span><span class="cx"> layoutFallbackWidth type=int, initial=980
</span><del>-maximumDecodedImageSize type=size_t, initial=std::numeric_limits&lt;size_t&gt;::max()
</del><span class="cx"> deviceWidth type=int, initial=0
</span><span class="cx"> deviceHeight type=int, initial=0
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (166664 => 166665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-04-02 21:02:22 UTC (rev 166664)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-04-02 21:06:33 UTC (rev 166665)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2014-04-02  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        Remove Settings::maximumDecodedImageSize()
+        https://bugs.webkit.org/show_bug.cgi?id=131057
+        &lt;rdar://problem/15626368&gt;
+
+        Reviewed by Darin Adler. 
+
+        Remove preferences key WebKitMaximumImageSize.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        (-[WebPreferences _maximumImageSize:]): Deleted.
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
</ins><span class="cx"> 2014-04-02  Martin Hock  &lt;mhock@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unify private browsing with sessions.
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebPreferenceKeysPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h (166664 => 166665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h        2014-04-02 21:02:22 UTC (rev 166664)
+++ trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h        2014-04-02 21:06:33 UTC (rev 166665)
</span><span class="lines">@@ -180,7 +180,6 @@
</span><span class="cx"> #define WebKitMinimumZoomFontSizePreferenceKey @&quot;WebKitMinimumZoomFontSizePreferenceKey&quot;
</span><span class="cx"> 
</span><span class="cx"> #if TARGET_OS_IPHONE
</span><del>-#define WebKitMaximumImageSizePreferenceKey @&quot;WebKitMaximumImageSize&quot;
</del><span class="cx"> #define WebKitStandalonePreferenceKey @&quot;WebKitStandalonePreferenceKey&quot;
</span><span class="cx"> #define WebKitTelephoneParsingEnabledPreferenceKey @&quot;WebKitTelephoneParsingEnabledPreferenceKey&quot;
</span><span class="cx"> #define WebKitAlwaysUseBaselineOfPrimaryFontPreferenceKey @&quot;WebKitAlwaysUseBaselineOfPrimaryFontPreferenceKey&quot;
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebPreferencesmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebPreferences.mm (166664 => 166665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebPreferences.mm        2014-04-02 21:02:22 UTC (rev 166664)
+++ trunk/Source/WebKit/mac/WebView/WebPreferences.mm        2014-04-02 21:06:33 UTC (rev 166665)
</span><span class="lines">@@ -394,9 +394,6 @@
</span><span class="cx">     WTF::initializeMainThreadToProcessMainThread();
</span><span class="cx">     RunLoop::initializeMainRunLoop();
</span><span class="cx"> #endif
</span><del>-#if PLATFORM(IOS)
-    static unsigned defaultMaximumImageSize = 20 * 1024 * 1024;
-#endif
</del><span class="cx"> 
</span><span class="cx">     NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
</span><span class="cx">         @&quot;Times&quot;,                       WebKitStandardFontPreferenceKey,
</span><span class="lines">@@ -557,7 +554,6 @@
</span><span class="cx">         [NSNumber numberWithBool:NO],   WebKitPlugInSnapshottingEnabledPreferenceKey,
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-        [NSNumber numberWithUnsignedInt:defaultMaximumImageSize], WebKitMaximumImageSizePreferenceKey,
</del><span class="cx">         [NSNumber numberWithBool:NO],   WebKitTelephoneParsingEnabledPreferenceKey,
</span><span class="cx">         [NSNumber numberWithInt:-1],      WebKitLayoutIntervalPreferenceKey,
</span><span class="cx">         [NSNumber numberWithFloat:-1.0f], WebKitMaxParseDurationPreferenceKey,
</span><span class="lines">@@ -1405,11 +1401,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-- (size_t)_maximumImageSize
-{
-    return [[NSUserDefaults standardUserDefaults] integerForKey:WebKitMaximumImageSizePreferenceKey];
-}
-
</del><span class="cx"> - (BOOL)_standalone
</span><span class="cx"> {
</span><span class="cx">     return [self _boolValueForKey:WebKitStandalonePreferenceKey];
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebPreferencesPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h (166664 => 166665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h        2014-04-02 21:02:22 UTC (rev 166664)
+++ trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h        2014-04-02 21:06:33 UTC (rev 166665)
</span><span class="lines">@@ -292,7 +292,6 @@
</span><span class="cx"> 
</span><span class="cx"> // Other private methods
</span><span class="cx"> #if TARGET_OS_IPHONE
</span><del>-- (size_t)_maximumImageSize;
</del><span class="cx"> - (BOOL)_standalone;
</span><span class="cx"> - (void)_setStandalone:(BOOL)flag;
</span><span class="cx"> - (void)_setTelephoneNumberParsingEnabled:(BOOL)flag;
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (166664 => 166665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebView.mm        2014-04-02 21:02:22 UTC (rev 166664)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm        2014-04-02 21:06:33 UTC (rev 166665)
</span><span class="lines">@@ -2288,7 +2288,6 @@
</span><span class="cx"> #else
</span><span class="cx">     // iOS-specific settings
</span><span class="cx">     settings.setStandalone([preferences _standalone]);
</span><del>-    settings.setMaximumDecodedImageSize([preferences _maximumImageSize]);
</del><span class="cx">     settings.setTelephoneNumberParsingEnabled([preferences _telephoneNumberParsingEnabled]);
</span><span class="cx">     settings.setAlwaysUseBaselineOfPrimaryFont([preferences _alwaysUseBaselineOfPrimaryFont]);
</span><span class="cx">     settings.setAllowMultiElementImplicitSubmission([preferences _allowMultiElementImplicitFormSubmission]);
</span></span></pre>
</div>
</div>

</body>
</html>