<!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>[207206] branches/safari-602-branch</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/207206">207206</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2016-10-12 01:41:35 -0700 (Wed, 12 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/205197">r205197</a>. rdar://problem/28481424</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari602branchSourceWebCoreChangeLog">branches/safari-602-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari602branchSourceWebCoreplatformgraphicstransformsTransformationMatrixcpp">branches/safari-602-branch/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp</a></li>
<li><a href="#branchessafari602branchSourceWebCoreplatformgraphicstransformsTransformationMatrixh">branches/safari-602-branch/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h</a></li>
<li><a href="#branchessafari602branchToolsChangeLog">branches/safari-602-branch/Tools/ChangeLog</a></li>
<li><a href="#branchessafari602branchToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">branches/safari-602-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari602branchToolsTestWebKitAPITestsWebCoreTransformationMatrixcpp">branches/safari-602-branch/Tools/TestWebKitAPI/Tests/WebCore/TransformationMatrix.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari602branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Source/WebCore/ChangeLog (207205 => 207206)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Source/WebCore/ChangeLog        2016-10-12 08:41:31 UTC (rev 207205)
+++ branches/safari-602-branch/Source/WebCore/ChangeLog        2016-10-12 08:41:35 UTC (rev 207206)
</span><span class="lines">@@ -1,5 +1,32 @@
</span><span class="cx"> 2016-10-12  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r205197. rdar://problem/28481424
+
+    2016-08-30  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+            Use of uninitialised memory in TransformationMatrx::blend4()
+            https://bugs.webkit.org/show_bug.cgi?id=134621
+            &lt;rdar://problem/27337539&gt;
+
+            Reviewed by Dean Jackson.
+
+            Change is based on the Blink change (patch by &lt;alancutter@chromium.org&gt;):
+            &lt;https://src.chromium.org/viewvc/blink?revision=177453&amp;view=revision&gt;
+
+            TransformationMatrix::blend() was attempting to blend between non-invertable
+            matricies. This resulted in garbage stack variables being used.
+            This patch ensures that blend() will fall back to a 50% step interpolation
+            when one of the sides are not invertable.
+
+            Tested by new TransformationMatrix test in TestWebKitAPI.
+
+            * platform/graphics/transforms/TransformationMatrix.cpp:
+            (WebCore::TransformationMatrix::blend2): Properly handle failure in the
+            decompose method calls.
+            (WebCore::TransformationMatrix::blend4): Ditto.
+
+2016-10-12  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r205190. rdar://problem/28545010
</span><span class="cx"> 
</span><span class="cx">     2016-08-30  Youenn Fablet  &lt;youenn@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari602branchSourceWebCoreplatformgraphicstransformsTransformationMatrixcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp (207205 => 207206)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp        2016-10-12 08:41:31 UTC (rev 207205)
+++ branches/safari-602-branch/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp        2016-10-12 08:41:35 UTC (rev 207206)
</span><span class="lines">@@ -1501,8 +1501,11 @@
</span><span class="cx"> {
</span><span class="cx">     Decomposed2Type fromDecomp;
</span><span class="cx">     Decomposed2Type toDecomp;
</span><del>-    from.decompose2(fromDecomp);
-    decompose2(toDecomp);
</del><ins>+    if (!from.decompose2(fromDecomp) || !decompose2(toDecomp)) {
+        if (progress &lt; 0.5)
+            *this = from;
+        return;
+    }
</ins><span class="cx"> 
</span><span class="cx">     // If x-axis of one is flipped, and y-axis of the other, convert to an unflipped rotation.
</span><span class="cx">     if ((fromDecomp.scaleX &lt; 0 &amp;&amp; toDecomp.scaleY &lt; 0) || (fromDecomp.scaleY &lt; 0 &amp;&amp; toDecomp.scaleX &lt; 0)) {
</span><span class="lines">@@ -1541,8 +1544,11 @@
</span><span class="cx"> {
</span><span class="cx">     Decomposed4Type fromDecomp;
</span><span class="cx">     Decomposed4Type toDecomp;
</span><del>-    from.decompose4(fromDecomp);
-    decompose4(toDecomp);
</del><ins>+    if (!from.decompose4(fromDecomp) || !decompose4(toDecomp)) {
+        if (progress &lt; 0.5)
+            *this = from;
+        return;
+    }
</ins><span class="cx"> 
</span><span class="cx">     blendFloat(fromDecomp.scaleX, toDecomp.scaleX, progress);
</span><span class="cx">     blendFloat(fromDecomp.scaleY, toDecomp.scaleY, progress);
</span></span></pre></div>
<a id="branchessafari602branchSourceWebCoreplatformgraphicstransformsTransformationMatrixh"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h (207205 => 207206)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h        2016-10-12 08:41:31 UTC (rev 207205)
+++ branches/safari-602-branch/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h        2016-10-12 08:41:35 UTC (rev 207206)
</span><span class="lines">@@ -294,7 +294,7 @@
</span><span class="cx">     bool decompose4(Decomposed4Type&amp;) const;
</span><span class="cx">     void recompose4(const Decomposed4Type&amp;);
</span><span class="cx"> 
</span><del>-    void blend(const TransformationMatrix&amp; from, double progress);
</del><ins>+    WEBCORE_EXPORT void blend(const TransformationMatrix&amp; from, double progress);
</ins><span class="cx">     void blend2(const TransformationMatrix&amp; from, double progress);
</span><span class="cx">     void blend4(const TransformationMatrix&amp; from, double progress);
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari602branchToolsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Tools/ChangeLog (207205 => 207206)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Tools/ChangeLog        2016-10-12 08:41:31 UTC (rev 207205)
+++ branches/safari-602-branch/Tools/ChangeLog        2016-10-12 08:41:35 UTC (rev 207206)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2016-10-12  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
+        Merge r205197. rdar://problem/28481424
+
+    2016-08-30  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+            Use of uninitialised memory in TransformationMatrx::blend4()
+            https://bugs.webkit.org/show_bug.cgi?id=134621
+            &lt;rdar://problem/27337539&gt;
+
+            Reviewed by Dean Jackson.
+
+            Change is based on the Blink change (patch by &lt;alancutter@chromium.org&gt;):
+            &lt;https://src.chromium.org/viewvc/blink?revision=177453&amp;view=revision&gt;
+
+            * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+            * TestWebKitAPI/Tests/WebCore/TransformationMatrix.cpp: Added.
+            (TestWebKitAPI::TEST):
+
</ins><span class="cx"> 2016-09-28  Babak Shafiei  &lt;bshafiei@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r206527. rdar://problem/28499358
</span></span></pre></div>
<a id="branchessafari602branchToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (207205 => 207206)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2016-10-12 08:41:31 UTC (rev 207205)
+++ branches/safari-602-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2016-10-12 08:41:35 UTC (rev 207206)
</span><span class="lines">@@ -147,6 +147,7 @@
</span><span class="cx">                 76E182DD1547569100F1FADD /* WillSendSubmitEvent_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76E182DC1547569100F1FADD /* WillSendSubmitEvent_Bundle.cpp */; };
</span><span class="cx">                 76E182DF154767E600F1FADD /* auto-submitting-form.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 76E182DE15475A8300F1FADD /* auto-submitting-form.html */; };
</span><span class="cx">                 7A1458FC1AD5C07000E06772 /* mouse-button-listener.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 7A1458FB1AD5C03500E06772 /* mouse-button-listener.html */; };
</span><ins>+                7AD3FE8E1D76131200B169A4 /* TransformationMatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AD3FE8D1D75FB8D00B169A4 /* TransformationMatrix.cpp */; };
</ins><span class="cx">                 7AE9E5091AE5AE8B00CF874B /* test.pdf in Copy Resources */ = {isa = PBXBuildFile; fileRef = 7AE9E5081AE5AE8B00CF874B /* test.pdf */; };
</span><span class="cx">                 7C3965061CDD74F90094DBB8 /* Color.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C3965051CDD74F90094DBB8 /* Color.cpp */; };
</span><span class="cx">                 7C3DB8E41D12129B00AE8CC3 /* CommandBackForward.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7C3DB8E21D12129B00AE8CC3 /* CommandBackForward.mm */; };
</span><span class="lines">@@ -902,6 +903,7 @@
</span><span class="cx">                 7A99D9931AD4A29D00373141 /* MenuTypesForMouseEvents.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MenuTypesForMouseEvents.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7AA021BA1AB09EA70052953F /* DateMath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DateMath.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7AA6A1511AAC0B31002B2ED3 /* WorkQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkQueue.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                7AD3FE8D1D75FB8D00B169A4 /* TransformationMatrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TransformationMatrix.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 7AE9E5081AE5AE8B00CF874B /* test.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = test.pdf; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C3965051CDD74F90094DBB8 /* Color.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Color.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C3DB8E21D12129B00AE8CC3 /* CommandBackForward.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CommandBackForward.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -1375,6 +1377,7 @@
</span><span class="cx">                                 CD225C071C45A69200140761 /* ParsedContentRange.cpp */,
</span><span class="cx">                                 41973B5C1AF22875006C7B36 /* SharedBuffer.cpp */,
</span><span class="cx">                                 CDC2C7141797089D00E627FB /* TimeRanges.cpp */,
</span><ins>+                                7AD3FE8D1D75FB8D00B169A4 /* TransformationMatrix.cpp */,
</ins><span class="cx">                                 440A1D3814A0103A008A66F2 /* URL.cpp */,
</span><span class="cx">                                 7C3965051CDD74F90094DBB8 /* Color.cpp */,
</span><span class="cx">                         );
</span><span class="lines">@@ -2430,6 +2433,7 @@
</span><span class="cx">                         buildActionMask = 2147483647;
</span><span class="cx">                         files = (
</span><span class="cx">                                 2E7765CD16C4D80A00BA2BB1 /* mainIOS.mm in Sources */,
</span><ins>+                                7AD3FE8E1D76131200B169A4 /* TransformationMatrix.cpp in Sources */,
</ins><span class="cx">                                 2E7765CF16C4D81100BA2BB1 /* mainMac.mm in Sources */,
</span><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span></span></pre></div>
<a id="branchessafari602branchToolsTestWebKitAPITestsWebCoreTransformationMatrixcpp"></a>
<div class="addfile"><h4>Added: branches/safari-602-branch/Tools/TestWebKitAPI/Tests/WebCore/TransformationMatrix.cpp (0 => 207206)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Tools/TestWebKitAPI/Tests/WebCore/TransformationMatrix.cpp                                (rev 0)
+++ branches/safari-602-branch/Tools/TestWebKitAPI/Tests/WebCore/TransformationMatrix.cpp        2016-10-12 08:41:35 UTC (rev 207206)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+/*
+ * Copyright (c) 2013, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &lt;WebCore/TransformationMatrix.h&gt;
+
+using namespace WebCore;
+
+namespace TestWebKitAPI {
+
+TEST(TransformationMatrix, NonInvertableBlend)
+{
+    TransformationMatrix from;
+    TransformationMatrix to(2.7133590938, 0.0, 0.0, 0.0, 0.0, 2.4645137761, 0.0, 0.0, 0.0, 0.0, 0.00, 0.01, 0.02, 0.03, 0.04, 0.05);
+    TransformationMatrix result;
+
+    result = to;
+    result.blend(from, 0.25);
+    EXPECT_TRUE(result == from);
+
+    result = to;
+    result.blend(from, 0.75);
+    EXPECT_TRUE(result == to);
+}
+
+}
</ins></span></pre>
</div>
</div>

</body>
</html>