1 <html xmlns=
"http://www.w3.org/1999/xhtml">
4 <title>Scalable Search Box
</title>
10 var expectedMatrix
= {
21 var rect
= document
.getElementById('rect');
23 testMatrix
= rect
.getScreenCTM();
27 logError('.getScreenCTM() seems to be unimplemented');
30 // check equality of matrices
31 if (areMatricesEqual(testMatrix
, expectedMatrix
)) {
32 rect
.setAttributeNS(null, 'fill', 'green');
36 logError('Expected matrix ' + printMatrix(expectedMatrix
));
37 logError('Got matrix ' + printMatrix(testMatrix
));
41 function areMatricesEqual (m1
, m2
) {
52 function printMatrix (m
) {
53 return '[' + [m
.a
, m
.b
, m
.c
, m
.d
, m
.e
, m
.f
].join(', ') + ']';
56 function logError (msg
) {
57 var output
= document
.getElementById('error')
58 var text
= document
.createTextNode(msg
);
59 var br
= document
.createElementNS('http://www.w3.org/1999/xhtml', 'br');
60 output
.appendChild(text
);
61 output
.appendChild(br
);
68 <body onload=
"runTest()">
69 <div style=
"position: absolute; left: 30px; top: 100px; width: 400px; height: 200px;">
70 <svg id=
"svgRoot" xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 200 100" preserveAspectRatio=
"xMinYMin meet">
71 <rect id=
"rect" width=
"100%" height=
"100%" fill=
"red" />
74 <div id=
"error" style=
"position: absolute; left: 30px; top: 330px; color: red" />
75 This tests the behaviour of
<code>SVGLocatable::getScreenCTM()
</code> in mixed content
<br />
76 If the test passes you should see a green rectangle.