Changeset 40807 in webkit
- Timestamp:
- Feb 9, 2009 9:22:08 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r40804 r40807 1 2009-02-09 Chris Marrin <cmarrin@apple.com> 2 3 Reviewed by Simon Fraser 4 5 https://bugs.webkit.org/show_bug.cgi?id=23689 6 7 Add test for 3D functionality of WebKitCSSMatrix. 8 9 * transforms/3d: Added. 10 * transforms/3d/cssmatrix-3d-interface-expected.txt: Added. 11 * transforms/3d/cssmatrix-3d-interface.xhtml: Added. 12 1 13 2009-02-09 Mark Rowe <mrowe@apple.com> 2 14 -
trunk/LayoutTests/transforms/2d/cssmatrix-interface-expected.txt
r39974 r40807 8 8 PASS object constructor 9 9 PASS string constructor 10 11 Test toString 12 PASS a[0] is "matrix" 13 PASS parseFloat(a2[0]) is 1 14 PASS parseFloat(a2[1]) is 0 15 PASS parseFloat(a2[2]) is 0 16 PASS parseFloat(a2[3]) is 1 17 PASS parseFloat(a2[4]) is 0 18 PASS parseFloat(a3[0]) is 0 19 PASS a3[1] is "" 10 20 11 21 Test bad input to string constructor … … 57 67 PASS parseFloat(m3.f) is 112 58 68 69 Test multiply with missing argument 70 PASS m2 is null 71 72 Test immutability of multiply 73 PASS parseFloat(m.a) is 1 74 PASS parseFloat(m.b) is 2 75 PASS parseFloat(m.c) is 3 76 PASS parseFloat(m.d) is 4 77 PASS parseFloat(m.e) is 5 78 PASS parseFloat(m.f) is 6 79 59 80 Test inverse 60 81 PASS parseFloat(m2.a) is 0.5 … … 65 86 PASS parseFloat(m2.f) is -10 66 87 88 Test immutability of inverse 89 PASS parseFloat(m.a) is 2 90 PASS parseFloat(m.b) is 0 91 PASS parseFloat(m.c) is 0 92 PASS parseFloat(m.d) is 2 93 PASS parseFloat(m.e) is 10 94 PASS parseFloat(m.f) is 20 95 67 96 Test throwing exception from inverse 68 97 PASS m.inverse() threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9. 69 98 70 99 Test translate 71 PASS m.a is 1 72 PASS m.b is 0 73 PASS m.c is 0 74 PASS m.d is 1 75 PASS m.e is 10 76 PASS m.f is 20 100 PASS m2.a is 1 101 PASS m2.b is 0 102 PASS m2.c is 0 103 PASS m2.d is 1 104 PASS m2.e is 10 105 PASS m2.f is 20 106 107 Test immutability of translate 108 PASS parseFloat(m.a) is 1 109 PASS parseFloat(m.b) is 0 110 PASS parseFloat(m.c) is 0 111 PASS parseFloat(m.d) is 1 112 PASS parseFloat(m.e) is 0 113 PASS parseFloat(m.f) is 0 77 114 78 115 Test scale 79 PASS m.a is 10 80 PASS m.b is 0 81 PASS m.c is 0 82 PASS m.d is 20 116 PASS m2.a is 10 117 PASS m2.b is 0 118 PASS m2.c is 0 119 PASS m2.d is 20 120 PASS m2.e is 0 121 PASS m2.f is 0 122 123 Test immutability of scale 124 PASS parseFloat(m.a) is 1 125 PASS parseFloat(m.b) is 0 126 PASS parseFloat(m.c) is 0 127 PASS parseFloat(m.d) is 1 128 PASS parseFloat(m.e) is 0 129 PASS parseFloat(m.f) is 0 130 131 Test rotate 132 PASS parseFloat(m2.a.toPrecision(6)) is 0.984808 133 PASS parseFloat(m2.b.toPrecision(6)) is 0.173648 134 PASS parseFloat(m2.c.toPrecision(6)) is -0.173648 135 PASS parseFloat(m2.d.toPrecision(6)) is 0.984808 83 136 PASS m.e is 0 84 137 PASS m.f is 0 85 138 86 Test rotate87 PASS Math.round(m.a*1000000)/1000000 is 0.98480888 PASS Math.round(m.b*1000000)/1000000 is 0.17364889 PASS Math.round(m.c*1000000)/1000000 is -0.17364890 PASS Math.round(m.d*1000000)/1000000 is 0.98480891 PASS m.eis 092 PASS m.fis 0139 Test immutability of rotate 140 PASS parseFloat(m.a) is 1 141 PASS parseFloat(m.b) is 0 142 PASS parseFloat(m.c) is 0 143 PASS parseFloat(m.d) is 1 144 PASS parseFloat(m.e) is 0 145 PASS parseFloat(m.f) is 0 93 146 94 147 PASS successfullyParsed is true -
trunk/LayoutTests/transforms/2d/cssmatrix-interface.xhtml
r39968 r40807 33 33 else 34 34 testFailed("string constructor"); 35 36 debug(""); 37 debug("Test toString"); 38 var m = new WebKitCSSMatrix("matrix(1, 0, 0, 1, 0, 0)"); 39 var s = m.toString(); 40 var a = s.split('('); 41 shouldBe('a[0]', '"matrix"'); 42 var a2 = a[1].split(','); 43 shouldBe('parseFloat(a2[0])', '1'); 44 shouldBe('parseFloat(a2[1])', '0'); 45 shouldBe('parseFloat(a2[2])', '0'); 46 shouldBe('parseFloat(a2[3])', '1'); 47 shouldBe('parseFloat(a2[4])', '0'); 48 var a3 = a2[5].split(")"); 49 shouldBe('parseFloat(a3[0])', '0'); 50 shouldBe('a3[1]', '""'); 35 51 36 52 debug(""); … … 99 115 100 116 debug(""); 117 debug("Test multiply with missing argument"); 118 m = new WebKitCSSMatrix("matrix(1, 2, 3, 4, 5, 6)"); 119 m2 = m.multiply(); 120 shouldBe('m2', 'null'); 121 122 debug(""); 123 debug("Test immutability of multiply"); 124 shouldBe('parseFloat(m.a)', '1'); 125 shouldBe('parseFloat(m.b)', '2'); 126 shouldBe('parseFloat(m.c)', '3'); 127 shouldBe('parseFloat(m.d)', '4'); 128 shouldBe('parseFloat(m.e)', '5'); 129 shouldBe('parseFloat(m.f)', '6'); 130 131 debug(""); 101 132 debug("Test inverse"); 102 133 m = new WebKitCSSMatrix("matrix(2, 0, 0, 2, 10, 20)"); … … 111 142 112 143 debug(""); 144 debug("Test immutability of inverse"); 145 shouldBe('parseFloat(m.a)', '2'); 146 shouldBe('parseFloat(m.b)', '0'); 147 shouldBe('parseFloat(m.c)', '0'); 148 shouldBe('parseFloat(m.d)', '2'); 149 shouldBe('parseFloat(m.e)', '10'); 150 shouldBe('parseFloat(m.f)', '20'); 151 152 debug(""); 113 153 debug("Test throwing exception from inverse"); 114 154 m = new WebKitCSSMatrix("matrix(0, 0, 0, 0, 0, 0)"); // not invertible … … 118 158 debug("Test translate"); 119 159 m = new WebKitCSSMatrix(); 120 m = m.translate(10, 20); 121 shouldBe('m.a', '1'); 122 shouldBe('m.b', '0'); 123 shouldBe('m.c', '0'); 124 shouldBe('m.d', '1'); 125 shouldBe('m.e', '10'); 126 shouldBe('m.f', '20'); 160 m2 = m.translate(10, 20); 161 shouldBe('m2.a', '1'); 162 shouldBe('m2.b', '0'); 163 shouldBe('m2.c', '0'); 164 shouldBe('m2.d', '1'); 165 shouldBe('m2.e', '10'); 166 shouldBe('m2.f', '20'); 167 168 debug(""); 169 debug("Test immutability of translate"); 170 shouldBe('parseFloat(m.a)', '1'); 171 shouldBe('parseFloat(m.b)', '0'); 172 shouldBe('parseFloat(m.c)', '0'); 173 shouldBe('parseFloat(m.d)', '1'); 174 shouldBe('parseFloat(m.e)', '0'); 175 shouldBe('parseFloat(m.f)', '0'); 127 176 128 177 debug(""); 129 178 debug("Test scale"); 130 179 m = new WebKitCSSMatrix(); 131 m = m.scale(10, 20); 132 shouldBe('m.a', '10'); 133 shouldBe('m.b', '0'); 134 shouldBe('m.c', '0'); 135 shouldBe('m.d', '20'); 180 m2 = m.scale(10, 20); 181 shouldBe('m2.a', '10'); 182 shouldBe('m2.b', '0'); 183 shouldBe('m2.c', '0'); 184 shouldBe('m2.d', '20'); 185 shouldBe('m2.e', '0'); 186 shouldBe('m2.f', '0'); 187 188 debug(""); 189 debug("Test immutability of scale"); 190 shouldBe('parseFloat(m.a)', '1'); 191 shouldBe('parseFloat(m.b)', '0'); 192 shouldBe('parseFloat(m.c)', '0'); 193 shouldBe('parseFloat(m.d)', '1'); 194 shouldBe('parseFloat(m.e)', '0'); 195 shouldBe('parseFloat(m.f)', '0'); 196 197 debug(""); 198 debug("Test rotate"); 199 m = new WebKitCSSMatrix(); 200 m2 = m.rotate(10); 201 shouldBe('parseFloat(m2.a.toPrecision(6))', '0.984808'); 202 shouldBe('parseFloat(m2.b.toPrecision(6))', '0.173648'); 203 shouldBe('parseFloat(m2.c.toPrecision(6))', '-0.173648'); 204 shouldBe('parseFloat(m2.d.toPrecision(6))', '0.984808'); 136 205 shouldBe('m.e', '0'); 137 206 shouldBe('m.f', '0'); 138 207 139 208 debug(""); 140 debug("Test rotate"); 141 m = new WebKitCSSMatrix(); 142 m = m.rotate(10); 143 shouldBe('Math.round(m.a*1000000)/1000000', '0.984808'); 144 shouldBe('Math.round(m.b*1000000)/1000000', '0.173648'); 145 shouldBe('Math.round(m.c*1000000)/1000000', '-0.173648'); 146 shouldBe('Math.round(m.d*1000000)/1000000', '0.984808'); 147 shouldBe('m.e', '0'); 148 shouldBe('m.f', '0'); 209 debug("Test immutability of rotate"); 210 shouldBe('parseFloat(m.a)', '1'); 211 shouldBe('parseFloat(m.b)', '0'); 212 shouldBe('parseFloat(m.c)', '0'); 213 shouldBe('parseFloat(m.d)', '1'); 214 shouldBe('parseFloat(m.e)', '0'); 215 shouldBe('parseFloat(m.f)', '0'); 149 216 150 217 debug(""); -
trunk/WebCore/ChangeLog
r40804 r40807 1 2009-02-09 Chris Marrin <cmarrin@apple.com> 2 3 Reviewed by Simon Fraser 4 5 https://bugs.webkit.org/show_bug.cgi?id=23689 6 7 Added 3D functions to WebKitCSSMatrix. This depends on the 3D functions 8 added to TransformationMatrix in https://bugs.webkit.org/show_bug.cgi?id=6868 9 10 Test: transforms/3d/cssmatrix-3d-interface.xhtml 11 12 * css/WebKitCSSMatrix.cpp: 13 * css/WebKitCSSMatrix.h: 14 * css/WebKitCSSMatrix.idl: 15 1 16 2009-02-09 Mark Rowe <mrowe@apple.com> 2 17 -
trunk/WebCore/css/WebKitCSSMatrix.cpp
r40761 r40807 25 25 26 26 #include "config.h" 27 #include "WebKitCSSMatrix.h" 27 28 28 29 #include "CSSParser.h" … … 32 33 #include "ExceptionCode.h" 33 34 #include "RenderStyle.h" 34 #include "WebKitCSSMatrix.h"35 #include <wtf/MathExtras.h> 35 36 36 37 namespace WebCore { … … 94 95 95 96 // This is a multRight (this = this * secondMatrix) 96 PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::multiply(WebKitCSSMatrix* secondMatrix) 97 PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::multiply(WebKitCSSMatrix* secondMatrix) const 97 98 { 99 if (!secondMatrix) 100 return 0; 101 98 102 TransformationMatrix tmp(m_matrix); 99 103 tmp.multiply(secondMatrix->m_matrix); … … 101 105 } 102 106 103 PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::inverse(ExceptionCode& ec) 107 PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::inverse(ExceptionCode& ec) const 104 108 { 105 109 if (!m_matrix.isInvertible()) { … … 111 115 } 112 116 113 PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::translate( float x, float y)117 PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::translate(double x, double y, double z) const 114 118 { 115 119 if (isnan(x)) 116 x = 0; 120 x = 0; 117 121 if (isnan(y)) 118 y = 0; 119 return WebKitCSSMatrix::create(m_matrix.translate(x, y)); 122 y = 0; 123 if (isnan(z)) 124 z = 0; 125 return WebKitCSSMatrix::create(TransformationMatrix(m_matrix).translate3d(x, y, z)); 120 126 } 121 127 122 PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::scale( float scaleX, float scaleY)128 PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::scale(double scaleX, double scaleY, double scaleZ) const 123 129 { 124 130 if (isnan(scaleX)) 125 scaleX = 1; 131 scaleX = 1; 126 132 if (isnan(scaleY)) 127 scaleY = scaleX; 128 return WebKitCSSMatrix::create(m_matrix.scaleNonUniform(scaleX,scaleY)); 133 scaleY = scaleX; 134 if (isnan(scaleZ)) 135 scaleZ = 1; 136 return WebKitCSSMatrix::create(TransformationMatrix(m_matrix).scale3d(scaleX, scaleY, scaleZ)); 129 137 } 130 138 131 PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::rotate( float rot)139 PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::rotate(double rotX, double rotY, double rotZ) const 132 140 { 133 if (isnan(rot)) 134 rot = 0; 135 return WebKitCSSMatrix::create(m_matrix.rotate(rot)); 141 if (isnan(rotX)) 142 rotX = 0; 143 144 if (isnan(rotY) && isnan(rotZ)) { 145 rotZ = rotX; 146 rotX = 0; 147 rotY = 0; 148 } 149 150 if (isnan(rotY)) 151 rotY = 0; 152 if (isnan(rotZ)) 153 rotZ = 0; 154 return WebKitCSSMatrix::create(TransformationMatrix(m_matrix).rotate3d(rotX, rotY, rotZ)); 136 155 } 137 156 138 String WebKitCSSMatrix::toString() 157 PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::rotateAxisAngle(double x, double y, double z, double angle) const 139 158 { 140 return String::format("matrix(%f, %f, %f, %f, %f, %f)", 141 m_matrix.a(), m_matrix.b(), m_matrix.c(), m_matrix.d(), m_matrix.e(), m_matrix.f()); 159 if (isnan(x)) 160 x = 0; 161 if (isnan(y)) 162 y = 0; 163 if (isnan(z)) 164 z = 0; 165 if (isnan(angle)) 166 angle = 0; 167 if (x == 0 && y == 0 && z == 0) 168 z = 1; 169 return WebKitCSSMatrix::create(TransformationMatrix(m_matrix).rotate3d(x, y, z, angle)); 170 } 171 172 173 String WebKitCSSMatrix::toString() const 174 { 175 // FIXME - Need to ensure valid CSS floating point values (https://bugs.webkit.org/show_bug.cgi?id=20674) 176 if (m_matrix.isAffine()) 177 return String::format("matrix(%f, %f, %f, %f, %f, %f)", 178 m_matrix.a(), m_matrix.b(), m_matrix.c(), m_matrix.d(), m_matrix.e(), m_matrix.f()); 179 return String::format("matrix3d(%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f)", 180 m_matrix.m11(), m_matrix.m12(), m_matrix.m13(), m_matrix.m14(), 181 m_matrix.m21(), m_matrix.m22(), m_matrix.m23(), m_matrix.m24(), 182 m_matrix.m31(), m_matrix.m32(), m_matrix.m33(), m_matrix.m34(), 183 m_matrix.m41(), m_matrix.m42(), m_matrix.m43(), m_matrix.m44()); 142 184 } 143 185 -
trunk/WebCore/css/WebKitCSSMatrix.h
r39922 r40807 27 27 #define WebKitCSSMatrix_h 28 28 29 #include "ExceptionCode.h" 30 #include "PlatformString.h" 29 31 #include "StyleBase.h" 30 #include "PlatformString.h"31 32 #include "TransformationMatrix.h" 32 33 #include <wtf/PassRefPtr.h> … … 56 57 virtual ~WebKitCSSMatrix(); 57 58 58 float a() const { return static_cast<float>(m_matrix.a()); }59 float b() const { return static_cast<float>(m_matrix.b()); }60 float c() const { return static_cast<float>(m_matrix.c()); }61 float d() const { return static_cast<float>(m_matrix.d()); }62 float e() const { return static_cast<float>(m_matrix.e()); }63 float f() const { return static_cast<float>(m_matrix.f()); }59 double a() const { return m_matrix.a(); } 60 double b() const { return m_matrix.b(); } 61 double c() const { return m_matrix.c(); } 62 double d() const { return m_matrix.d(); } 63 double e() const { return m_matrix.e(); } 64 double f() const { return m_matrix.f(); } 64 65 65 void setA(float f) { m_matrix.setA(f); } 66 void setB(float f) { m_matrix.setB(f); } 67 void setC(float f) { m_matrix.setC(f); } 68 void setD(float f) { m_matrix.setD(f); } 69 void setE(float f) { m_matrix.setE(f); } 70 void setF(float f) { m_matrix.setF(f); } 66 void setA(double f) { m_matrix.setA(f); } 67 void setB(double f) { m_matrix.setB(f); } 68 void setC(double f) { m_matrix.setC(f); } 69 void setD(double f) { m_matrix.setD(f); } 70 void setE(double f) { m_matrix.setE(f); } 71 void setF(double f) { m_matrix.setF(f); } 72 73 double m11() const { return m_matrix.m11(); } 74 double m12() const { return m_matrix.m12(); } 75 double m13() const { return m_matrix.m13(); } 76 double m14() const { return m_matrix.m14(); } 77 double m21() const { return m_matrix.m21(); } 78 double m22() const { return m_matrix.m22(); } 79 double m23() const { return m_matrix.m23(); } 80 double m24() const { return m_matrix.m24(); } 81 double m31() const { return m_matrix.m31(); } 82 double m32() const { return m_matrix.m32(); } 83 double m33() const { return m_matrix.m33(); } 84 double m34() const { return m_matrix.m34(); } 85 double m41() const { return m_matrix.m41(); } 86 double m42() const { return m_matrix.m42(); } 87 double m43() const { return m_matrix.m43(); } 88 double m44() const { return m_matrix.m44(); } 89 90 void setM11(double f) { m_matrix.setM11(f); } 91 void setM12(double f) { m_matrix.setM12(f); } 92 void setM13(double f) { m_matrix.setM13(f); } 93 void setM14(double f) { m_matrix.setM14(f); } 94 void setM21(double f) { m_matrix.setM21(f); } 95 void setM22(double f) { m_matrix.setM22(f); } 96 void setM23(double f) { m_matrix.setM23(f); } 97 void setM24(double f) { m_matrix.setM24(f); } 98 void setM31(double f) { m_matrix.setM31(f); } 99 void setM32(double f) { m_matrix.setM32(f); } 100 void setM33(double f) { m_matrix.setM33(f); } 101 void setM34(double f) { m_matrix.setM34(f); } 102 void setM41(double f) { m_matrix.setM41(f); } 103 void setM42(double f) { m_matrix.setM42(f); } 104 void setM43(double f) { m_matrix.setM43(f); } 105 void setM44(double f) { m_matrix.setM44(f); } 71 106 72 107 void setMatrixValue(const String& string, ExceptionCode&); 73 108 74 // this = this * secondMatrix75 PassRefPtr<WebKitCSSMatrix> multiply(WebKitCSSMatrix* secondMatrix);109 // The following math function return a new matrix with the 110 // specified operation applied. The this value is not modified. 76 111 77 // FIXME: we really should have an exception here, for when matrix is not invertible 78 PassRefPtr<WebKitCSSMatrix> inverse(ExceptionCode&); 79 PassRefPtr<WebKitCSSMatrix> translate(float x, float y); 80 PassRefPtr<WebKitCSSMatrix> scale(float scaleX, float scaleY); 81 PassRefPtr<WebKitCSSMatrix> rotate(float rot); 112 // Multiply this matrix by secondMatrix, on the right (result = this * secondMatrix) 113 PassRefPtr<WebKitCSSMatrix> multiply(WebKitCSSMatrix* secondMatrix) const; 82 114 83 const TransformationMatrix& transform() { return m_matrix; } 115 // Return the inverse of this matrix. Throw an exception if the matrix is not invertible 116 PassRefPtr<WebKitCSSMatrix> inverse(ExceptionCode&) const; 84 117 85 String toString(); 118 // Return this matrix translated by the passed values. 119 // Passing a NaN will use a value of 0. This allows the 3D form to used for 2D operations 120 // Operation is performed as though the this matrix is multiplied by a matrix with 121 // the translation values on the left (result = translation(x,y,z) * this) 122 PassRefPtr<WebKitCSSMatrix> translate(double x, double y, double z) const; 123 124 // Returns this matrix scaled by the passed values. 125 // Passing scaleX or scaleZ as NaN uses a value of 1, but passing scaleY of NaN 126 // makes it the same as scaleX. This allows the 3D form to used for 2D operations 127 // Operation is performed as though the this matrix is multiplied by a matrix with 128 // the scale values on the left (result = scale(x,y,z) * this) 129 PassRefPtr<WebKitCSSMatrix> scale(double scaleX, double scaleY, double scaleZ) const; 130 131 // Returns this matrix rotated by the passed values. 132 // If rotY and rotZ are NaN, rotate about Z (rotX=0, rotateY=0, rotateZ=rotX). 133 // Otherwise use a rotation value of 0 for any passed NaN. 134 // Operation is performed as though the this matrix is multiplied by a matrix with 135 // the rotation values on the left (result = rotation(x,y,z) * this) 136 PassRefPtr<WebKitCSSMatrix> rotate(double rotX, double rotY, double rotZ) const; 137 138 // Returns this matrix rotated about the passed axis by the passed angle. 139 // Passing a NaN will use a value of 0. If the axis is (0,0,0) use a value 140 // Operation is performed as though the this matrix is multiplied by a matrix with 141 // the rotation values on the left (result = rotation(x,y,z,angle) * this) 142 PassRefPtr<WebKitCSSMatrix> rotateAxisAngle(double x, double y, double z, double angle) const; 143 144 const TransformationMatrix& transform() const { return m_matrix; } 145 146 String toString() const; 86 147 87 148 protected: -
trunk/WebCore/css/WebKitCSSMatrix.idl
r39922 r40807 29 29 interface WebKitCSSMatrix { 30 30 31 attribute float a; 32 attribute float b; 33 attribute float c; 34 attribute float d; 35 attribute float e; 36 attribute float f; 31 // These attributes are simple aliases for certain elements of the 4x4 matrix 32 attribute double a; // alias for m11 33 attribute double b; // alias for m12 34 attribute double c; // alias for m21 35 attribute double d; // alias for m22 36 attribute double e; // alias for m41 37 attribute double f; // alias for m42 37 38 38 void setMatrixValue(in DOMString string) raises (DOMException); 39 WebKitCSSMatrix multiply(in WebKitCSSMatrix secondMatrix); 40 WebKitCSSMatrix inverse() raises (DOMException); 41 WebKitCSSMatrix translate(in float x, in float y); 42 WebKitCSSMatrix scale(in float scaleX, in float scaleY); 43 WebKitCSSMatrix rotate(in float rot); 39 attribute double m11; 40 attribute double m12; 41 attribute double m13; 42 attribute double m14; 43 attribute double m21; 44 attribute double m22; 45 attribute double m23; 46 attribute double m24; 47 attribute double m31; 48 attribute double m32; 49 attribute double m33; 50 attribute double m34; 51 attribute double m41; 52 attribute double m42; 53 attribute double m43; 54 attribute double m44; 55 56 void setMatrixValue(in DOMString string) raises (DOMException); 57 58 // Multiply this matrix by secondMatrix, on the right (result = this * secondMatrix) 59 [Immutable] WebKitCSSMatrix multiply(in WebKitCSSMatrix secondMatrix); 60 61 // Return the inverse of this matrix. Throw an exception if the matrix is not invertible 62 [Immutable] WebKitCSSMatrix inverse() raises (DOMException); 63 64 // Return this matrix translated by the passed values. 65 // Passing a NaN will use a value of 0. This allows the 3D form to used for 2D operations 66 [Immutable] WebKitCSSMatrix translate(in double x, in double y, in double z); 67 68 // Returns this matrix scaled by the passed values. 69 // Passing scaleX or scaleZ as NaN uses a value of 1, but passing scaleY of NaN 70 // makes it the same as scaleX. This allows the 3D form to used for 2D operations 71 [Immutable] WebKitCSSMatrix scale(in double scaleX, in double scaleY, in double scaleZ); 72 73 // Returns this matrix rotated by the passed values. 74 // If rotY and rotZ are NaN, rotate about Z (rotX=0, rotateY=0, rotateZ=rotX). 75 // Otherwise use a rotation value of 0 for any passed NaN. 76 [Immutable] WebKitCSSMatrix rotate(in double rotX, in double rotY, in double rotZ); 77 78 // Returns this matrix rotated about the passed axis by the passed angle. 79 // Passing a NaN will use a value of 0. If the axis is (0,0,0) use a value 80 // of (0,0,1). 81 [Immutable] WebKitCSSMatrix rotateAxisAngle(in double x, in double y, in double z, in double angle); 44 82 45 83 [DontEnum] DOMString toString();
Note: See TracChangeset
for help on using the changeset viewer.