<!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>[181952] releases/WebKitGTK/webkit-2.8</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/181952">181952</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2015-03-25 04:40:32 -0700 (Wed, 25 Mar 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/181888">r181888</a> - Update empty image canvas tests and fix a related bug
https://bugs.webkit.org/show_bug.cgi?id=142694
Reviewed by Chris Dumez.
Source/WebCore:
During the work on https://bugs.webkit.org/show_bug.cgi?id=142677
we encountered an issue with canvas tests related to empty image handling
when drawn or used as a pattern. After updating these tests, an issue with
pattern handling was encountered.
The spec, as well as Chrome's implementation, say that when an empty image
is used as a pattern, createPattern should return null. See
https://html.spec.whatwg.org/multipage/scripting.html#fill-and-stroke-styles:check-the-usability-of-the-image-argument
Instead, createPattern returned an exception in this case.
This patch fixes that and makes sure that it returns a null when image loading hasn't started.
Tests: canvas/philip/tests/2d.drawImage.incomplete.emptysrc.html
canvas/philip/tests/2d.drawImage.incomplete.nosrc.html
canvas/philip/tests/2d.drawImage.incomplete.removedsrc.html
canvas/philip/tests/2d.pattern.image.incomplete.emptysrc.html
canvas/philip/tests/2d.pattern.image.incomplete.removedsrc.html
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::createPattern): Return "null" if image is not fully decodeable.
LayoutTests:
Tests below imported from https://github.com/w3c/web-platform-tests/tree/master/2dcontext/drawing-images-to-the-canvas
* canvas/philip/tests/2d.drawImage.incomplete-expected.txt: Removed.
* canvas/philip/tests/2d.drawImage.incomplete.emptysrc-expected.txt: Added.
* canvas/philip/tests/2d.drawImage.incomplete.emptysrc.html: Added.
* canvas/philip/tests/2d.drawImage.incomplete.html: Removed.
* canvas/philip/tests/2d.drawImage.incomplete.nosrc-expected.txt: Added.
* canvas/philip/tests/2d.drawImage.incomplete.nosrc.html: Added.
* canvas/philip/tests/2d.drawImage.incomplete.removedsrc-expected.txt: Added.
* canvas/philip/tests/2d.drawImage.incomplete.removedsrc.html: Added.
Tests below imported from https://github.com/w3c/web-platform-tests/tree/master/2dcontext/fill-and-stroke-styles
* canvas/philip/tests/2d.pattern.image.incomplete-expected.txt: Removed.
* canvas/philip/tests/2d.pattern.image.incomplete.empty-expected.txt: Removed.
* canvas/philip/tests/2d.pattern.image.incomplete.empty.html: Removed.
* canvas/philip/tests/2d.pattern.image.incomplete.emptysrc-expected.txt: Added.
* canvas/philip/tests/2d.pattern.image.incomplete.emptysrc.html: Added.
* canvas/philip/tests/2d.pattern.image.incomplete.html: Removed.
* canvas/philip/tests/2d.pattern.image.incomplete.omitted-expected.txt: Removed.
* canvas/philip/tests/2d.pattern.image.incomplete.omitted.html: Removed.
* canvas/philip/tests/2d.pattern.image.incomplete.removedsrc-expected.txt: Added.
This test currently fails and will be fixed in https://bugs.webkit.org/show_bug.cgi?id=142677
* canvas/philip/tests/2d.pattern.image.incomplete.removedsrc.html: Added.
Test below imported from https://chromium.googlesource.com/chromium/blink/+/master/LayoutTests/fast/canvas/
* fast/canvas/canvas-empty-image-pattern.html: Aligned with spec/Chrome.
* fast/canvas/canvas-empty-image-pattern-expected.txt: Aligned with spec/Chrome.
* TestExpectations: Added 2d.pattern.image.incomplete.removedsrc.html as an expected failure.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestsChangeLog">releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestsfastcanvascanvasemptyimagepatternexpectedtxt">releases/WebKitGTK/webkit-2.8/LayoutTests/fast/canvas/canvas-empty-image-pattern-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestsfastcanvascanvasemptyimagepatternhtml">releases/WebKitGTK/webkit-2.8/LayoutTests/fast/canvas/canvas-empty-image-pattern.html</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebCorehtmlcanvasCanvasRenderingContext2Dcpp">releases/WebKitGTK/webkit-2.8/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2ddrawImageincompleteemptysrcexpectedtxt">releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.emptysrc-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2ddrawImageincompleteemptysrchtml">releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.emptysrc.html</a></li>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2ddrawImageincompletenosrcexpectedtxt">releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.nosrc-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2ddrawImageincompletenosrchtml">releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.nosrc.html</a></li>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2ddrawImageincompleteremovedsrcexpectedtxt">releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.removedsrc-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2ddrawImageincompleteremovedsrchtml">releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.removedsrc.html</a></li>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2dpatternimageincompleteemptysrcexpectedtxt">releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.emptysrc-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2dpatternimageincompleteemptysrchtml">releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.emptysrc.html</a></li>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2dpatternimageincompleteremovedsrcexpectedtxt">releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.removedsrc-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2dpatternimageincompleteremovedsrchtml">releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.removedsrc.html</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2ddrawImageincompleteexpectedtxt">releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2ddrawImageincompletehtml">releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.html</a></li>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2dpatternimageincompleteexpectedtxt">releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2dpatternimageincompleteemptyexpectedtxt">releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.empty-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2dpatternimageincompleteemptyhtml">releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.empty.html</a></li>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2dpatternimageincompletehtml">releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.html</a></li>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2dpatternimageincompleteomittedexpectedtxt">releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.omitted-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2dpatternimageincompleteomittedhtml">releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.omitted.html</a></li>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestsfastcanvascanvasemptyimagepatternexpectedpng">releases/WebKitGTK/webkit-2.8/LayoutTests/fast/canvas/canvas-empty-image-pattern-expected.png</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit28LayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog (181951 => 181952)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog        2015-03-25 11:32:41 UTC (rev 181951)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog        2015-03-25 11:40:32 UTC (rev 181952)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2015-03-23 Yoav Weiss <yoav@yoav.ws>
+
+ Update empty image canvas tests and fix a related bug
+ https://bugs.webkit.org/show_bug.cgi?id=142694
+
+ Reviewed by Chris Dumez.
+
+ Tests below imported from https://github.com/w3c/web-platform-tests/tree/master/2dcontext/drawing-images-to-the-canvas
+ * canvas/philip/tests/2d.drawImage.incomplete-expected.txt: Removed.
+ * canvas/philip/tests/2d.drawImage.incomplete.emptysrc-expected.txt: Added.
+ * canvas/philip/tests/2d.drawImage.incomplete.emptysrc.html: Added.
+ * canvas/philip/tests/2d.drawImage.incomplete.html: Removed.
+ * canvas/philip/tests/2d.drawImage.incomplete.nosrc-expected.txt: Added.
+ * canvas/philip/tests/2d.drawImage.incomplete.nosrc.html: Added.
+ * canvas/philip/tests/2d.drawImage.incomplete.removedsrc-expected.txt: Added.
+ * canvas/philip/tests/2d.drawImage.incomplete.removedsrc.html: Added.
+
+ Tests below imported from https://github.com/w3c/web-platform-tests/tree/master/2dcontext/fill-and-stroke-styles
+ * canvas/philip/tests/2d.pattern.image.incomplete-expected.txt: Removed.
+ * canvas/philip/tests/2d.pattern.image.incomplete.empty-expected.txt: Removed.
+ * canvas/philip/tests/2d.pattern.image.incomplete.empty.html: Removed.
+ * canvas/philip/tests/2d.pattern.image.incomplete.emptysrc-expected.txt: Added.
+ * canvas/philip/tests/2d.pattern.image.incomplete.emptysrc.html: Added.
+ * canvas/philip/tests/2d.pattern.image.incomplete.html: Removed.
+ * canvas/philip/tests/2d.pattern.image.incomplete.omitted-expected.txt: Removed.
+ * canvas/philip/tests/2d.pattern.image.incomplete.omitted.html: Removed.
+ * canvas/philip/tests/2d.pattern.image.incomplete.removedsrc-expected.txt: Added.
+ This test currently fails and will be fixed in https://bugs.webkit.org/show_bug.cgi?id=142677
+ * canvas/philip/tests/2d.pattern.image.incomplete.removedsrc.html: Added.
+
+ Test below imported from https://chromium.googlesource.com/chromium/blink/+/master/LayoutTests/fast/canvas/
+ * fast/canvas/canvas-empty-image-pattern.html: Aligned with spec/Chrome.
+ * fast/canvas/canvas-empty-image-pattern-expected.txt: Aligned with spec/Chrome.
+ * TestExpectations: Added 2d.pattern.image.incomplete.removedsrc.html as an expected failure.
+
</ins><span class="cx"> 2015-03-23 Anders Carlsson <andersca@apple.com>
</span><span class="cx">
</span><span class="cx"> Make platform/mac-wk2/plugins/destroy-during-async-npp-new.html work again
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2ddrawImageincompleteexpectedtxt"></a>
<div class="delfile"><h4>Deleted: releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete-expected.txt (181951 => 181952)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete-expected.txt        2015-03-25 11:32:41 UTC (rev 181951)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete-expected.txt        2015-03-25 11:40:32 UTC (rev 181952)
</span><span class="lines">@@ -1 +0,0 @@
</span><del>-Passed
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2ddrawImageincompleteemptysrcexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.emptysrc-expected.txt (0 => 181952)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.emptysrc-expected.txt         (rev 0)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.emptysrc-expected.txt        2015-03-25 11:40:32 UTC (rev 181952)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+2d.drawImage.incomplete.emptysrc
+
+Actual output:
+
+Expected output:
+
+
+
+
+
+PASS Canvas test: 2d.drawImage.incomplete.emptysrc
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2ddrawImageincompleteemptysrchtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.emptysrc.html (0 => 181952)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.emptysrc.html         (rev 0)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.emptysrc.html        2015-03-25 11:40:32 UTC (rev 181952)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.drawImage.incomplete.emptysrc</title>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script src="../../../imported/w3c/web-platform-tests/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.drawImage.incomplete.emptysrc</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+var img = document.getElementById('red.png');
+img.src = "";
+ctx.drawImage(img, 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+<img src="/images/red.png" id="red.png" class="resource">
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2ddrawImageincompletehtml"></a>
<div class="delfile"><h4>Deleted: releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.html (181951 => 181952)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.html        2015-03-25 11:32:41 UTC (rev 181951)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.html        2015-03-25 11:40:32 UTC (rev 181952)
</span><span class="lines">@@ -1,25 +0,0 @@
</span><del>-<!DOCTYPE html>
-<title>Canvas test: 2d.drawImage.incomplete</title>
-<script src="../tests.js"></script>
-<link rel="stylesheet" href="../tests.css">
-<body>
-<p id="passtext">Pass</p>
-<p id="failtext">Fail</p>
-<p class="output">These images should be identical:</p>
-<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
-<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
-<ul id="d"></ul>
-<script>
-_addTest(function(canvas, ctx) {
-
-ctx.fillStyle = '#0f0';
-ctx.fillRect(0, 0, 100, 50);
-var img = new Image();
-img.src = "NotARealFileName.png";
-_assertSame(img.complete, false, "img.complete", "false");
-ctx.drawImage(img, 0, 0);
-
-
-});
-</script>
-
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2ddrawImageincompletenosrcexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.nosrc-expected.txt (0 => 181952)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.nosrc-expected.txt         (rev 0)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.nosrc-expected.txt        2015-03-25 11:40:32 UTC (rev 181952)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+2d.drawImage.incomplete.nosrc
+
+Actual output:
+
+Expected output:
+
+
+
+
+PASS Canvas test: 2d.drawImage.incomplete.nosrc
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2ddrawImageincompletenosrchtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.nosrc.html (0 => 181952)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.nosrc.html         (rev 0)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.nosrc.html        2015-03-25 11:40:32 UTC (rev 181952)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.drawImage.incomplete.nosrc</title>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script src="../../../imported/w3c/web-platform-tests/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.drawImage.incomplete.nosrc</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+var img = new Image();
+ctx.drawImage(img, 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2ddrawImageincompleteremovedsrcexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.removedsrc-expected.txt (0 => 181952)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.removedsrc-expected.txt         (rev 0)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.removedsrc-expected.txt        2015-03-25 11:40:32 UTC (rev 181952)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+2d.drawImage.incomplete.removedsrc
+
+Actual output:
+
+Expected output:
+
+
+
+
+
+PASS Canvas test: 2d.drawImage.incomplete.removedsrc
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2ddrawImageincompleteremovedsrchtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.removedsrc.html (0 => 181952)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.removedsrc.html         (rev 0)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.drawImage.incomplete.removedsrc.html        2015-03-25 11:40:32 UTC (rev 181952)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.drawImage.incomplete.removedsrc</title>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script src="../../../imported/w3c/web-platform-tests/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.drawImage.incomplete.removedsrc</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+var img = document.getElementById('red.png');
+img.removeAttribute('src');
+ctx.drawImage(img, 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+<img src="/images/red.png" id="red.png" class="resource">
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2dpatternimageincompleteexpectedtxt"></a>
<div class="delfile"><h4>Deleted: releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete-expected.txt (181951 => 181952)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete-expected.txt        2015-03-25 11:32:41 UTC (rev 181951)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete-expected.txt        2015-03-25 11:40:32 UTC (rev 181952)
</span><span class="lines">@@ -1 +0,0 @@
</span><del>-Passed
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2dpatternimageincompleteemptyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.empty-expected.txt (181951 => 181952)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.empty-expected.txt        2015-03-25 11:32:41 UTC (rev 181951)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.empty-expected.txt        2015-03-25 11:40:32 UTC (rev 181952)
</span><span class="lines">@@ -1,2 +0,0 @@
</span><del>-Passed
-
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2dpatternimageincompleteemptyhtml"></a>
<div class="delfile"><h4>Deleted: releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.empty.html (181951 => 181952)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.empty.html        2015-03-25 11:32:41 UTC (rev 181951)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.empty.html        2015-03-25 11:40:32 UTC (rev 181952)
</span><span class="lines">@@ -1,28 +0,0 @@
</span><del>-<!DOCTYPE html>
-<title>Canvas test: 2d.pattern.image.incomplete.empty</title>
-<script src="../tests.js"></script>
-<link rel="stylesheet" href="../tests.css">
-<body>
-<p id="passtext">Pass</p>
-<p id="failtext">Fail</p>
-<p class="output">These images should be identical:</p>
-<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
-
-<ul id="d"></ul>
-<script>
-_addTest(function(canvas, ctx) {
-
-var img = document.getElementById('green.png');
-img.src = "";
-var _thrown = undefined;
-try{
- ctx.createPattern(img, 'repeat');
-}catch(e) {
- _thrown = e;
-}
-_assert(_thrown && _thrown.name == "InvalidStateError" && _thrown.code == DOMException.INVALID_STATE_ERR, "should throw InvalidStateError");
-
-});
-</script>
-<img src="../images/green.png" id="green.png" class="resource">
-
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2dpatternimageincompleteemptysrcexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.emptysrc-expected.txt (0 => 181952)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.emptysrc-expected.txt         (rev 0)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.emptysrc-expected.txt        2015-03-25 11:40:32 UTC (rev 181952)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+2d.pattern.image.incomplete.emptysrc
+
+Actual output:
+
+
+
+PASS Canvas test: 2d.pattern.image.incomplete.emptysrc
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2dpatternimageincompleteemptysrchtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.emptysrc.html (0 => 181952)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.emptysrc.html         (rev 0)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.emptysrc.html        2015-03-25 11:40:32 UTC (rev 181952)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.pattern.image.incomplete.emptysrc</title>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script src="../../../imported/w3c/web-platform-tests/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.pattern.image.incomplete.emptysrc</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+var img = document.getElementById('red.png');
+img.src = "";
+_assertSame(ctx.createPattern(img, 'repeat'), null, "ctx.createPattern(img, 'repeat')", "null");
+
+
+});
+</script>
+<img src="/images/red.png" id="red.png" class="resource">
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2dpatternimageincompletehtml"></a>
<div class="delfile"><h4>Deleted: releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.html (181951 => 181952)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.html        2015-03-25 11:32:41 UTC (rev 181951)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.html        2015-03-25 11:40:32 UTC (rev 181952)
</span><span class="lines">@@ -1,23 +0,0 @@
</span><del>-<!DOCTYPE html>
-<title>Canvas test: 2d.pattern.image.incomplete</title>
-<script src="../tests.js"></script>
-<link rel="stylesheet" href="../tests.css">
-<body>
-<p id="passtext">Pass</p>
-<p id="failtext">Fail</p>
-<p class="output">These images should be identical:</p>
-<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
-
-<ul id="d"></ul>
-<script>
-_addTest(function(canvas, ctx) {
-
-var img = new Image();
-img.src = "NotARealFileName.png";
-_assertSame(img.complete, false, "img.complete", "false");
-_assertSame(ctx.createPattern(img, 'repeat'), null, "ctx.createPattern(img, 'repeat')", "null");
-
-
-});
-</script>
-
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2dpatternimageincompleteomittedexpectedtxt"></a>
<div class="delfile"><h4>Deleted: releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.omitted-expected.txt (181951 => 181952)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.omitted-expected.txt        2015-03-25 11:32:41 UTC (rev 181951)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.omitted-expected.txt        2015-03-25 11:40:32 UTC (rev 181952)
</span><span class="lines">@@ -1 +0,0 @@
</span><del>-Passed
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2dpatternimageincompleteomittedhtml"></a>
<div class="delfile"><h4>Deleted: releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.omitted.html (181951 => 181952)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.omitted.html        2015-03-25 11:32:41 UTC (rev 181951)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.omitted.html        2015-03-25 11:40:32 UTC (rev 181952)
</span><span class="lines">@@ -1,23 +0,0 @@
</span><del>-<!DOCTYPE html>
-<title>Canvas test: 2d.pattern.image.incomplete.omitted</title>
-<script src="../tests.js"></script>
-<link rel="stylesheet" href="../tests.css">
-<body>
-<p id="passtext">Pass</p>
-<p id="failtext">Fail</p>
-<p class="output">These images should be identical:</p>
-<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
-
-<ul id="d"></ul>
-<script>
-_addTest(function(canvas, ctx) {
-
-var img = document.getElementById('green.png');
-img.removeAttribute('src');
-_assertSame(ctx.createPattern(img, 'repeat'), null, "ctx.createPattern(img, 'repeat')", "null");
-
-
-});
-</script>
-<img src="../images/green.png" id="green.png" class="resource">
-
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2dpatternimageincompleteremovedsrcexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.removedsrc-expected.txt (0 => 181952)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.removedsrc-expected.txt         (rev 0)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.removedsrc-expected.txt        2015-03-25 11:40:32 UTC (rev 181952)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+2d.pattern.image.incomplete.removedsrc
+
+Actual output:
+
+
+
+PASS Canvas test: 2d.pattern.image.incomplete.removedsrc
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestscanvasphiliptests2dpatternimageincompleteremovedsrchtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.removedsrc.html (0 => 181952)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.removedsrc.html         (rev 0)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.removedsrc.html        2015-03-25 11:40:32 UTC (rev 181952)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.pattern.image.incomplete.removedsrc</title>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script src="../../../imported/w3c/web-platform-tests/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.pattern.image.incomplete.removedsrc</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+var img = document.getElementById('red.png');
+img.removeAttribute('src');
+_assertSame(ctx.createPattern(img, 'repeat'), null, "ctx.createPattern(img, 'repeat')", "null");
+
+
+});
+</script>
+<img src="/images/red.png" id="red.png" class="resource">
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestsfastcanvascanvasemptyimagepatternexpectedpng"></a>
<div class="binary"><h4>Deleted: releases/WebKitGTK/webkit-2.8/LayoutTests/fast/canvas/canvas-empty-image-pattern-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestsfastcanvascanvasemptyimagepatternexpectedtxt"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/LayoutTests/fast/canvas/canvas-empty-image-pattern-expected.txt (181951 => 181952)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/fast/canvas/canvas-empty-image-pattern-expected.txt        2015-03-25 11:32:41 UTC (rev 181951)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/fast/canvas/canvas-empty-image-pattern-expected.txt        2015-03-25 11:40:32 UTC (rev 181952)
</span><span class="lines">@@ -1,2 +1,2 @@
</span><del>-CONSOLE MESSAGE: line 9: InvalidStateError: DOM Exception 11: An attempt was made to use an object that is not, or is no longer, usable.
</del><ins>+TEST PASSED
</ins><span class="cx">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestsfastcanvascanvasemptyimagepatternhtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/LayoutTests/fast/canvas/canvas-empty-image-pattern.html (181951 => 181952)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/fast/canvas/canvas-empty-image-pattern.html        2015-03-25 11:32:41 UTC (rev 181951)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/fast/canvas/canvas-empty-image-pattern.html        2015-03-25 11:40:32 UTC (rev 181952)
</span><span class="lines">@@ -1,11 +1,15 @@
</span><span class="cx"> <!DOCTYPE HTML>
</span><span class="cx"> <title>Canvas test: filling a pattern with an empty image should not crash.</title>
</span><ins>+<div id="console"></div>
</ins><span class="cx"> <canvas id="canvas" class="output" width="100" height="100"><p class="fallback">FAIL (fallback content)</p></canvas>
</span><span class="cx"> <script>
</span><span class="cx"> if (window.testRunner)
</span><span class="cx"> testRunner.dumpAsText(true);
</span><span class="cx">
</span><span class="cx"> var canvas = document.getElementById("canvas").getContext("2d");
</span><del>-canvas.fillStyle = canvas.createPattern(new Image, "repeat")
-canvas.fillRect(0,0,1,1)
</del><ins>+var pattern = canvas.createPattern(new Image, "repeat")
+if (pattern)
+ document.getElementById("console").innerHTML = "TEST FAILED";
+else
+ document.getElementById("console").innerHTML = "TEST PASSED";
</ins><span class="cx"> </script>
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog (181951 => 181952)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog        2015-03-25 11:32:41 UTC (rev 181951)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog        2015-03-25 11:40:32 UTC (rev 181952)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2015-03-23 Yoav Weiss <yoav@yoav.ws>
+
+ Update empty image canvas tests and fix a related bug
+ https://bugs.webkit.org/show_bug.cgi?id=142694
+
+ Reviewed by Chris Dumez.
+
+ During the work on https://bugs.webkit.org/show_bug.cgi?id=142677
+ we encountered an issue with canvas tests related to empty image handling
+ when drawn or used as a pattern. After updating these tests, an issue with
+ pattern handling was encountered.
+
+ The spec, as well as Chrome's implementation, say that when an empty image
+ is used as a pattern, createPattern should return null. See
+ https://html.spec.whatwg.org/multipage/scripting.html#fill-and-stroke-styles:check-the-usability-of-the-image-argument
+ Instead, createPattern returned an exception in this case.
+ This patch fixes that and makes sure that it returns a null when image loading hasn't started.
+
+ Tests: canvas/philip/tests/2d.drawImage.incomplete.emptysrc.html
+ canvas/philip/tests/2d.drawImage.incomplete.nosrc.html
+ canvas/philip/tests/2d.drawImage.incomplete.removedsrc.html
+ canvas/philip/tests/2d.pattern.image.incomplete.emptysrc.html
+ canvas/philip/tests/2d.pattern.image.incomplete.removedsrc.html
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::createPattern): Return "null" if image is not fully decodeable.
+
</ins><span class="cx"> 2015-03-20 Yusuke Suzuki <utatane.tea@gmail.com>
</span><span class="cx">
</span><span class="cx"> REGRESSION (r179429): Potential Use after free in JavaScriptCore`WTF::StringImpl::ref + 83
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebCorehtmlcanvasCanvasRenderingContext2Dcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (181951 => 181952)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp        2015-03-25 11:32:41 UTC (rev 181951)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp        2015-03-25 11:40:32 UTC (rev 181952)
</span><span class="lines">@@ -1751,11 +1751,12 @@
</span><span class="cx"> if (ec)
</span><span class="cx"> return 0;
</span><span class="cx">
</span><del>- if (!image->complete())
- return 0;
</del><ins>+ CachedImage* cachedImage = image->cachedImage();
+ // If the image loading hasn't started or the image is not complete, it is not fully decodable.
+ if (!cachedImage || !image->complete())
+ return nullptr;
</ins><span class="cx">
</span><del>- CachedImage* cachedImage = image->cachedImage();
- if (!cachedImage || cachedImage->status() == CachedResource::LoadError) {
</del><ins>+ if (cachedImage->status() == CachedResource::LoadError) {
</ins><span class="cx"> ec = INVALID_STATE_ERR;
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>