Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: LayoutTests/fast/svg/getScreenCTM.html

Issue 464823003: [svg] getScreenCTM reporting incorrect transformation matrix. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Source/core/svg/SVGSVGElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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;
12 }
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(' ');
29 }
30
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");
35
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");
40
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");
45
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");
50
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");
55
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");
60
61 </script>
OLDNEW
« no previous file with comments | « no previous file | Source/core/svg/SVGSVGElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698