<!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>[201664] 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/201664">201664</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-06-03 15:26:50 -0700 (Fri, 03 Jun 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>CanvasRenderingContext2D.createPattern() / putImageData() throw wrong exception type
https://bugs.webkit.org/show_bug.cgi?id=158322

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline test now that it is passing.

* canvas/2d.pattern.image.undefined-expected.txt:

Source/WebCore:

CanvasRenderingContext2D.createPattern() / putImageData() were throwing the wrong
exception type when the first parameter was null. It should throw a TypeError
but it was throwing a legacy TYPE_MISMATCH_ERR:
- http://www.w3.org/TR/2dcontext/#canvasrenderingcontext2d
- http://www.w3.org/TR/2dcontext/#canvasimagesource

This patch aligns our behavior with the specification.

No new tests, covered by existing tests.

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::createPattern):
(WebCore::CanvasRenderingContext2D::putImageData):
(WebCore::CanvasRenderingContext2D::webkitPutImageDataHD):
(WebCore::CanvasRenderingContext2D::didDraw): Deleted.
(WebCore::CanvasRenderingContext2D::drawFocusIfNeeded): Deleted.
(WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal): Deleted.
(WebCore::CanvasRenderingContext2D::font): Deleted.
* html/canvas/CanvasRenderingContext2D.h:
* html/canvas/CanvasRenderingContext2D.idl:

LayoutTests:

Update several outdated layout tests.

* canvas/philip/tests/2d.imageData.put.null.html:
* canvas/philip/tests/2d.pattern.image.null.html:
* canvas/philip/tests/2d.pattern.image.undefined.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestscanvasphiliptests2dimageDataputnullhtml">trunk/LayoutTests/canvas/philip/tests/2d.imageData.put.null.html</a></li>
<li><a href="#trunkLayoutTestscanvasphiliptests2dpatternimagenullhtml">trunk/LayoutTests/canvas/philip/tests/2d.pattern.image.null.html</a></li>
<li><a href="#trunkLayoutTestscanvasphiliptests2dpatternimageundefinedhtml">trunk/LayoutTests/canvas/philip/tests/2d.pattern.image.undefined.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3ccanvas2dpatternimageundefinedexpectedtxt">trunk/LayoutTests/imported/w3c/canvas/2d.pattern.image.undefined-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dcpp">trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dh">trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Didl">trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (201663 => 201664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-06-03 22:24:06 UTC (rev 201663)
+++ trunk/LayoutTests/ChangeLog        2016-06-03 22:26:50 UTC (rev 201664)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2016-06-03  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        CanvasRenderingContext2D.createPattern() / putImageData() throw wrong exception type
+        https://bugs.webkit.org/show_bug.cgi?id=158322
+
+        Reviewed by Ryosuke Niwa.
+
+        Update several outdated layout tests.
+
+        * canvas/philip/tests/2d.imageData.put.null.html:
+        * canvas/philip/tests/2d.pattern.image.null.html:
+        * canvas/philip/tests/2d.pattern.image.undefined.html:
+
</ins><span class="cx"> 2016-06-03  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Marking fast/scrolling/scroll-container-horizontally.html as flaky on mac-wk2 and ios-simulator-wk1
</span></span></pre></div>
<a id="trunkLayoutTestscanvasphiliptests2dimageDataputnullhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/canvas/philip/tests/2d.imageData.put.null.html (201663 => 201664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/canvas/philip/tests/2d.imageData.put.null.html        2016-06-03 22:24:06 UTC (rev 201663)
+++ trunk/LayoutTests/canvas/philip/tests/2d.imageData.put.null.html        2016-06-03 22:26:50 UTC (rev 201664)
</span><span class="lines">@@ -14,7 +14,7 @@
</span><span class="cx"> 
</span><span class="cx"> try { var _thrown = false;
</span><span class="cx">   ctx.putImageData(null, 0, 0);
</span><del>-} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail(&quot;Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: &quot;+e.message); _thrown = true; } finally { _assert(_thrown, &quot;should throw exception of type TYPE_MISMATCH_ERR: ctx.putImageData(null, 0, 0)&quot;); }
</del><ins>+} catch (e) { if (e.name != &quot;TypeError&quot;) _fail(&quot;Failed assertion: expected exception of type TypeError, got: &quot;+e.message); _thrown = true; } finally { _assert(_thrown, &quot;should throw exception of type TypeError: ctx.putImageData(null, 0, 0)&quot;); }
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> });
</span></span></pre></div>
<a id="trunkLayoutTestscanvasphiliptests2dpatternimagenullhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/canvas/philip/tests/2d.pattern.image.null.html (201663 => 201664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/canvas/philip/tests/2d.pattern.image.null.html        2016-06-03 22:24:06 UTC (rev 201663)
+++ trunk/LayoutTests/canvas/philip/tests/2d.pattern.image.null.html        2016-06-03 22:26:50 UTC (rev 201664)
</span><span class="lines">@@ -14,7 +14,7 @@
</span><span class="cx"> 
</span><span class="cx"> try { var _thrown = false;
</span><span class="cx">   ctx.createPattern(null, 'repeat');
</span><del>-} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail(&quot;Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: &quot;+e.message); _thrown = true; } finally { _assert(_thrown, &quot;should throw exception of type TYPE_MISMATCH_ERR: ctx.createPattern(null, 'repeat')&quot;); }
</del><ins>+} catch (e) { if (e.name != &quot;TypeError&quot;) _fail(&quot;Failed assertion: expected exception of type TypeError, got: &quot;+e.message); _thrown = true; } finally { _assert(_thrown, &quot;should throw exception of type TypeError: ctx.createPattern(null, 'repeat')&quot;); }
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> });
</span></span></pre></div>
<a id="trunkLayoutTestscanvasphiliptests2dpatternimageundefinedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/canvas/philip/tests/2d.pattern.image.undefined.html (201663 => 201664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/canvas/philip/tests/2d.pattern.image.undefined.html        2016-06-03 22:24:06 UTC (rev 201663)
+++ trunk/LayoutTests/canvas/philip/tests/2d.pattern.image.undefined.html        2016-06-03 22:26:50 UTC (rev 201664)
</span><span class="lines">@@ -14,7 +14,7 @@
</span><span class="cx"> 
</span><span class="cx"> try { var _thrown = false;
</span><span class="cx">   ctx.createPattern(undefined, 'repeat');
</span><del>-} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail(&quot;Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: &quot;+e.message); _thrown = true; } finally { _assert(_thrown, &quot;should throw exception of type TYPE_MISMATCH_ERR: ctx.createPattern(undefined, 'repeat')&quot;); }
</del><ins>+} catch (e) { if (e.name != &quot;TypeError&quot;) _fail(&quot;Failed assertion: expected exception of type TypeError, got: &quot;+e.message); _thrown = true; } finally { _assert(_thrown, &quot;should throw exception of type TypeError: ctx.createPattern(undefined, 'repeat')&quot;); }
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> });
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (201663 => 201664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-06-03 22:24:06 UTC (rev 201663)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-06-03 22:26:50 UTC (rev 201664)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-06-03  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        CanvasRenderingContext2D.createPattern() / putImageData() throw wrong exception type
+        https://bugs.webkit.org/show_bug.cgi?id=158322
+
+        Reviewed by Ryosuke Niwa.
+
+        Rebaseline test now that it is passing.
+
+        * canvas/2d.pattern.image.undefined-expected.txt:
+
</ins><span class="cx"> 2016-06-02  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [WebIDL] 'undefined' should be an acceptable value for nullable parameters
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3ccanvas2dpatternimageundefinedexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/canvas/2d.pattern.image.undefined-expected.txt (201663 => 201664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/canvas/2d.pattern.image.undefined-expected.txt        2016-06-03 22:24:06 UTC (rev 201663)
+++ trunk/LayoutTests/imported/w3c/canvas/2d.pattern.image.undefined-expected.txt        2016-06-03 22:26:50 UTC (rev 201664)
</span><span class="lines">@@ -2,4 +2,4 @@
</span><span class="cx"> Spec references: 2d.pattern.IDL
</span><span class="cx"> Defined in &quot;Web IDL&quot; (draft)
</span><span class="cx"> Actual output:
</span><del>-Failed assertion: expected exception of type TypeError, got: Error: TypeMismatchError: DOM Exception 17
</del><ins>+Passed
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (201663 => 201664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-06-03 22:24:06 UTC (rev 201663)
+++ trunk/Source/WebCore/ChangeLog        2016-06-03 22:26:50 UTC (rev 201664)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2016-06-03  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        CanvasRenderingContext2D.createPattern() / putImageData() throw wrong exception type
+        https://bugs.webkit.org/show_bug.cgi?id=158322
+
+        Reviewed by Ryosuke Niwa.
+
+        CanvasRenderingContext2D.createPattern() / putImageData() were throwing the wrong
+        exception type when the first parameter was null. It should throw a TypeError
+        but it was throwing a legacy TYPE_MISMATCH_ERR:
+        - http://www.w3.org/TR/2dcontext/#canvasrenderingcontext2d
+        - http://www.w3.org/TR/2dcontext/#canvasimagesource
+
+        This patch aligns our behavior with the specification.
+
+        No new tests, covered by existing tests.
+
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::createPattern):
+        (WebCore::CanvasRenderingContext2D::putImageData):
+        (WebCore::CanvasRenderingContext2D::webkitPutImageDataHD):
+        (WebCore::CanvasRenderingContext2D::didDraw): Deleted.
+        (WebCore::CanvasRenderingContext2D::drawFocusIfNeeded): Deleted.
+        (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal): Deleted.
+        (WebCore::CanvasRenderingContext2D::font): Deleted.
+        * html/canvas/CanvasRenderingContext2D.h:
+        * html/canvas/CanvasRenderingContext2D.idl:
+
</ins><span class="cx"> 2016-06-03  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Rename NoncopyableFunction to Function
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (201663 => 201664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp        2016-06-03 22:24:06 UTC (rev 201663)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp        2016-06-03 22:26:50 UTC (rev 201664)
</span><span class="lines">@@ -1744,22 +1744,18 @@
</span><span class="cx">     return WTFMove(gradient);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;CanvasPattern&gt; CanvasRenderingContext2D::createPattern(HTMLImageElement* imageElement,
</del><ins>+RefPtr&lt;CanvasPattern&gt; CanvasRenderingContext2D::createPattern(HTMLImageElement&amp; imageElement,
</ins><span class="cx">     const String&amp; repetitionType, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><del>-    if (!imageElement) {
-        ec = TYPE_MISMATCH_ERR;
-        return nullptr;
-    }
</del><span class="cx">     bool repeatX, repeatY;
</span><span class="cx">     ec = 0;
</span><span class="cx">     CanvasPattern::parseRepetitionType(repetitionType, repeatX, repeatY, ec);
</span><span class="cx">     if (ec)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    CachedImage* cachedImage = imageElement-&gt;cachedImage();
</del><ins>+    CachedImage* cachedImage = imageElement.cachedImage();
</ins><span class="cx">     // If the image loading hasn't started or the image is not complete, it is not fully decodable.
</span><del>-    if (!cachedImage || !imageElement-&gt;complete())
</del><ins>+    if (!cachedImage || !imageElement.complete())
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     if (cachedImage-&gt;status() == CachedResource::LoadError) {
</span><span class="lines">@@ -1767,7 +1763,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!imageElement-&gt;cachedImage()-&gt;imageForRenderer(imageElement-&gt;renderer()))
</del><ins>+    if (!imageElement.cachedImage()-&gt;imageForRenderer(imageElement.renderer()))
</ins><span class="cx">         return CanvasPattern::create(Image::nullImage(), repeatX, repeatY, true);
</span><span class="cx"> 
</span><span class="cx">     bool originClean = cachedImage-&gt;isOriginClean(canvas()-&gt;securityOrigin());
</span><span class="lines">@@ -1781,17 +1777,13 @@
</span><span class="cx">     if (cachedImage-&gt;image()-&gt;isSVGImage())
</span><span class="cx">         originClean = false;
</span><span class="cx"> 
</span><del>-    return CanvasPattern::create(cachedImage-&gt;imageForRenderer(imageElement-&gt;renderer()), repeatX, repeatY, originClean);
</del><ins>+    return CanvasPattern::create(cachedImage-&gt;imageForRenderer(imageElement.renderer()), repeatX, repeatY, originClean);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;CanvasPattern&gt; CanvasRenderingContext2D::createPattern(HTMLCanvasElement* canvas,
</del><ins>+RefPtr&lt;CanvasPattern&gt; CanvasRenderingContext2D::createPattern(HTMLCanvasElement&amp; canvas,
</ins><span class="cx">     const String&amp; repetitionType, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><del>-    if (!canvas) {
-        ec = TYPE_MISMATCH_ERR;
-        return nullptr;
-    }
-    if (!canvas-&gt;width() || !canvas-&gt;height() || !canvas-&gt;buffer()) {
</del><ins>+    if (!canvas.width() || !canvas.height() || !canvas.buffer()) {
</ins><span class="cx">         ec = INVALID_STATE_ERR;
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="lines">@@ -1801,7 +1793,7 @@
</span><span class="cx">     CanvasPattern::parseRepetitionType(repetitionType, repeatX, repeatY, ec);
</span><span class="cx">     if (ec)
</span><span class="cx">         return nullptr;
</span><del>-    return CanvasPattern::create(canvas-&gt;copiedImage(), repeatX, repeatY, canvas-&gt;originClean());
</del><ins>+    return CanvasPattern::create(canvas.copiedImage(), repeatX, repeatY, canvas.originClean());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CanvasRenderingContext2D::didDrawEntireCanvas()
</span><span class="lines">@@ -2016,31 +2008,23 @@
</span><span class="cx">     return ImageData::create(imageDataRect.size(), byteArray.releaseNonNull());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy, ExceptionCode&amp; ec)
</del><ins>+void CanvasRenderingContext2D::putImageData(ImageData&amp; data, float dx, float dy, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    if (!data) {
-        ec = TYPE_MISMATCH_ERR;
-        return;
-    }
-    putImageData(data, dx, dy, 0, 0, data-&gt;width(), data-&gt;height(), ec);
</del><ins>+    putImageData(data, dx, dy, 0, 0, data.width(), data.height(), ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::webkitPutImageDataHD(ImageData* data, float dx, float dy, ExceptionCode&amp; ec)
</del><ins>+void CanvasRenderingContext2D::webkitPutImageDataHD(ImageData&amp; data, float dx, float dy, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    if (!data) {
-        ec = TYPE_MISMATCH_ERR;
-        return;
-    }
-    webkitPutImageDataHD(data, dx, dy, 0, 0, data-&gt;width(), data-&gt;height(), ec);
</del><ins>+    webkitPutImageDataHD(data, dx, dy, 0, 0, data.width(), data.height(), ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy, float dirtyX, float dirtyY,
</del><ins>+void CanvasRenderingContext2D::putImageData(ImageData&amp; data, float dx, float dy, float dirtyX, float dirtyY,
</ins><span class="cx">                                             float dirtyWidth, float dirtyHeight, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     putImageData(data, ImageBuffer::LogicalCoordinateSystem, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight, ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::webkitPutImageDataHD(ImageData* data, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionCode&amp; ec)
</del><ins>+void CanvasRenderingContext2D::webkitPutImageDataHD(ImageData&amp; data, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     putImageData(data, ImageBuffer::BackingStoreCoordinateSystem, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight, ec);
</span><span class="cx"> }
</span><span class="lines">@@ -2066,13 +2050,9 @@
</span><span class="cx">     context-&gt;drawFocusRing(path, 1, 1, RenderTheme::focusRingColor());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::putImageData(ImageData* data, ImageBuffer::CoordinateSystem coordinateSystem, float dx, float dy, float dirtyX, float dirtyY,
</del><ins>+void CanvasRenderingContext2D::putImageData(ImageData&amp; data, ImageBuffer::CoordinateSystem coordinateSystem, float dx, float dy, float dirtyX, float dirtyY,
</ins><span class="cx">                                             float dirtyWidth, float dirtyHeight, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><del>-    if (!data) {
-        ec = TYPE_MISMATCH_ERR;
-        return;
-    }
</del><span class="cx">     if (!std::isfinite(dx) || !std::isfinite(dy) || !std::isfinite(dirtyX) || !std::isfinite(dirtyY) || !std::isfinite(dirtyWidth) || !std::isfinite(dirtyHeight)) {
</span><span class="cx">         ec = NOT_SUPPORTED_ERR;
</span><span class="cx">         return;
</span><span class="lines">@@ -2093,7 +2073,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     FloatRect clipRect(dirtyX, dirtyY, dirtyWidth, dirtyHeight);
</span><del>-    clipRect.intersect(IntRect(0, 0, data-&gt;width(), data-&gt;height()));
</del><ins>+    clipRect.intersect(IntRect(0, 0, data.width(), data.height()));
</ins><span class="cx">     IntSize destOffset(static_cast&lt;int&gt;(dx), static_cast&lt;int&gt;(dy));
</span><span class="cx">     IntRect destRect = enclosingIntRect(clipRect);
</span><span class="cx">     destRect.move(destOffset);
</span><span class="lines">@@ -2103,7 +2083,7 @@
</span><span class="cx">     IntRect sourceRect(destRect);
</span><span class="cx">     sourceRect.move(-destOffset);
</span><span class="cx"> 
</span><del>-    buffer-&gt;putByteArray(Unmultiplied, data-&gt;data(), IntSize(data-&gt;width(), data-&gt;height()), sourceRect, IntPoint(destOffset), coordinateSystem);
</del><ins>+    buffer-&gt;putByteArray(Unmultiplied, data.data(), IntSize(data.width(), data.height()), sourceRect, IntPoint(destOffset), coordinateSystem);
</ins><span class="cx"> 
</span><span class="cx">     didDraw(destRect, CanvasDidDrawApplyNone); // ignore transform, shadow and clip
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h (201663 => 201664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h        2016-06-03 22:24:06 UTC (rev 201663)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h        2016-06-03 22:26:50 UTC (rev 201664)
</span><span class="lines">@@ -180,17 +180,17 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CanvasGradient&gt; createLinearGradient(float x0, float y0, float x1, float y1, ExceptionCode&amp;);
</span><span class="cx">     RefPtr&lt;CanvasGradient&gt; createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1, ExceptionCode&amp;);
</span><del>-    RefPtr&lt;CanvasPattern&gt; createPattern(HTMLImageElement*, const String&amp; repetitionType, ExceptionCode&amp;);
-    RefPtr&lt;CanvasPattern&gt; createPattern(HTMLCanvasElement*, const String&amp; repetitionType, ExceptionCode&amp;);
</del><ins>+    RefPtr&lt;CanvasPattern&gt; createPattern(HTMLImageElement&amp;, const String&amp; repetitionType, ExceptionCode&amp;);
+    RefPtr&lt;CanvasPattern&gt; createPattern(HTMLCanvasElement&amp;, const String&amp; repetitionType, ExceptionCode&amp;);
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;ImageData&gt; createImageData(RefPtr&lt;ImageData&gt;&amp;&amp;, ExceptionCode&amp;) const;
</span><span class="cx">     RefPtr&lt;ImageData&gt; createImageData(float width, float height, ExceptionCode&amp;) const;
</span><span class="cx">     RefPtr&lt;ImageData&gt; getImageData(float sx, float sy, float sw, float sh, ExceptionCode&amp;) const;
</span><span class="cx">     RefPtr&lt;ImageData&gt; webkitGetImageDataHD(float sx, float sy, float sw, float sh, ExceptionCode&amp;) const;
</span><del>-    void putImageData(ImageData*, float dx, float dy, ExceptionCode&amp;);
-    void putImageData(ImageData*, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionCode&amp;);
-    void webkitPutImageDataHD(ImageData*, float dx, float dy, ExceptionCode&amp;);
-    void webkitPutImageDataHD(ImageData*, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionCode&amp;);
</del><ins>+    void putImageData(ImageData&amp;, float dx, float dy, ExceptionCode&amp;);
+    void putImageData(ImageData&amp;, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionCode&amp;);
+    void webkitPutImageDataHD(ImageData&amp;, float dx, float dy, ExceptionCode&amp;);
+    void webkitPutImageDataHD(ImageData&amp;, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionCode&amp;);
</ins><span class="cx"> 
</span><span class="cx">     void drawFocusIfNeeded(Element*);
</span><span class="cx">     void drawFocusIfNeeded(DOMPath&amp;, Element*);
</span><span class="lines">@@ -370,7 +370,7 @@
</span><span class="cx">     void prepareGradientForDashboard(CanvasGradient&amp; gradient) const;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;ImageData&gt; getImageData(ImageBuffer::CoordinateSystem, float sx, float sy, float sw, float sh, ExceptionCode&amp;) const;
</span><del>-    void putImageData(ImageData*, ImageBuffer::CoordinateSystem, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionCode&amp;);
</del><ins>+    void putImageData(ImageData&amp;, ImageBuffer::CoordinateSystem, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionCode&amp;);
</ins><span class="cx"> 
</span><span class="cx">     bool is2d() const override { return true; }
</span><span class="cx">     bool isAccelerated() const override;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Didl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl (201663 => 201664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl        2016-06-03 22:24:06 UTC (rev 201663)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl        2016-06-03 22:26:50 UTC (rev 201664)
</span><span class="lines">@@ -169,14 +169,14 @@
</span><span class="cx">     void setShadow(float width, unrestricted float height, unrestricted float blur, unrestricted float c, unrestricted float m, 
</span><span class="cx">         unrestricted float y, unrestricted float k, unrestricted float a);
</span><span class="cx"> 
</span><del>-    [RaisesException] void putImageData(ImageData? imagedata, float dx, float dy);
-    [RaisesException] void putImageData(ImageData? imagedata, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight);
</del><ins>+    [RaisesException] void putImageData(ImageData imagedata, float dx, float dy);
+    [RaisesException] void putImageData(ImageData imagedata, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight);
</ins><span class="cx"> 
</span><del>-    [RaisesException] void webkitPutImageDataHD(ImageData? imagedata, float dx, float dy);
-    [RaisesException] void webkitPutImageDataHD(ImageData? imagedata, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight);
</del><ins>+    [RaisesException] void webkitPutImageDataHD(ImageData imagedata, float dx, float dy);
+    [RaisesException] void webkitPutImageDataHD(ImageData imagedata, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight);
</ins><span class="cx"> 
</span><del>-    [RaisesException] CanvasPattern createPattern(HTMLCanvasElement? canvas, [TreatNullAs=EmptyString] DOMString repetitionType);
-    [RaisesException] CanvasPattern createPattern(HTMLImageElement? image, [TreatNullAs=EmptyString] DOMString repetitionType);
</del><ins>+    [RaisesException] CanvasPattern createPattern(HTMLCanvasElement canvas, [TreatNullAs=EmptyString] DOMString repetitionType);
+    [RaisesException] CanvasPattern createPattern(HTMLImageElement image, [TreatNullAs=EmptyString] DOMString repetitionType);
</ins><span class="cx">     [RaisesException] ImageData createImageData(ImageData? imagedata);
</span><span class="cx">     [RaisesException] ImageData createImageData(float sw, float sh);
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>