<!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>[217763] 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/217763">217763</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2017-06-03 14:09:00 -0700 (Sat, 03 Jun 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Implement DOMPointReadOnly.matrixTransform()
https://bugs.webkit.org/show_bug.cgi?id=172896

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

New baselines.

* web-platform-tests/css/geometry-1/DOMPoint-002-expected.txt:
* web-platform-tests/css/geometry-1/historical-expected.txt:

Source/WebCore:

DOMPointReadOnly.matrixTransform() creates the matrix or throws, then uses
a new function in TransformationMatrix to map x,y,z,w through the matrix.

Test: http/wpt/geometry/DOMPoint-003.html

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/DOMMatrixReadOnly.h:
(WebCore::DOMMatrixReadOnly::transformationMatrix):
* dom/DOMPointReadOnly.cpp: Copied from Source/WebCore/dom/DOMPointReadOnly.idl.
(WebCore::DOMPointReadOnly::matrixTransform):
* dom/DOMPointReadOnly.h:
* dom/DOMPointReadOnly.idl:
* platform/graphics/transforms/TransformationMatrix.cpp:
(WebCore::TransformationMatrix::map4ComponentPoint):
* platform/graphics/transforms/TransformationMatrix.h:

LayoutTests:

DOMPoint-003.html should be upstreamed at some point.

* http/wpt/geometry/DOMPoint-003-expected.txt: Added.
* http/wpt/geometry/DOMPoint-003.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscssgeometry1DOMPoint002expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/DOMPoint-002-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscssgeometry1historicalexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/historical-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorecssDOMMatrixReadOnlyh">trunk/Source/WebCore/css/DOMMatrixReadOnly.h</a></li>
<li><a href="#trunkSourceWebCoredomDOMPointReadOnlyh">trunk/Source/WebCore/dom/DOMPointReadOnly.h</a></li>
<li><a href="#trunkSourceWebCoredomDOMPointReadOnlyidl">trunk/Source/WebCore/dom/DOMPointReadOnly.idl</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicstransformsTransformationMatrixcpp">trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicstransformsTransformationMatrixh">trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/http/wpt/geometry/</li>
<li><a href="#trunkLayoutTestshttpwptgeometryDOMPoint003expectedtxt">trunk/LayoutTests/http/wpt/geometry/DOMPoint-003-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttpwptgeometryDOMPoint003html">trunk/LayoutTests/http/wpt/geometry/DOMPoint-003.html</a></li>
<li><a href="#trunkSourceWebCoredomDOMPointReadOnlycpp">trunk/Source/WebCore/dom/DOMPointReadOnly.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (217762 => 217763)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2017-06-03 18:07:17 UTC (rev 217762)
+++ trunk/LayoutTests/ChangeLog 2017-06-03 21:09:00 UTC (rev 217763)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2017-06-03  Simon Fraser  <simon.fraser@apple.com>
+
+        Implement DOMPointReadOnly.matrixTransform()
+        https://bugs.webkit.org/show_bug.cgi?id=172896
+
+        Reviewed by Chris Dumez.
+
+        DOMPoint-003.html should be upstreamed at some point.
+
+        * http/wpt/geometry/DOMPoint-003-expected.txt: Added.
+        * http/wpt/geometry/DOMPoint-003.html: Added.
+
</ins><span class="cx"> 2017-06-03  Jonathan Bedard  <jbedard@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Unreviewed test gardening
</span></span></pre></div>
<a id="trunkLayoutTestshttpwptgeometryDOMPoint003expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/wpt/geometry/DOMPoint-003-expected.txt (0 => 217763)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/wpt/geometry/DOMPoint-003-expected.txt                            (rev 0)
+++ trunk/LayoutTests/http/wpt/geometry/DOMPoint-003-expected.txt       2017-06-03 21:09:00 UTC (rev 217763)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+Test DOMPoint and DOMPointReadOnly interfaces
+
+
+PASS test DOMPoint matrixTransform with 3d matrix 
+PASS test DOMPoint matrixTransform with perspective point 
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttpwptgeometryDOMPoint003html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/wpt/geometry/DOMPoint-003.html (0 => 217763)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/wpt/geometry/DOMPoint-003.html                            (rev 0)
+++ trunk/LayoutTests/http/wpt/geometry/DOMPoint-003.html       2017-06-03 21:09:00 UTC (rev 217763)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+<!DOCTYPE html>
+<html><head>
+    <title>Geometry Interfaces: DOMPointReadOnly.matrixTransform</title>
+    <link href="mailto:simon.fraser@apple.com" rel="author" title="Simon Fraser">
+    <link href="https://drafts.fxtf.org/geometry-1/#DOMPoint" rel="help">
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+    <p>Test DOMPoint and DOMPointReadOnly interfaces</p>
+    <div id="log"></div>
+    <script>
+        function getMatrixTransform(matrix, point) {
+            var x = point.x * matrix.m11 + point.y * matrix.m21 + point.z * matrix.m31 + point.w * matrix.m41;
+            var y = point.x * matrix.m12 + point.y * matrix.m22 + point.z * matrix.m32 + point.w * matrix.m42;
+            var z = point.x * matrix.m13 + point.y * matrix.m23 + point.z * matrix.m33 + point.w * matrix.m43;
+            var w = point.x * matrix.m14 + point.y * matrix.m24 + point.z * matrix.m34 + point.w * matrix.m44;
+            return new DOMPoint(x, y, z, w)
+        }
+        test(function() {
+            var point = new DOMPoint(5, 4);
+            var matrix = new DOMMatrix();
+            matrix.setMatrixValue('perspective(400px) translate3d(123px, 456px, 120px)');
+            var result = point.matrixTransform(matrix);
+            var expected = getMatrixTransform(matrix, point);
+            checkDOMPoint(result, expected);
+        },'test DOMPoint matrixTransform with 3d matrix');
+
+        test(function() {
+            var point = DOMPointReadOnly.fromPoint({x:1, y:2, z:3, w:0.00234});
+            var matrix = new DOMMatrix();
+            matrix.setMatrixValue('perspective(400px) translate3d(123px, 456px, 120px)');
+            var result = point.matrixTransform(matrix);
+            var expected = getMatrixTransform(matrix, point);
+            checkDOMPoint(result, expected);
+        },'test DOMPoint matrixTransform with perspective point');
+
+        function checkDOMPoint(p, exp) {
+            assert_equals(p.x, exp.x, "x is not matched");
+            assert_equals(p.y, exp.y, "y is not matched");
+            assert_equals(p.z, exp.z, "z is not matched");
+            assert_equals(p.w, exp.w, "w is not matched");
+        }
+    </script>
+</body></html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (217762 => 217763)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog 2017-06-03 18:07:17 UTC (rev 217762)
+++ trunk/LayoutTests/imported/w3c/ChangeLog    2017-06-03 21:09:00 UTC (rev 217763)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2017-06-03  Simon Fraser  <simon.fraser@apple.com>
+
+        Implement DOMPointReadOnly.matrixTransform()
+        https://bugs.webkit.org/show_bug.cgi?id=172896
+
+        Reviewed by Chris Dumez.
+
+        New baselines.
+
+        * web-platform-tests/css/geometry-1/DOMPoint-002-expected.txt:
+        * web-platform-tests/css/geometry-1/historical-expected.txt:
+
</ins><span class="cx"> 2017-06-03  Yusuke Suzuki  <utatane.tea@gmail.com>
</span><span class="cx"> 
</span><span class="cx">         Script modules should be able to import data urls
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscssgeometry1DOMPoint002expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/DOMPoint-002-expected.txt (217762 => 217763)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/DOMPoint-002-expected.txt       2017-06-03 18:07:17 UTC (rev 217762)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/DOMPoint-002-expected.txt  2017-06-03 21:09:00 UTC (rev 217763)
</span><span class="lines">@@ -18,7 +18,7 @@
</span><span class="cx"> PASS test DOMPoint fromPoint with x, y, z, w, v 
</span><span class="cx"> PASS test DOMPoint fromPoint with x, z 
</span><span class="cx"> PASS test DOMPoint fromPoint with undefined value 
</span><del>-FAIL test DOMPoint matrixTransform point.matrixTransform is not a function. (In 'point.matrixTransform(matrix)', 'point.matrixTransform' is undefined)
</del><ins>+PASS test DOMPoint matrixTransform 
</ins><span class="cx"> PASS test DOMPoint Attributes undefined 
</span><span class="cx"> PASS test DOMPoint Attributes NaN Infinity 
</span><span class="cx"> PASS test DOMPointReadOnly Constructor no args 
</span><span class="lines">@@ -38,6 +38,6 @@
</span><span class="cx"> PASS test DOMPointReadOnly fromPoint with x, y, z, w, v 
</span><span class="cx"> PASS test DOMPointReadOnly fromPoint with x, z 
</span><span class="cx"> PASS test DOMPointReadOnly fromPoint with undefined value 
</span><del>-FAIL test DOMPointReadOnly matrixTransform point.matrixTransform is not a function. (In 'point.matrixTransform(matrix)', 'point.matrixTransform' is undefined)
</del><ins>+PASS test DOMPointReadOnly matrixTransform 
</ins><span class="cx"> PASS test DOMPointReadOnly Attributes undefined 
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscssgeometry1historicalexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/historical-expected.txt (217762 => 217763)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/historical-expected.txt 2017-06-03 18:07:17 UTC (rev 217762)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/historical-expected.txt    2017-06-03 21:09:00 UTC (rev 217763)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> PASS DOMMatrix rotateAxisAngleSelf number of required arguments 
</span><span class="cx"> PASS DOMMatrix skewXSelf number of required arguments 
</span><span class="cx"> PASS DOMMatrix skewYSelf number of required arguments 
</span><del>-FAIL DOMPointReadOnly matrixTransform number of required arguments undefined is not an object (evaluating 'self[interf].prototype[member].length')
</del><ins>+PASS DOMPointReadOnly matrixTransform number of required arguments 
</ins><span class="cx"> PASS DOMMatrixReadOnly multiply number of required arguments 
</span><span class="cx"> PASS DOMMatrix multiplySelf number of required arguments 
</span><span class="cx"> PASS DOMMatrix preMultiplySelf number of required arguments 
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (217762 => 217763)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt      2017-06-03 18:07:17 UTC (rev 217762)
+++ trunk/Source/WebCore/CMakeLists.txt 2017-06-03 21:09:00 UTC (rev 217763)
</span><span class="lines">@@ -1458,6 +1458,7 @@
</span><span class="cx">     dom/DOMError.cpp
</span><span class="cx">     dom/DOMImplementation.cpp
</span><span class="cx">     dom/DOMNamedFlowCollection.cpp
</span><ins>+    dom/DOMPointReadOnly.cpp
</ins><span class="cx">     dom/DOMRectList.cpp
</span><span class="cx">     dom/DOMStringList.cpp
</span><span class="cx">     dom/DataTransfer.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (217762 => 217763)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2017-06-03 18:07:17 UTC (rev 217762)
+++ trunk/Source/WebCore/ChangeLog      2017-06-03 21:09:00 UTC (rev 217763)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2017-06-03  Simon Fraser  <simon.fraser@apple.com>
+
+        Implement DOMPointReadOnly.matrixTransform()
+        https://bugs.webkit.org/show_bug.cgi?id=172896
+
+        Reviewed by Chris Dumez.
+
+        DOMPointReadOnly.matrixTransform() creates the matrix or throws, then uses
+        a new function in TransformationMatrix to map x,y,z,w through the matrix.
+
+        Test: http/wpt/geometry/DOMPoint-003.html
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * css/DOMMatrixReadOnly.h:
+        (WebCore::DOMMatrixReadOnly::transformationMatrix):
+        * dom/DOMPointReadOnly.cpp: Copied from Source/WebCore/dom/DOMPointReadOnly.idl.
+        (WebCore::DOMPointReadOnly::matrixTransform):
+        * dom/DOMPointReadOnly.h:
+        * dom/DOMPointReadOnly.idl:
+        * platform/graphics/transforms/TransformationMatrix.cpp:
+        (WebCore::TransformationMatrix::map4ComponentPoint):
+        * platform/graphics/transforms/TransformationMatrix.h:
+
</ins><span class="cx"> 2017-06-03  Myles C. Maxfield  <mmaxfield@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Cleanup arguments to preparePlatformFont() and fontWithFamily() in FontCacheCoreText.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (217762 => 217763)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj   2017-06-03 18:07:17 UTC (rev 217762)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj      2017-06-03 21:09:00 UTC (rev 217763)
</span><span class="lines">@@ -562,6 +562,7 @@
</span><span class="cx">          0FF5026A102BA9430066F39A /* JSStyleMedia.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF50268102BA9430066F39A /* JSStyleMedia.h */; };
</span><span class="cx">          0FF50271102BA96A0066F39A /* StyleMedia.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF5026E102BA9660066F39A /* StyleMedia.cpp */; };
</span><span class="cx">          0FF50272102BA96A0066F39A /* StyleMedia.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF5026F102BA96A0066F39A /* StyleMedia.h */; };
</span><ins>+               0FF835B81EE3274F008B4CC7 /* DOMPointReadOnly.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF835B71EE3274F008B4CC7 /* DOMPointReadOnly.cpp */; };
</ins><span class="cx">           0FFD4D6018651FA300512F6E /* AsyncScrollingCoordinator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FFD4D5E18651FA300512F6E /* AsyncScrollingCoordinator.cpp */; };
</span><span class="cx">          0FFD4D6118651FA300512F6E /* AsyncScrollingCoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFD4D5F18651FA300512F6E /* AsyncScrollingCoordinator.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          10FB084B14E15C7E00A3DB98 /* PublicURLManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 10FB084A14E15C7E00A3DB98 /* PublicURLManager.h */; };
</span><span class="lines">@@ -7999,6 +8000,7 @@
</span><span class="cx">          0FF5026E102BA9660066F39A /* StyleMedia.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleMedia.cpp; sourceTree = "<group>"; };
</span><span class="cx">          0FF5026F102BA96A0066F39A /* StyleMedia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleMedia.h; sourceTree = "<group>"; };
</span><span class="cx">          0FF50270102BA96A0066F39A /* StyleMedia.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = StyleMedia.idl; sourceTree = "<group>"; };
</span><ins>+               0FF835B71EE3274F008B4CC7 /* DOMPointReadOnly.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMPointReadOnly.cpp; sourceTree = "<group>"; };
</ins><span class="cx">           0FFD4D5E18651FA300512F6E /* AsyncScrollingCoordinator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AsyncScrollingCoordinator.cpp; sourceTree = "<group>"; };
</span><span class="cx">          0FFD4D5F18651FA300512F6E /* AsyncScrollingCoordinator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AsyncScrollingCoordinator.h; sourceTree = "<group>"; };
</span><span class="cx">          10FB084A14E15C7E00A3DB98 /* PublicURLManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PublicURLManager.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -25716,6 +25718,7 @@
</span><span class="cx">                          0F49669A1DB408C100A274BB /* DOMPoint.idl */,
</span><span class="cx">                          0F4966A21DB4091000A274BB /* DOMPointInit.h */,
</span><span class="cx">                          0F4966A11DB4090100A274BB /* DOMPointInit.idl */,
</span><ins>+                               0FF835B71EE3274F008B4CC7 /* DOMPointReadOnly.cpp */,
</ins><span class="cx">                           0F49669B1DB408C100A274BB /* DOMPointReadOnly.h */,
</span><span class="cx">                          0F49669C1DB408C100A274BB /* DOMPointReadOnly.idl */,
</span><span class="cx">                          0F4710A91DB56AFC002DCEC3 /* DOMRect.h */,
</span><span class="lines">@@ -31209,6 +31212,7 @@
</span><span class="cx">                          2D5002F81B56D7810020AAF7 /* DOMPath.cpp in Sources */,
</span><span class="cx">                          A9C6E4EB0D745E2B006442E9 /* DOMPlugin.cpp in Sources */,
</span><span class="cx">                          A9C6E4EF0D745E38006442E9 /* DOMPluginArray.cpp in Sources */,
</span><ins>+                               0FF835B81EE3274F008B4CC7 /* DOMPointReadOnly.cpp in Sources */,
</ins><span class="cx">                           468344DF1EDDFAAA00B7795B /* DOMRectList.cpp in Sources */,
</span><span class="cx">                          BC5A86840C33676000EEA649 /* DOMSelection.cpp in Sources */,
</span><span class="cx">                          C55610F111A704EB00B82D27 /* DOMStringList.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorecssDOMMatrixReadOnlyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/DOMMatrixReadOnly.h (217762 => 217763)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/DOMMatrixReadOnly.h     2017-06-03 18:07:17 UTC (rev 217762)
+++ trunk/Source/WebCore/css/DOMMatrixReadOnly.h        2017-06-03 21:09:00 UTC (rev 217763)
</span><span class="lines">@@ -108,6 +108,8 @@
</span><span class="cx"> 
</span><span class="cx">     ExceptionOr<String> toString() const;
</span><span class="cx"> 
</span><ins>+    const TransformationMatrix& transformationMatrix() const { return m_matrix; }
+
</ins><span class="cx"> protected:
</span><span class="cx">     DOMMatrixReadOnly() = default;
</span><span class="cx">     DOMMatrixReadOnly(const TransformationMatrix&, Is2D);
</span></span></pre></div>
<a id="trunkSourceWebCoredomDOMPointReadOnlycppfromrev217762trunkSourceWebCoredomDOMPointReadOnlyidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/dom/DOMPointReadOnly.cpp (from rev 217762, trunk/Source/WebCore/dom/DOMPointReadOnly.idl) (0 => 217763)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DOMPointReadOnly.cpp                            (rev 0)
+++ trunk/Source/WebCore/dom/DOMPointReadOnly.cpp       2017-06-03 21:09:00 UTC (rev 217763)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials
+ *    provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER 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 "config.h"
+#include "DOMPointReadOnly.h"
+
+#include "DOMMatrixReadOnly.h"
+#include "DOMPoint.h"
+
+namespace WebCore {
+    
+ExceptionOr<Ref<DOMPoint>> DOMPointReadOnly::matrixTransform(DOMMatrixInit&& matrixInit) const
+{
+    auto matrixOrException = DOMMatrixReadOnly::fromMatrix(WTFMove(matrixInit));
+    if (matrixOrException.hasException())
+        return matrixOrException.releaseException();
+
+    auto matrix = matrixOrException.releaseReturnValue();
+    
+    double x = this->x();
+    double y = this->y();
+    double z = this->z();
+    double w = this->w();
+    matrix->transformationMatrix().map4ComponentPoint(x, y, z, w);
+    
+    return { DOMPoint::create(x, y, z, w) };
+}
+
+} // namespace WebCore
+
</ins></span></pre></div>
<a id="trunkSourceWebCoredomDOMPointReadOnlyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DOMPointReadOnly.h (217762 => 217763)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DOMPointReadOnly.h      2017-06-03 18:07:17 UTC (rev 217762)
+++ trunk/Source/WebCore/dom/DOMPointReadOnly.h 2017-06-03 21:09:00 UTC (rev 217763)
</span><span class="lines">@@ -31,11 +31,15 @@
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><span class="cx"> #include "DOMPointInit.h"
</span><ins>+#include "ExceptionOr.h"
</ins><span class="cx"> #include "ScriptWrappable.h"
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+struct DOMMatrixInit;
+class DOMPoint;
+
</ins><span class="cx"> class DOMPointReadOnly : public ScriptWrappable, public RefCounted<DOMPointReadOnly> {
</span><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="lines">@@ -48,6 +52,8 @@
</span><span class="cx">     double z() const { return m_z; }
</span><span class="cx">     double w() const { return m_w; }
</span><span class="cx"> 
</span><ins>+    ExceptionOr<Ref<DOMPoint>> matrixTransform(DOMMatrixInit&&) const;
+
</ins><span class="cx"> protected:
</span><span class="cx">     DOMPointReadOnly(double x, double y, double z, double w)
</span><span class="cx">         : m_x(x)
</span></span></pre></div>
<a id="trunkSourceWebCoredomDOMPointReadOnlyidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DOMPointReadOnly.idl (217762 => 217763)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DOMPointReadOnly.idl    2017-06-03 18:07:17 UTC (rev 217762)
+++ trunk/Source/WebCore/dom/DOMPointReadOnly.idl       2017-06-03 21:09:00 UTC (rev 217763)
</span><span class="lines">@@ -44,8 +44,7 @@
</span><span class="cx">     readonly attribute unrestricted double z;
</span><span class="cx">     readonly attribute unrestricted double w;
</span><span class="cx"> 
</span><del>-    // FIXME: No support for DOMMatrix yet (webkit.org/b/110001)
-    // DOMPoint matrixTransform(optional DOMMatrixInit matrix);
</del><ins>+    [MayThrowException] DOMPoint matrixTransform(optional DOMMatrixInit matrix);
</ins><span class="cx"> 
</span><span class="cx">     serializer = { attribute };
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicstransformsTransformationMatrixcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp (217762 => 217763)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp       2017-06-03 18:07:17 UTC (rev 217762)
+++ trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp  2017-06-03 21:09:00 UTC (rev 217763)
</span><span class="lines">@@ -44,13 +44,6 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> //
</span><del>-// Supporting Math Functions
-//
-// This is a set of function from various places (attributed inline) to do things like
-// inversion and decomposition of a 4x4 matrix. They are used throughout the code
-//
-
-//
</del><span class="cx"> // Adapted from Matrix Inversion by Richard Carling, Graphics Gems <http://tog.acm.org/GraphicsGems/index.html>.
</span><span class="cx"> 
</span><span class="cx"> // EULA: The Graphics Gems code is copyright-protected. In other words, you cannot claim the text of the code
</span><span class="lines">@@ -706,6 +699,25 @@
</span><span class="cx">     return LayoutRect(LayoutUnit::clamp(left), LayoutUnit::clamp(top),  LayoutUnit::clamp(right - left), LayoutUnit::clamp(bottom - top));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void TransformationMatrix::map4ComponentPoint(double& x, double& y, double& z, double& w) const
+{
+    if (isIdentityOrTranslation()) {
+        x += m_matrix[3][0];
+        y += m_matrix[3][1];
+        z += m_matrix[3][2];
+        return;
+    }
+
+    Vector4 input = { x, y, z, w };
+    Vector4 result;
+    v4MulPointByMatrix(input, m_matrix, result);
+
+    x = result[0];
+    y = result[1];
+    z = result[2];
+    w = result[3];
+}
+
</ins><span class="cx"> FloatPoint TransformationMatrix::mapPoint(const FloatPoint& p) const
</span><span class="cx"> {
</span><span class="cx">     if (isIdentityOrTranslation())
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicstransformsTransformationMatrixh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h (217762 => 217763)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h 2017-06-03 18:07:17 UTC (rev 217762)
+++ trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h    2017-06-03 21:09:00 UTC (rev 217763)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef TransformationMatrix_h
-#define TransformationMatrix_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include "FloatPoint.h"
</span><span class="cx"> #include "FloatPoint3D.h"
</span><span class="lines">@@ -135,6 +134,7 @@
</span><span class="cx"> 
</span><span class="cx">     // This form preserves the double math from input to output.
</span><span class="cx">     void map(double x, double y, double& x2, double& y2) const { multVecMatrix(x, y, x2, y2); }
</span><ins>+    void map4ComponentPoint(double& x, double& y, double& z, double& w) const;
</ins><span class="cx"> 
</span><span class="cx">     // Maps a 3D point through the transform, returning a 3D point.
</span><span class="cx">     FloatPoint3D mapPoint(const FloatPoint3D&) const;
</span><span class="lines">@@ -427,5 +427,3 @@
</span><span class="cx"> WEBCORE_EXPORT TextStream& operator<<(TextStream&, const TransformationMatrix&);
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // TransformationMatrix_h
</del></span></pre>
</div>
</div>

</body>
</html>