Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / custom / getscreenctm-in-mixed-content2.xhtml
blob8d029ef5166d01467abdd162fda0cd2ad0d58233
1 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <title>Scalable Search Box</title>
6 <script>
7 <![CDATA[
9 var testMatrix;
10 var expectedMatrix = {
11 a: 1,
12 b: 0,
13 c: 0,
14 d: 1,
15 e: 350,
16 f: 56
19 function runTest () {
20 if (window.testRunner)
21 testRunner.dumpAsText();
23 var rect = document.getElementById('rect');
24 try {
25 testMatrix = rect.getScreenCTM();
27 // end script here
28 catch (error) {
29 log('.getScreenCTM() seems to be unimplemented');
30 return;
32 // check equality of matrices
33 if (areMatricesEqual(testMatrix, expectedMatrix)) {
34 log('PASSED');
36 // explain error
37 else {
38 log('Expected matrix ' + printMatrix(expectedMatrix));
39 log('Got matrix ' + printMatrix(testMatrix));
43 function areMatricesEqual (m1, m2) {
44 return (
45 m1.a == m2.a &&
46 m1.b == m2.b &&
47 m1.c == m2.c &&
48 m1.d == m2.d &&
49 m1.e == m2.e &&
50 m1.f == m2.f
54 function printMatrix (m) {
55 return '[' + [m.a, m.b, m.c, m.d, m.e, m.f].join(', ') + ']';
58 function log(msg) {
59 var output = document.getElementById('console')
60 var text = document.createTextNode(msg);
61 var br = document.createElementNS('http://www.w3.org/1999/xhtml', 'br');
62 output.appendChild(text);
63 output.appendChild(br);
66 ]]>
67 </script>
68 </head>
70 <body onload="runTest()">
71 <div style="height: 200px;">
72 <table width="100%" height="100%" padding="100" style="text-align:center">
73 <tr><td>
74 <svg id="svgRoot" xmlns="http://www.w3.org/2000/svg" width="100" height="100">
75 <rect id="rect" width="100%" height="100%" />
76 </svg>
77 </td></tr>
78 </table>
79 </div>
80 <div id="console" style="position: absolute; left: 30px; top: 330px; color: red" />
81 This tests the behaviour of <code>SVGLocatable::getScreenCTM()</code> in mixed content <br />
82 </body>
84 </html>