Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / svg / getScreenCTM.html
blob14095473219bb8b0281b2a397c321b1fabdad46b
1 <!doctype html>
2 <title>getScreenCTM tests</title>
3 <script src=../../resources/testharness.js></script>
4 <script src=../../resources/testharnessreport.js></script>
5 <div id="testcontainer">
6 <style>
7 svg {
8 visibility: hidden;
9 position: absolute;
10 top:0;
11 left:0;
13 #a, #c, #d, #e { width: 50px; height: 100px }
14 </style>
15 <svg id="a" width="100" height="200"/>
16 <svg id="b" width="100" height="200"/>
17 <svg id="c" width="100" height="200" viewBox="0 0 100 200"/>
18 <svg id="d" viewBox="0 0 100 200"/>
19 <svg id="e" viewBox="0 0 200 400">
20 <svg id="f" viewBox="0 0 100 200">
21 <g id="g"/>
22 </svg>
23 </svg>
24 </div>
25 <div id=log></div>
26 <script>
27 function ctmToString(ctm) {
28 return [ ctm.a, ctm.b, ctm.c, ctm.d, ctm.e, ctm.f ].join(' ');
31 test(function() {
32 var ctm = ctmToString(document.getElementById("a").getScreenCTM());
33 assert_equals(ctm, "1 0 0 1 0 0", "");
34 }, "css defined viewport");
36 test(function() {
37 var ctm = ctmToString(document.getElementById("b").getScreenCTM());
38 assert_equals(ctm, "1 0 0 1 0 0", "");
39 }, "svg defined viewport");
41 test(function() {
42 var ctm = ctmToString(document.getElementById("c").getScreenCTM());
43 assert_equals(ctm, "0.5 0 0 0.5 0 0", "");
44 }, "css defined viewport + svg has w, h, viewBox");
46 test(function() {
47 var ctm = ctmToString(document.getElementById("d").getScreenCTM());
48 assert_equals(ctm, "0.5 0 0 0.5 0 0", "");
49 }, "css defined viewport + svg has viewBox");
51 test(function() {
52 var ctm = ctmToString(document.getElementById("f").getScreenCTM());
53 assert_equals(ctm, "0.5 0 0 0.5 0 0", "");
54 }, "nested svg");
56 test(function() {
57 var ctm = ctmToString(document.getElementById("g").getScreenCTM());
58 assert_equals(ctm, "0.5 0 0 0.5 0 0", "");
59 }, "g child of nested svg");
61 </script>