1 | /*
|
---|
2 | * Copyright (C) 2017 Apple Inc. All rights reserved.
|
---|
3 | *
|
---|
4 | * Redistribution and use in source and binary forms, with or without
|
---|
5 | * modification, are permitted provided that the following conditions
|
---|
6 | * are met:
|
---|
7 | * 1. Redistributions of source code must retain the above copyright
|
---|
8 | * notice, this list of conditions and the following disclaimer.
|
---|
9 | * 2. Redistributions in binary form must reproduce the above copyright
|
---|
10 | * notice, this list of conditions and the following disclaimer in the
|
---|
11 | * documentation and/or other materials provided with the distribution.
|
---|
12 | *
|
---|
13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
---|
14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
---|
15 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
---|
16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
---|
17 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
---|
18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
---|
19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
---|
20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
---|
21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
---|
22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
---|
23 | * THE POSSIBILITY OF SUCH DAMAGE.
|
---|
24 | */
|
---|
25 |
|
---|
26 | // FIXME: Should be [LegacyWindowAlias=(SVGMatrix, WebKitCSSMatrix)].
|
---|
27 | [
|
---|
28 | ExportMacro=WEBCORE_EXPORT,
|
---|
29 | Exposed=(Window,Worker),
|
---|
30 | LegacyWindowAlias=WebKitCSSMatrix,
|
---|
31 | JSGenerateToNativeObject,
|
---|
32 | ] interface DOMMatrix : DOMMatrixReadOnly {
|
---|
33 | [CallWith=CurrentScriptExecutionContext] constructor(optional (DOMString or sequence<unrestricted double>) init);
|
---|
34 |
|
---|
35 | [NewObject] static DOMMatrix fromMatrix(optional DOMMatrixInit other);
|
---|
36 | [NewObject] static DOMMatrix fromFloat32Array(Float32Array array32);
|
---|
37 | [NewObject] static DOMMatrix fromFloat64Array(Float64Array array64);
|
---|
38 |
|
---|
39 | // These attributes are simple aliases for certain elements of the 4x4 matrix
|
---|
40 | inherit attribute unrestricted double a; // Alias for m11.
|
---|
41 | inherit attribute unrestricted double b; // Alias for m12.
|
---|
42 | inherit attribute unrestricted double c; // Alias for m21.
|
---|
43 | inherit attribute unrestricted double d; // Alias for m22.
|
---|
44 | inherit attribute unrestricted double e; // Alias for m41.
|
---|
45 | inherit attribute unrestricted double f; // Alias for m42.
|
---|
46 |
|
---|
47 | inherit attribute unrestricted double m11;
|
---|
48 | inherit attribute unrestricted double m12;
|
---|
49 | inherit attribute unrestricted double m13;
|
---|
50 | inherit attribute unrestricted double m14;
|
---|
51 | inherit attribute unrestricted double m21;
|
---|
52 | inherit attribute unrestricted double m22;
|
---|
53 | inherit attribute unrestricted double m23;
|
---|
54 | inherit attribute unrestricted double m24;
|
---|
55 | inherit attribute unrestricted double m31;
|
---|
56 | inherit attribute unrestricted double m32;
|
---|
57 | inherit attribute unrestricted double m33;
|
---|
58 | inherit attribute unrestricted double m34;
|
---|
59 | inherit attribute unrestricted double m41;
|
---|
60 | inherit attribute unrestricted double m42;
|
---|
61 | inherit attribute unrestricted double m43;
|
---|
62 | inherit attribute unrestricted double m44;
|
---|
63 |
|
---|
64 | // Mutable transform methods
|
---|
65 | DOMMatrix multiplySelf(optional DOMMatrixInit other);
|
---|
66 | DOMMatrix preMultiplySelf(optional DOMMatrixInit other);
|
---|
67 | DOMMatrix translateSelf(optional unrestricted double tx = 0,
|
---|
68 | optional unrestricted double ty = 0,
|
---|
69 | optional unrestricted double tz = 0);
|
---|
70 | DOMMatrix scaleSelf(optional unrestricted double scaleX = 1,
|
---|
71 | optional unrestricted double scaleY,
|
---|
72 | optional unrestricted double scaleZ = 1,
|
---|
73 | optional unrestricted double originX = 0,
|
---|
74 | optional unrestricted double originY = 0,
|
---|
75 | optional unrestricted double originZ = 0);
|
---|
76 | DOMMatrix scale3dSelf(optional unrestricted double scale = 1,
|
---|
77 | optional unrestricted double originX = 0,
|
---|
78 | optional unrestricted double originY = 0,
|
---|
79 | optional unrestricted double originZ = 0);
|
---|
80 | DOMMatrix rotateSelf(optional unrestricted double rotX = 0,
|
---|
81 | optional unrestricted double rotY,
|
---|
82 | optional unrestricted double rotZ); // Angles are in degrees.
|
---|
83 | DOMMatrix rotateFromVectorSelf(optional unrestricted double x = 0,
|
---|
84 | optional unrestricted double y = 0);
|
---|
85 | DOMMatrix rotateAxisAngleSelf(optional unrestricted double x = 0,
|
---|
86 | optional unrestricted double y = 0,
|
---|
87 | optional unrestricted double z = 0,
|
---|
88 | optional unrestricted double angle = 0); // Angle is in degrees.
|
---|
89 | DOMMatrix skewXSelf(optional unrestricted double sx = 0); // Angle is in degrees.
|
---|
90 | DOMMatrix skewYSelf(optional unrestricted double sy = 0); // Angle is in degrees.
|
---|
91 | DOMMatrix invertSelf();
|
---|
92 |
|
---|
93 | [Exposed=Window, ImplementedAs=setMatrixValueForBindings] DOMMatrix setMatrixValue(DOMString transformList);
|
---|
94 | };
|
---|