| Differences between
and this patch
- a/Source/WebCore/ChangeLog +26 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2017-06-03  Chris Dumez  <cdumez@apple.com>
2
3
        Implement DOMMatrix's fromFloat32Array / fromFloat64Array & toFloat32Array / toFloat64Array
4
        https://bugs.webkit.org/show_bug.cgi?id=172898
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Implement DOMMatrix's fromFloat32Array / fromFloat64Array & toFloat32Array / toFloat64Array
9
        as per:
10
        - https://drafts.fxtf.org/geometry/#dommatrixreadonly
11
12
        Test: http/wpt/geometry/DOMMatrix-from-to-typed-arrays.html
13
14
        * css/DOMMatrix.cpp:
15
        (WebCore::DOMMatrix::fromFloat32Array):
16
        (WebCore::DOMMatrix::fromFloat64Array):
17
        * css/DOMMatrix.h:
18
        * css/DOMMatrix.idl:
19
        * css/DOMMatrixReadOnly.cpp:
20
        (WebCore::DOMMatrixReadOnly::fromFloat32Array):
21
        (WebCore::DOMMatrixReadOnly::fromFloat64Array):
22
        (WebCore::DOMMatrixReadOnly::toFloat32Array):
23
        (WebCore::DOMMatrixReadOnly::toFloat64Array):
24
        * css/DOMMatrixReadOnly.h:
25
        * css/DOMMatrixReadOnly.idl:
26
1
2017-06-02  Frederic Wang  <fwang@igalia.com>
27
2017-06-02  Frederic Wang  <fwang@igalia.com>
2
28
3
        [Mac] Include frames in the scrolling tree when ScrollingTreeIncludesFrames=true
29
        [Mac] Include frames in the scrolling tree when ScrollingTreeIncludesFrames=true
- a/Source/WebCore/css/DOMMatrix.cpp +34 lines
Lines 43-48 ExceptionOr<Ref<DOMMatrix>> DOMMatrix::fromMatrix(DOMMatrixInit&& init) a/Source/WebCore/css/DOMMatrix.cpp_sec1
43
    return fromMatrixHelper<DOMMatrix>(WTFMove(init));
43
    return fromMatrixHelper<DOMMatrix>(WTFMove(init));
44
}
44
}
45
45
46
ExceptionOr<Ref<DOMMatrix>> DOMMatrix::fromFloat32Array(Ref<Float32Array>&& array32)
47
{
48
    if (array32->length() == 6)
49
        return DOMMatrix::create(TransformationMatrix(array32->item(0), array32->item(1), array32->item(2), array32->item(3), array32->item(4), array32->item(5)), Is2D::Yes);
50
51
    if (array32->length() == 16) {
52
        return DOMMatrix::create(TransformationMatrix(
53
            array32->item(0), array32->item(1), array32->item(2), array32->item(3),
54
            array32->item(4), array32->item(5), array32->item(6), array32->item(7),
55
            array32->item(8), array32->item(9), array32->item(10), array32->item(11),
56
            array32->item(12), array32->item(13), array32->item(14), array32->item(15)
57
        ), Is2D::No);
58
    }
59
60
    return Exception { TypeError };
61
}
62
63
ExceptionOr<Ref<DOMMatrix>> DOMMatrix::fromFloat64Array(Ref<Float64Array>&& array64)
64
{
65
    if (array64->length() == 6)
66
        return DOMMatrix::create(TransformationMatrix(array64->item(0), array64->item(1), array64->item(2), array64->item(3), array64->item(4), array64->item(5)), Is2D::Yes);
67
68
    if (array64->length() == 16) {
69
        return DOMMatrix::create(TransformationMatrix(
70
            array64->item(0), array64->item(1), array64->item(2), array64->item(3),
71
            array64->item(4), array64->item(5), array64->item(6), array64->item(7),
72
            array64->item(8), array64->item(9), array64->item(10), array64->item(11),
73
            array64->item(12), array64->item(13), array64->item(14), array64->item(15)
74
        ), Is2D::No);
75
    }
76
77
    return Exception { TypeError };
78
}
79
46
// https://drafts.fxtf.org/geometry/#dom-dommatrix-multiplyself
80
// https://drafts.fxtf.org/geometry/#dom-dommatrix-multiplyself
47
ExceptionOr<Ref<DOMMatrix>> DOMMatrix::multiplySelf(DOMMatrixInit&& other)
81
ExceptionOr<Ref<DOMMatrix>> DOMMatrix::multiplySelf(DOMMatrixInit&& other)
48
{
82
{
- a/Source/WebCore/css/DOMMatrix.h +3 lines
Lines 52-57 public: a/Source/WebCore/css/DOMMatrix.h_sec1
52
52
53
    static ExceptionOr<Ref<DOMMatrix>> fromMatrix(DOMMatrixInit&&);
53
    static ExceptionOr<Ref<DOMMatrix>> fromMatrix(DOMMatrixInit&&);
54
54
55
    static ExceptionOr<Ref<DOMMatrix>> fromFloat32Array(Ref<Float32Array>&&);
56
    static ExceptionOr<Ref<DOMMatrix>> fromFloat64Array(Ref<Float64Array>&&);
57
55
    ExceptionOr<Ref<DOMMatrix>> multiplySelf(DOMMatrixInit&& other);
58
    ExceptionOr<Ref<DOMMatrix>> multiplySelf(DOMMatrixInit&& other);
56
    ExceptionOr<Ref<DOMMatrix>> preMultiplySelf(DOMMatrixInit&& other);
59
    ExceptionOr<Ref<DOMMatrix>> preMultiplySelf(DOMMatrixInit&& other);
57
    Ref<DOMMatrix> translateSelf(double tx = 0, double ty = 0, double tz = 0);
60
    Ref<DOMMatrix> translateSelf(double tx = 0, double ty = 0, double tz = 0);
- a/Source/WebCore/css/DOMMatrix.idl -2 / +2 lines
Lines 32-39 a/Source/WebCore/css/DOMMatrix.idl_sec1
32
    ImplementationLacksVTable
32
    ImplementationLacksVTable
33
 ] interface DOMMatrix : DOMMatrixReadOnly {
33
 ] interface DOMMatrix : DOMMatrixReadOnly {
34
    [MayThrowException, NewObject] static DOMMatrix fromMatrix(optional DOMMatrixInit other);
34
    [MayThrowException, NewObject] static DOMMatrix fromMatrix(optional DOMMatrixInit other);
35
    // [NewObject] static DOMMatrix fromFloat32Array(Float32Array array32); // FIXME: Implement this.
35
    [MayThrowException, NewObject] static DOMMatrix fromFloat32Array(Float32Array array32);
36
    // [NewObject] static DOMMatrix fromFloat64Array(Float64Array array64);  // FIXME: Implement this.
36
    [MayThrowException, NewObject] static DOMMatrix fromFloat64Array(Float64Array array64);
37
37
38
    // These attributes are simple aliases for certain elements of the 4x4 matrix
38
    // These attributes are simple aliases for certain elements of the 4x4 matrix
39
    inherit attribute unrestricted double a; // Alias for m11.
39
    inherit attribute unrestricted double a; // Alias for m11.
- a/Source/WebCore/css/DOMMatrixReadOnly.cpp +87 lines
Lines 32-37 a/Source/WebCore/css/DOMMatrixReadOnly.cpp_sec1
32
#include "ExceptionCode.h"
32
#include "ExceptionCode.h"
33
#include "StyleProperties.h"
33
#include "StyleProperties.h"
34
#include "TransformFunctions.h"
34
#include "TransformFunctions.h"
35
#include <JavaScriptCore/GenericTypedArrayViewInlines.h>
36
#include <JavaScriptCore/JSGenericTypedArrayViewInlines.h>
37
#include <heap/HeapInlines.h>
35
#include <wtf/text/StringBuilder.h>
38
#include <wtf/text/StringBuilder.h>
36
39
37
namespace WebCore {
40
namespace WebCore {
Lines 114-119 ExceptionOr<Ref<DOMMatrixReadOnly>> DOMMatrixReadOnly::fromMatrix(DOMMatrixInit& a/Source/WebCore/css/DOMMatrixReadOnly.cpp_sec2
114
    return fromMatrixHelper<DOMMatrixReadOnly>(WTFMove(init));
117
    return fromMatrixHelper<DOMMatrixReadOnly>(WTFMove(init));
115
}
118
}
116
119
120
ExceptionOr<Ref<DOMMatrixReadOnly>> DOMMatrixReadOnly::fromFloat32Array(Ref<Float32Array>&& array32)
121
{
122
    if (array32->length() == 6)
123
        return DOMMatrixReadOnly::create(TransformationMatrix(array32->item(0), array32->item(1), array32->item(2), array32->item(3), array32->item(4), array32->item(5)), Is2D::Yes);
124
125
    if (array32->length() == 16) {
126
        return DOMMatrixReadOnly::create(TransformationMatrix(
127
            array32->item(0), array32->item(1), array32->item(2), array32->item(3),
128
            array32->item(4), array32->item(5), array32->item(6), array32->item(7),
129
            array32->item(8), array32->item(9), array32->item(10), array32->item(11),
130
            array32->item(12), array32->item(13), array32->item(14), array32->item(15)
131
        ), Is2D::No);
132
    }
133
134
    return Exception { TypeError };
135
}
136
137
ExceptionOr<Ref<DOMMatrixReadOnly>> DOMMatrixReadOnly::fromFloat64Array(Ref<Float64Array>&& array64)
138
{
139
    if (array64->length() == 6)
140
        return DOMMatrixReadOnly::create(TransformationMatrix(array64->item(0), array64->item(1), array64->item(2), array64->item(3), array64->item(4), array64->item(5)), Is2D::Yes);
141
142
    if (array64->length() == 16) {
143
        return DOMMatrixReadOnly::create(TransformationMatrix(
144
            array64->item(0), array64->item(1), array64->item(2), array64->item(3),
145
            array64->item(4), array64->item(5), array64->item(6), array64->item(7),
146
            array64->item(8), array64->item(9), array64->item(10), array64->item(11),
147
            array64->item(12), array64->item(13), array64->item(14), array64->item(15)
148
        ), Is2D::No);
149
    }
150
151
    return Exception { TypeError };
152
}
153
117
bool DOMMatrixReadOnly::isIdentity() const
154
bool DOMMatrixReadOnly::isIdentity() const
118
{
155
{
119
    return m_matrix.isIdentity();
156
    return m_matrix.isIdentity();
Lines 248-253 Ref<DOMMatrix> DOMMatrixReadOnly::inverse() const a/Source/WebCore/css/DOMMatrixReadOnly.cpp_sec3
248
    return matrix->invertSelf();
285
    return matrix->invertSelf();
249
}
286
}
250
287
288
RefPtr<Float32Array> DOMMatrixReadOnly::toFloat32Array() const
289
{
290
    auto array32 = Float32Array::createUninitialized(16);
291
    if (!array32)
292
        return nullptr;
293
294
    array32->set(static_cast<unsigned>(0), m_matrix.m11());
295
    array32->set(1, m_matrix.m12());
296
    array32->set(2, m_matrix.m13());
297
    array32->set(3, m_matrix.m14());
298
    array32->set(4, m_matrix.m21());
299
    array32->set(5, m_matrix.m22());
300
    array32->set(6, m_matrix.m23());
301
    array32->set(7, m_matrix.m24());
302
    array32->set(8, m_matrix.m31());
303
    array32->set(9, m_matrix.m32());
304
    array32->set(10, m_matrix.m33());
305
    array32->set(11, m_matrix.m34());
306
    array32->set(12, m_matrix.m41());
307
    array32->set(13, m_matrix.m42());
308
    array32->set(14, m_matrix.m43());
309
    array32->set(15, m_matrix.m44());
310
    return array32;
311
}
312
313
RefPtr<Float64Array> DOMMatrixReadOnly::toFloat64Array() const
314
{
315
    auto array64 = Float64Array::createUninitialized(16);
316
    if (!array64)
317
        return nullptr;
318
319
    array64->set(static_cast<unsigned>(0), m_matrix.m11());
320
    array64->set(1, m_matrix.m12());
321
    array64->set(2, m_matrix.m13());
322
    array64->set(3, m_matrix.m14());
323
    array64->set(4, m_matrix.m21());
324
    array64->set(5, m_matrix.m22());
325
    array64->set(6, m_matrix.m23());
326
    array64->set(7, m_matrix.m24());
327
    array64->set(8, m_matrix.m31());
328
    array64->set(9, m_matrix.m32());
329
    array64->set(10, m_matrix.m33());
330
    array64->set(11, m_matrix.m34());
331
    array64->set(12, m_matrix.m41());
332
    array64->set(13, m_matrix.m42());
333
    array64->set(14, m_matrix.m43());
334
    array64->set(15, m_matrix.m44());
335
    return array64;
336
}
337
251
// https://drafts.fxtf.org/geometry/#dom-dommatrixreadonly-stringifier
338
// https://drafts.fxtf.org/geometry/#dom-dommatrixreadonly-stringifier
252
ExceptionOr<String> DOMMatrixReadOnly::toString() const
339
ExceptionOr<String> DOMMatrixReadOnly::toString() const
253
{
340
{
- a/Source/WebCore/css/DOMMatrixReadOnly.h +8 lines
Lines 29-34 a/Source/WebCore/css/DOMMatrixReadOnly.h_sec1
29
#include "ExceptionOr.h"
29
#include "ExceptionOr.h"
30
#include "ScriptWrappable.h"
30
#include "ScriptWrappable.h"
31
#include "TransformationMatrix.h"
31
#include "TransformationMatrix.h"
32
#include <runtime/Float32Array.h>
33
#include <runtime/Float64Array.h>
32
#include <wtf/RefCounted.h>
34
#include <wtf/RefCounted.h>
33
#include <wtf/Variant.h>
35
#include <wtf/Variant.h>
34
#include <wtf/Vector.h>
36
#include <wtf/Vector.h>
Lines 63-68 public: a/Source/WebCore/css/DOMMatrixReadOnly.h_sec2
63
65
64
    static ExceptionOr<Ref<DOMMatrixReadOnly>> fromMatrix(DOMMatrixInit&&);
66
    static ExceptionOr<Ref<DOMMatrixReadOnly>> fromMatrix(DOMMatrixInit&&);
65
67
68
    static ExceptionOr<Ref<DOMMatrixReadOnly>> fromFloat32Array(Ref<Float32Array>&&);
69
    static ExceptionOr<Ref<DOMMatrixReadOnly>> fromFloat64Array(Ref<Float64Array>&&);
70
66
    double a() const { return m_matrix.a(); }
71
    double a() const { return m_matrix.a(); }
67
    double b() const { return m_matrix.b(); }
72
    double b() const { return m_matrix.b(); }
68
    double c() const { return m_matrix.c(); }
73
    double c() const { return m_matrix.c(); }
Lines 106-111 public: a/Source/WebCore/css/DOMMatrixReadOnly.h_sec3
106
    Ref<DOMMatrix> skewY(double sy = 0); // Angle is in degrees.
111
    Ref<DOMMatrix> skewY(double sy = 0); // Angle is in degrees.
107
    Ref<DOMMatrix> inverse() const;
112
    Ref<DOMMatrix> inverse() const;
108
113
114
    RefPtr<Float32Array> toFloat32Array() const;
115
    RefPtr<Float64Array> toFloat64Array() const;
116
109
    ExceptionOr<String> toString() const;
117
    ExceptionOr<String> toString() const;
110
118
111
protected:
119
protected:
- a/Source/WebCore/css/DOMMatrixReadOnly.idl -4 / +4 lines
Lines 31-38 a/Source/WebCore/css/DOMMatrixReadOnly.idl_sec1
31
    ImplementationLacksVTable
31
    ImplementationLacksVTable
32
] interface DOMMatrixReadOnly {
32
] interface DOMMatrixReadOnly {
33
    [MayThrowException, NewObject] static DOMMatrixReadOnly fromMatrix(optional DOMMatrixInit other);
33
    [MayThrowException, NewObject] static DOMMatrixReadOnly fromMatrix(optional DOMMatrixInit other);
34
    // [NewObject] static DOMMatrixReadOnly fromFloat32Array(Float32Array array32); // FIXME: Implement this.
34
    [MayThrowException, NewObject] static DOMMatrixReadOnly fromFloat32Array(Float32Array array32);
35
    // [NewObject] static DOMMatrixReadOnly fromFloat64Array(Float64Array array64); // FIXME: Implement this.
35
    [MayThrowException, NewObject] static DOMMatrixReadOnly fromFloat64Array(Float64Array array64);
36
36
37
    // These attributes are simple aliases for certain elements of the 4x4 matrix
37
    // These attributes are simple aliases for certain elements of the 4x4 matrix
38
    readonly attribute unrestricted double a; // Alias for m11.
38
    readonly attribute unrestricted double a; // Alias for m11.
Lines 93-100 a/Source/WebCore/css/DOMMatrixReadOnly.idl_sec2
93
    [NewObject] DOMMatrix inverse();
93
    [NewObject] DOMMatrix inverse();
94
94
95
    // [NewObject] DOMPoint transformPoint(optional DOMPointInit point); // FIXME: Implement this.
95
    // [NewObject] DOMPoint transformPoint(optional DOMPointInit point); // FIXME: Implement this.
96
    // [NewObject] Float32Array toFloat32Array(); // FIXME: Implement this.
96
    [NewObject] Float32Array? toFloat32Array();
97
    // [NewObject] Float64Array toFloat64Array(); // FIXME: Implement this.
97
    [NewObject] Float64Array? toFloat64Array();
98
98
99
    [MayThrowException] DOMString toString(); // FIXME: Should be stringifier; once it is supported.
99
    [MayThrowException] DOMString toString(); // FIXME: Should be stringifier; once it is supported.
100
    serializer = { attribute };
100
    serializer = { attribute };
- a/LayoutTests/ChangeLog +12 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2017-06-03  Chris Dumez  <cdumez@apple.com>
2
3
        Implement DOMMatrix's fromFloat32Array / fromFloat64Array & toFloat32Array / toFloat64Array
4
        https://bugs.webkit.org/show_bug.cgi?id=172898
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Add layout test coverage.
9
10
        * http/wpt/geometry/DOMMatrix-from-to-typed-arrays-expected.txt: Added.
11
        * http/wpt/geometry/DOMMatrix-from-to-typed-arrays.html: Added.
12
1
2017-06-02  Matt Lewis  <jlewis3@apple.com>
13
2017-06-02  Matt Lewis  <jlewis3@apple.com>
2
14
3
        Moved test expectation for http/tests/preload/viewport/meta-viewport-link-headers.php to correct file.
15
        Moved test expectation for http/tests/preload/viewport/meta-viewport-link-headers.php to correct file.
- a/LayoutTests/imported/w3c/ChangeLog +11 lines
Lines 1-3 a/LayoutTests/imported/w3c/ChangeLog_sec1
1
2017-06-03  Chris Dumez  <cdumez@apple.com>
2
3
        Implement DOMMatrix's fromFloat32Array / fromFloat64Array & toFloat32Array / toFloat64Array
4
        https://bugs.webkit.org/show_bug.cgi?id=172898
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Rebaseline web-platform-test now that more checks are passing.
9
10
        * web-platform-tests/css/geometry-1/DOMMatrix-newobject-expected.txt:
11
1
2017-06-02  Javier Fernandez  <jfernandez@igalia.com>
12
2017-06-02  Javier Fernandez  <jfernandez@igalia.com>
2
13
3
        [css-grid] Margin wrong applied when stretching an orthogonal item in fixed size track
14
        [css-grid] Margin wrong applied when stretching an orthogonal item in fixed size track
- a/LayoutTests/http/wpt/geometry/DOMMatrix-from-to-typed-arrays-expected.txt +12 lines
Line 0 a/LayoutTests/http/wpt/geometry/DOMMatrix-from-to-typed-arrays-expected.txt_sec1
1
2
PASS DOMMatrixReadOnly.fromFloat32Array (error cases) 
3
PASS DOMMatrixReadOnly.fromFloat32Array 
4
PASS DOMMatrixReadOnly.fromFloat64Array (error cases) 
5
PASS DOMMatrixReadOnly.fromFloat64Array 
6
PASS DOMMatrix.fromFloat32Array (error cases) 
7
PASS DOMMatrix.fromFloat32Array 
8
PASS DOMMatrix.fromFloat64Array (error cases) 
9
PASS DOMMatrix.fromFloat64Array 
10
PASS DOMMatrixReadonly.toFloat32Array 
11
PASS DOMMatrixReadonly.toFloat64Array 
12
- a/LayoutTests/http/wpt/geometry/DOMMatrix-from-to-typed-arrays.html +85 lines
Line 0 a/LayoutTests/http/wpt/geometry/DOMMatrix-from-to-typed-arrays.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<title>Geometry Interfaces: DOMMatrix conversion to and from typed arrays</title>
5
<link href="mailto:cdumez@apple.com" rel="author" title="Chris Dumez">
6
<link href="https://drafts.fxtf.org/geometry/#dommatrixreadonly" rel="help">
7
<script src="/resources/testharness.js"></script>
8
<script src="/resources/testharnessreport.js"></script>
9
</head>
10
<body>
11
<script>
12
for (let matrix of ["DOMMatrixReadOnly", "DOMMatrix"]) {
13
14
    test(function() {
15
        assert_throws(new TypeError, () => { window[matrix].fromFloat32Array() }, "No parameter");
16
        assert_throws(new TypeError, () => { window[matrix].fromFloat32Array(null) }, "Passing null");
17
        assert_throws(new TypeError, () => { window[matrix].fromFloat32Array(new Float64Array()) }, "Bad parameter");
18
        assert_throws(new TypeError, () => { window[matrix].fromFloat32Array(new Float32Array()) }, "Empty Float32Array");
19
        assert_throws(new TypeError, () => { window[matrix].fromFloat32Array(new Float32Array([1, 2])) }, "Float32Array with too few items");
20
        assert_throws(new TypeError, () => { window[matrix].fromFloat32Array(new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17])) }, "Float32Array with too many items");
21
    }, matrix + ".fromFloat32Array (error cases)");
22
23
    test(function() {
24
        let matrix2d = window[matrix].fromFloat32Array(new Float32Array([1.5, 2.5, 3.5, 4.5, 5.5, 6.5]));
25
        assert_equals(matrix2d.__proto__, window[matrix].prototype);
26
        assert_equals(matrix2d.toString(), "matrix(1.5, 2.5, 3.5, 4.5, 5.5, 6.5)");
27
28
        let matrix3d = window[matrix].fromFloat32Array(new Float32Array([1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5, 16.5]));
29
        assert_equals(matrix3d.__proto__, window[matrix].prototype);
30
        assert_equals(matrix3d.toString(), "matrix3d(1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5, 16.5)");
31
    }, matrix + ".fromFloat32Array");
32
33
    test(function() {
34
        assert_throws(new TypeError, () => { window[matrix].fromFloat64Array() }, "No parameter");
35
        assert_throws(new TypeError, () => { window[matrix].fromFloat64Array(null) }, "Passing null");
36
        assert_throws(new TypeError, () => { window[matrix].fromFloat64Array(new Float32Array()) }, "Bad parameter");
37
        assert_throws(new TypeError, () => { window[matrix].fromFloat64Array(new Float64Array()) }, "Empty Float64Array");
38
        assert_throws(new TypeError, () => { window[matrix].fromFloat64Array(new Float64Array([1, 2])) }, "Float64Array with too few items");
39
        assert_throws(new TypeError, () => { window[matrix].fromFloat64Array(new Float64Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17])) }, "Float64Array with too many items");
40
    }, matrix + ".fromFloat64Array (error cases)");
41
42
    test(function() {
43
        let matrix2d = window[matrix].fromFloat64Array(new Float64Array([1.5, 2.5, 3.5, 4.5, 5.5, 6.5]));
44
        assert_equals(matrix2d.__proto__, window[matrix].prototype);
45
        assert_equals(matrix2d.toString(), "matrix(1.5, 2.5, 3.5, 4.5, 5.5, 6.5)");
46
47
        let matrix3d = window[matrix].fromFloat64Array(new Float64Array([1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5, 16.5]));
48
        assert_equals(matrix3d.__proto__, window[matrix].prototype);
49
        assert_equals(matrix3d.toString(), "matrix3d(1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5, 16.5)");
50
}, matrix + ".fromFloat64Array");
51
52
}
53
54
test(function() {
55
    let matrix2d = new DOMMatrixReadOnly([1.5, 2.5, 3.5, 4.5, 5.5, 6.5]);
56
    let array32 = matrix2d.toFloat32Array();
57
    assert_equals(array32.__proto__, Float32Array.prototype);
58
    assert_equals(array32.length, 16);
59
    assert_equals(array32.toString(), "1.5,2.5,0,0,3.5,4.5,0,0,0,0,1,0,5.5,6.5,0,1");
60
61
    let matrix3d = new DOMMatrixReadOnly([1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5, 16.5]);
62
    array32 = matrix3d.toFloat32Array();
63
    assert_equals(array32.__proto__, Float32Array.prototype);
64
    assert_equals(array32.length, 16);
65
    assert_equals(array32.toString(), "1.5,2.5,3.5,4.5,5.5,6.5,7.5,8.5,9.5,10.5,11.5,12.5,13.5,14.5,15.5,16.5");
66
    assert_equals(matrix3d.toString(), DOMMatrixReadOnly.fromFloat32Array(array32).toString());
67
}, "DOMMatrixReadonly.toFloat32Array");
68
69
test(function() {
70
    let matrix2d = new DOMMatrixReadOnly([1.5, 2.5, 3.5, 4.5, 5.5, 6.5]);
71
    let array64 = matrix2d.toFloat64Array();
72
    assert_equals(array64.__proto__, Float64Array.prototype);
73
    assert_equals(array64.length, 16);
74
    assert_equals(array64.toString(), "1.5,2.5,0,0,3.5,4.5,0,0,0,0,1,0,5.5,6.5,0,1");
75
76
    let matrix3d = new DOMMatrixReadOnly([1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5, 16.5]);
77
    array64 = matrix3d.toFloat64Array();
78
    assert_equals(array64.__proto__, Float64Array.prototype);
79
    assert_equals(array64.length, 16);
80
    assert_equals(array64.toString(), "1.5,2.5,3.5,4.5,5.5,6.5,7.5,8.5,9.5,10.5,11.5,12.5,13.5,14.5,15.5,16.5");
81
    assert_equals(matrix3d.toString(), DOMMatrixReadOnly.fromFloat64Array(array64).toString());
82
}, "DOMMatrixReadonly.toFloat64Array");
83
</script>
84
</body>
85
</html>
- a/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/DOMMatrix-newobject-expected.txt -4 / +4 lines
Lines 12-19 PASS DOMMatrix flipX a/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/DOMMatrix-newobject-expected.txt_sec1
12
PASS DOMMatrix flipY 
12
PASS DOMMatrix flipY 
13
PASS DOMMatrix inverse 
13
PASS DOMMatrix inverse 
14
FAIL DOMMatrix transformPoint matrix[method] is not a function. (In 'matrix[method]()', 'matrix[method]' is undefined)
14
FAIL DOMMatrix transformPoint matrix[method] is not a function. (In 'matrix[method]()', 'matrix[method]' is undefined)
15
FAIL DOMMatrix toFloat32Array matrix[method] is not a function. (In 'matrix[method]()', 'matrix[method]' is undefined)
15
PASS DOMMatrix toFloat32Array 
16
FAIL DOMMatrix toFloat64Array matrix[method] is not a function. (In 'matrix[method]()', 'matrix[method]' is undefined)
16
PASS DOMMatrix toFloat64Array 
17
PASS DOMMatrixReadOnly translate 
17
PASS DOMMatrixReadOnly translate 
18
PASS DOMMatrixReadOnly scale 
18
PASS DOMMatrixReadOnly scale 
19
PASS DOMMatrixReadOnly scale3d 
19
PASS DOMMatrixReadOnly scale3d 
Lines 27-32 PASS DOMMatrixReadOnly flipX a/LayoutTests/imported/w3c/web-platform-tests/css/geometry-1/DOMMatrix-newobject-expected.txt_sec2
27
PASS DOMMatrixReadOnly flipY 
27
PASS DOMMatrixReadOnly flipY 
28
PASS DOMMatrixReadOnly inverse 
28
PASS DOMMatrixReadOnly inverse 
29
FAIL DOMMatrixReadOnly transformPoint matrix[method] is not a function. (In 'matrix[method]()', 'matrix[method]' is undefined)
29
FAIL DOMMatrixReadOnly transformPoint matrix[method] is not a function. (In 'matrix[method]()', 'matrix[method]' is undefined)
30
FAIL DOMMatrixReadOnly toFloat32Array matrix[method] is not a function. (In 'matrix[method]()', 'matrix[method]' is undefined)
30
PASS DOMMatrixReadOnly toFloat32Array 
31
FAIL DOMMatrixReadOnly toFloat64Array matrix[method] is not a function. (In 'matrix[method]()', 'matrix[method]' is undefined)
31
PASS DOMMatrixReadOnly toFloat64Array 
32
32

Return to Bug 172898