WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-172896-20170603124609.patch (text/plain), 20.93 KB, created by
Simon Fraser (smfr)
on 2017-06-03 12:46:10 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2017-06-03 12:46:10 PDT
Size:
20.93 KB
patch
obsolete
>Subversion Revision: 217759 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 2fe5e6fc8d28146cc9f829fb2f8c2b70f8382be4..a9473a119ae8b1bad752ed2c920f9da683bbf945 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,5 +1,29 @@ > 2017-06-03 Simon Fraser <simon.fraser@apple.com> > >+ Implement DOMPointReadOnly.matrixTransform() >+ https://bugs.webkit.org/show_bug.cgi?id=172896 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ DOMPointReadOnly.matrixTransform() creates the matrix or throws, then uses >+ a new function in TransformationMatrix to map x,y,z,w through the matrix. >+ >+ Test: imported/w3c/web-platform-tests/css/geometry-1/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: >+ >+2017-06-03 Simon Fraser <simon.fraser@apple.com> >+ > Sort the project file. > > * WebCore.xcodeproj/project.pbxproj: >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index 1d3ddef6fdf96da677d11729563118570bee6607..f88efe8e7340388cff6dcc33ccf3111362582fd7 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -1367,6 +1367,7 @@ set(WebCore_SOURCES > css/DOMCSSNamespace.cpp > css/DOMMatrix.cpp > css/DOMMatrixReadOnly.cpp >+ css/DOMPointReadOnly.cpp > css/DeprecatedCSSOMPrimitiveValue.cpp > css/DeprecatedCSSOMValue.cpp > css/DeprecatedCSSOMValueList.cpp >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index cf6e49f5bd6a2def7be4e3267f635a9593b31a5e..3d09602ad0de900108d329fdf1d0bbced370de1e 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -562,6 +562,7 @@ > 0FF5026A102BA9430066F39A /* JSStyleMedia.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF50268102BA9430066F39A /* JSStyleMedia.h */; }; > 0FF50271102BA96A0066F39A /* StyleMedia.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF5026E102BA9660066F39A /* StyleMedia.cpp */; }; > 0FF50272102BA96A0066F39A /* StyleMedia.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF5026F102BA96A0066F39A /* StyleMedia.h */; }; >+ 0FF835B81EE3274F008B4CC7 /* DOMPointReadOnly.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF835B71EE3274F008B4CC7 /* DOMPointReadOnly.cpp */; }; > 0FFD4D6018651FA300512F6E /* AsyncScrollingCoordinator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FFD4D5E18651FA300512F6E /* AsyncScrollingCoordinator.cpp */; }; > 0FFD4D6118651FA300512F6E /* AsyncScrollingCoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFD4D5F18651FA300512F6E /* AsyncScrollingCoordinator.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 10FB084B14E15C7E00A3DB98 /* PublicURLManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 10FB084A14E15C7E00A3DB98 /* PublicURLManager.h */; }; >@@ -7999,6 +8000,7 @@ > 0FF5026E102BA9660066F39A /* StyleMedia.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleMedia.cpp; sourceTree = "<group>"; }; > 0FF5026F102BA96A0066F39A /* StyleMedia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleMedia.h; sourceTree = "<group>"; }; > 0FF50270102BA96A0066F39A /* StyleMedia.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = StyleMedia.idl; sourceTree = "<group>"; }; >+ 0FF835B71EE3274F008B4CC7 /* DOMPointReadOnly.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMPointReadOnly.cpp; sourceTree = "<group>"; }; > 0FFD4D5E18651FA300512F6E /* AsyncScrollingCoordinator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AsyncScrollingCoordinator.cpp; sourceTree = "<group>"; }; > 0FFD4D5F18651FA300512F6E /* AsyncScrollingCoordinator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AsyncScrollingCoordinator.h; sourceTree = "<group>"; }; > 10FB084A14E15C7E00A3DB98 /* PublicURLManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PublicURLManager.h; sourceTree = "<group>"; }; >@@ -25716,6 +25718,7 @@ > 0F49669A1DB408C100A274BB /* DOMPoint.idl */, > 0F4966A21DB4091000A274BB /* DOMPointInit.h */, > 0F4966A11DB4090100A274BB /* DOMPointInit.idl */, >+ 0FF835B71EE3274F008B4CC7 /* DOMPointReadOnly.cpp */, > 0F49669B1DB408C100A274BB /* DOMPointReadOnly.h */, > 0F49669C1DB408C100A274BB /* DOMPointReadOnly.idl */, > 0F4710A91DB56AFC002DCEC3 /* DOMRect.h */, >@@ -31209,6 +31212,7 @@ > 2D5002F81B56D7810020AAF7 /* DOMPath.cpp in Sources */, > A9C6E4EB0D745E2B006442E9 /* DOMPlugin.cpp in Sources */, > A9C6E4EF0D745E38006442E9 /* DOMPluginArray.cpp in Sources */, >+ 0FF835B81EE3274F008B4CC7 /* DOMPointReadOnly.cpp in Sources */, > 468344DF1EDDFAAA00B7795B /* DOMRectList.cpp in Sources */, > BC5A86840C33676000EEA649 /* DOMSelection.cpp in Sources */, > C55610F111A704EB00B82D27 /* DOMStringList.cpp in Sources */, >diff --git a/Source/WebCore/css/DOMMatrixReadOnly.h b/Source/WebCore/css/DOMMatrixReadOnly.h >index a9b4ddf74ade87b5c197299dbcc261d1869ae121..e17694cb3f3e9dc61bf3b4d13c62185de5291f7a 100644 >--- a/Source/WebCore/css/DOMMatrixReadOnly.h >+++ b/Source/WebCore/css/DOMMatrixReadOnly.h >@@ -108,6 +108,8 @@ public: > > ExceptionOr<String> toString() const; > >+ const TransformationMatrix& transformationMatrix() const { return m_matrix; } >+ > protected: > DOMMatrixReadOnly() = default; > DOMMatrixReadOnly(const TransformationMatrix&, Is2D); >diff --git a/Source/WebCore/dom/DOMPointReadOnly.cpp b/Source/WebCore/dom/DOMPointReadOnly.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..5564964973107d52562c8880c5b56f56f8ad5301 >--- /dev/null >+++ b/Source/WebCore/dom/DOMPointReadOnly.cpp >@@ -0,0 +1,56 @@ >+/* >+ * 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 >+ >diff --git a/Source/WebCore/dom/DOMPointReadOnly.h b/Source/WebCore/dom/DOMPointReadOnly.h >index 1b98302aca6f441859ab45df1828aea40aa6f68b..e8a80cb656bfe5db4dfb96c1c0a332486a28ec9d 100644 >--- a/Source/WebCore/dom/DOMPointReadOnly.h >+++ b/Source/WebCore/dom/DOMPointReadOnly.h >@@ -31,11 +31,15 @@ > #pragma once > > #include "DOMPointInit.h" >+#include "ExceptionOr.h" > #include "ScriptWrappable.h" > #include <wtf/RefCounted.h> > > namespace WebCore { > >+struct DOMMatrixInit; >+class DOMPoint; >+ > class DOMPointReadOnly : public ScriptWrappable, public RefCounted<DOMPointReadOnly> { > WTF_MAKE_FAST_ALLOCATED; > public: >@@ -48,6 +52,8 @@ public: > double z() const { return m_z; } > double w() const { return m_w; } > >+ ExceptionOr<Ref<DOMPoint>> matrixTransform(DOMMatrixInit&&) const; >+ > protected: > DOMPointReadOnly(double x, double y, double z, double w) > : m_x(x) >diff --git a/Source/WebCore/dom/DOMPointReadOnly.idl b/Source/WebCore/dom/DOMPointReadOnly.idl >index 9a00b9f4f377446d78b1eb261d6a8f7de2e29c86..3ffd66fd7121a9dc7cc5f8573a76a789744f968e 100644 >--- a/Source/WebCore/dom/DOMPointReadOnly.idl >+++ b/Source/WebCore/dom/DOMPointReadOnly.idl >@@ -44,8 +44,7 @@ interface DOMPointReadOnly { > readonly attribute unrestricted double z; > readonly attribute unrestricted double w; > >- // FIXME: No support for DOMMatrix yet (webkit.org/b/110001) >- // DOMPoint matrixTransform(optional DOMMatrixInit matrix); >+ [MayThrowException] DOMPoint matrixTransform(optional DOMMatrixInit matrix); > > serializer = { attribute }; > }; >diff --git a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp >index 7a783aa70168e3543754eb42d8b4bf9886b3aa83..fa83cdb41dfe1c08c37245aab3ed471216fc01ca 100644 >--- a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp >+++ b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp >@@ -44,13 +44,6 @@ > namespace WebCore { > > // >-// 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 >-// >- >-// > // Adapted from Matrix Inversion by Richard Carling, Graphics Gems <http://tog.acm.org/GraphicsGems/index.html>. > > // EULA: The Graphics Gems code is copyright-protected. In other words, you cannot claim the text of the code >@@ -706,6 +699,25 @@ LayoutRect TransformationMatrix::clampedBoundsOfProjectedQuad(const FloatQuad& q > return LayoutRect(LayoutUnit::clamp(left), LayoutUnit::clamp(top), LayoutUnit::clamp(right - left), LayoutUnit::clamp(bottom - top)); > } > >+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]; >+} >+ > FloatPoint TransformationMatrix::mapPoint(const FloatPoint& p) const > { > if (isIdentityOrTranslation()) >diff --git a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h >index 56f225a3a6ad4565c858510df758629641b7453e..1bd8334ed3d4c3f4ca400729e78c74b5430c0b78 100644 >--- a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h >+++ b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h >@@ -23,8 +23,7 @@ > * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > >-#ifndef TransformationMatrix_h >-#define TransformationMatrix_h >+#pragma once > > #include "FloatPoint.h" > #include "FloatPoint3D.h" >@@ -135,6 +134,7 @@ public: > > // This form preserves the double math from input to output. > void map(double x, double y, double& x2, double& y2) const { multVecMatrix(x, y, x2, y2); } >+ void map4ComponentPoint(double& x, double& y, double& z, double& w) const; > > // Maps a 3D point through the transform, returning a 3D point. > FloatPoint3D mapPoint(const FloatPoint3D&) const; >@@ -427,5 +427,3 @@ private: > WEBCORE_EXPORT TextStream& operator<<(TextStream&, const TransformationMatrix&); > > } // namespace WebCore >- >-#endif // TransformationMatrix_h >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index 8d33581e3b7c6765926c01cf4d0f6a77d35eebf5..cdfa4815e0bb0544b7014dccedf0e2a8050011d9 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,21 @@ >+2017-06-03 Simon Fraser <simon.fraser@apple.com> >+ >+ Implement DOMPointReadOnly.matrixTransform() >+ https://bugs.webkit.org/show_bug.cgi?id=172896 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Correct variable naming in DOMPoint-002.html. >+ >+ DOMPoint-003.html is new test which exercises matrixTransform() with non-2D >+ points and matrices. >+ >+ * web-platform-tests/css/geometry-1/DOMPoint-002-expected.txt: >+ * web-platform-tests/css/geometry-1/DOMPoint-002.html: >+ * web-platform-tests/css/geometry-1/DOMPoint-003-expected.txt: Added. >+ * web-platform-tests/css/geometry-1/DOMPoint-003.html: Added. >+ * web-platform-tests/css/geometry-1/historical-expected.txt: >+ > 2017-06-02 Javier Fernandez <jfernandez@igalia.com> > > [css-grid] Margin wrong applied when stretching an orthogonal item in fixed size track >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/DOMPoint-002-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/DOMPoint-002-expected.txt >index 4dd1028d21e8331fa26f73ba0692fae4800ef110..18fbf2e53f9a4c8e82099ddd6c70fcf0fbfcbfa9 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/DOMPoint-002-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/DOMPoint-002-expected.txt >@@ -18,7 +18,7 @@ PASS test DOMPoint fromPoint with x, y, z, w > PASS test DOMPoint fromPoint with x, y, z, w, v > PASS test DOMPoint fromPoint with x, z > PASS test DOMPoint fromPoint with undefined value >-FAIL test DOMPoint matrixTransform point.matrixTransform is not a function. (In 'point.matrixTransform(matrix)', 'point.matrixTransform' is undefined) >+PASS test DOMPoint matrixTransform > PASS test DOMPoint Attributes undefined > PASS test DOMPoint Attributes NaN Infinity > PASS test DOMPointReadOnly Constructor no args >@@ -38,6 +38,6 @@ PASS test DOMPointReadOnly fromPoint with x, y, z, w > PASS test DOMPointReadOnly fromPoint with x, y, z, w, v > PASS test DOMPointReadOnly fromPoint with x, z > PASS test DOMPointReadOnly fromPoint with undefined value >-FAIL test DOMPointReadOnly matrixTransform point.matrixTransform is not a function. (In 'point.matrixTransform(matrix)', 'point.matrixTransform' is undefined) >+PASS test DOMPointReadOnly matrixTransform > PASS test DOMPointReadOnly Attributes undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/DOMPoint-002.html b/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/DOMPoint-002.html >index dd52f2b49bc878cdb51664b7bb1865a1bb0b2913..ccef0093a337c6d9026d234aa0cf2bcfdcbbec74 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/DOMPoint-002.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/DOMPoint-002.html >@@ -13,9 +13,9 @@ > 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 w = point.x * matrix.m13 + point.y * matrix.m23 + point.z * matrix.m33 + point.w * matrix.m43; >- var z = point.x * matrix.m14 + point.y * matrix.m24 + point.z * matrix.m34 + point.w * matrix.m44; >- return new DOMPoint(x, y, w, z) >+ 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() { >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/DOMPoint-003-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/DOMPoint-003-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..e1e8c4777ac967873cb197f502e5912a1da57c8f >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/DOMPoint-003-expected.txt >@@ -0,0 +1,6 @@ >+Test DOMPoint and DOMPointReadOnly interfaces >+ >+ >+PASS test DOMPoint matrixTransform with 3d matrix >+PASS test DOMPoint matrixTransform with perspective point >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/DOMPoint-003.html b/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/DOMPoint-003.html >new file mode 100644 >index 0000000000000000000000000000000000000000..bc548e5bf3cae392be42bc7580f727af9b80f341 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/DOMPoint-003.html >@@ -0,0 +1,45 @@ >+<!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> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/historical-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/historical-expected.txt >index 4d53650c8d6c39064eaa6badf91597a2b6c89bc4..75878759c754e9b11b2a1e8b0f733f525adbe3b5 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/historical-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/historical-expected.txt >@@ -28,7 +28,7 @@ PASS DOMMatrix rotateFromVectorSelf number of required arguments > PASS DOMMatrix rotateAxisAngleSelf number of required arguments > PASS DOMMatrix skewXSelf number of required arguments > PASS DOMMatrix skewYSelf number of required arguments >-FAIL DOMPointReadOnly matrixTransform number of required arguments undefined is not an object (evaluating 'self[interf].prototype[member].length') >+PASS DOMPointReadOnly matrixTransform number of required arguments > PASS DOMMatrixReadOnly multiply number of required arguments > PASS DOMMatrix multiplySelf number of required arguments > PASS DOMMatrix preMultiplySelf number of required arguments
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 172896
:
311938
|
311939
|
311940
|
311941