| Differences between
and this patch
- WebCore/ChangeLog +13 lines
Lines 1-3 WebCore/ChangeLog_sec1
1
2009-11-04  Jeff Schiller  <codedread@gmail.com>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        Correct order of matrix multiplication for SVGMatrix.
6
        https://bugs.webkit.org/show_bug.cgi?id=16062
7
8
        Test: svg/dom/matrix-multiplication.html
9
10
        * bindings/js/JSSVGMatrixCustom.cpp:
11
        (WebCore::JSSVGMatrix::multiply):
12
        * svg/SVGMatrix.idl:
13
1
2009-11-04  Jeremy Orlow  <jorlow@chromium.org>
14
2009-11-04  Jeremy Orlow  <jorlow@chromium.org>
2
15
3
        Revert 50519 while I work out what went wrong.
16
        Revert 50519 while I work out what went wrong.
- WebCore/bindings/js/JSSVGMatrixCustom.cpp +16 lines
Lines 24-34 WebCore/bindings/js/JSSVGMatrixCustom.cpp_sec1
24
24
25
#include "TransformationMatrix.h"
25
#include "TransformationMatrix.h"
26
#include "SVGException.h"
26
#include "SVGException.h"
27
#include <runtime/Error.h>
27
28
28
using namespace JSC;
29
using namespace JSC;
29
30
30
namespace WebCore {
31
namespace WebCore {
31
32
33
JSValue JSSVGMatrix::multiply(ExecState* exec, const ArgList& args)
34
{
35
    if (!args.at(0).inherits(&JSSVGMatrix::s_info))
36
        return throwError(exec, TypeError, "secondMatrix argument was not a SVGMatrix");
37
38
    JSSVGMatrix* matrixObj = static_cast<JSSVGMatrix*>(asObject(args.at(0)));
39
40
    TransformationMatrix m1(*impl());
41
    TransformationMatrix m2(*(matrixObj->impl()));
42
43
    JSC::JSValue result = toJS(exec, deprecatedGlobalObjectForPrototype(exec), JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(m1.multLeft(m2)).get(), m_context.get());
44
45
    return result;
46
}
47
32
JSValue JSSVGMatrix::inverse(ExecState* exec, const ArgList&)
48
JSValue JSSVGMatrix::inverse(ExecState* exec, const ArgList&)
33
{
49
{
34
    TransformationMatrix imp(*impl());
50
    TransformationMatrix imp(*impl());
- WebCore/svg/SVGMatrix.idl -1 / +1 lines
Lines 34-40 module svg { WebCore/svg/SVGMatrix.idl_sec1
34
        attribute double e;
34
        attribute double e;
35
        attribute double f;
35
        attribute double f;
36
36
37
        [Immutable] SVGMatrix multiply(in SVGMatrix secondMatrix);
37
        [Custom] SVGMatrix multiply(in SVGMatrix secondMatrix);
38
        [Custom] SVGMatrix inverse()
38
        [Custom] SVGMatrix inverse()
39
            raises(SVGException);
39
            raises(SVGException);
40
        [Immutable] SVGMatrix translate(in float x, in float y);
40
        [Immutable] SVGMatrix translate(in float x, in float y);
- LayoutTests/ChangeLog +10 lines
Lines 1-3 LayoutTests/ChangeLog_sec1
1
2009-11-04  Jeff Schiller  <codedread@gmail.com>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        Added test to ensure proper order of matrix multiplication with SVGMatrix.
6
        https://bugs.webkit.org/show_bug.cgi?id=16062
7
8
        * svg/dom/matrix-multiplication-expected.txt: Added.
9
        * svg/dom/matrix-multiplication.html: Added.
10
1
2009-11-04  Csaba Osztrogonác  <ossy@webkit.org>
11
2009-11-04  Csaba Osztrogonác  <ossy@webkit.org>
2
12
3
        Put test into skiplist added in r50489 because
13
        Put test into skiplist added in r50489 because
- LayoutTests/svg/dom/matrix-multiplication-expected.txt +6 lines
Line 0 LayoutTests/svg/dom/matrix-multiplication-expected.txt_sec1
1
This test checks to see if matrix multiplication is performed in the correct order for SVGMatrix objects.
2
3
If the test passes, you should see one line below about the matrix multiplication passing.
4
5
Matrix Multiplication Passed.
6
- LayoutTests/svg/dom/matrix-multiplication.html +35 lines
Line 0 LayoutTests/svg/dom/matrix-multiplication.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script>
5
function print(message)
6
{
7
    var paragraph = document.createElement("li");
8
    paragraph.appendChild(document.createTextNode(message));
9
    document.getElementById("console").appendChild(paragraph);
10
}
11
function test()
12
{
13
    if (window.layoutTestController)
14
        layoutTestController.dumpAsText();
15
16
    var svgroot = document.createElementNS("http://www.w3.org/2000/svg","svg");
17
    var tx = svgroot.createSVGMatrix();
18
    var sx = svgroot.createSVGMatrix();
19
    tx = tx.translate(100,0);
20
    sx = sx.scaleNonUniform(2,1);
21
    var m = tx.multiply(sx);
22
23
    if (m.a == 2 && m.b == 0 && m.c == 0 && m.d == 1 && m.e == 100 && m.f == 0 && sx.a == 2 && sx.b == 0 && sx.c == 0 && sx.d == 1 && sx.e == 0 && sx.f == 0)
24
    	print("Matrix Multiplication Passed.");
25
    else
26
    	print("Matrix Multiplication Failed.");
27
}
28
</script>
29
</head>
30
<body onload="test()">
31
<p>This test checks to see if matrix multiplication is performed in the correct order for SVGMatrix objects.</p>
32
<p>If the test passes, you should see one line below about the matrix multiplication passing.</p>
33
<hr>
34
<p><ol id=console></ol></p>
35
</body>

Return to Bug 16062