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

Unified 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, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/svg/SVGSVGElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/svg/getScreenCTM.html
diff --git a/LayoutTests/fast/svg/getScreenCTM.html b/LayoutTests/fast/svg/getScreenCTM.html
new file mode 100644
index 0000000000000000000000000000000000000000..14095473219bb8b0281b2a397c321b1fabdad46b
--- /dev/null
+++ b/LayoutTests/fast/svg/getScreenCTM.html
@@ -0,0 +1,61 @@
+<!doctype html>
+<title>getScreenCTM tests</title>
+<script src=../../resources/testharness.js></script>
+<script src=../../resources/testharnessreport.js></script>
+<div id="testcontainer">
+<style>
+ svg {
+ visibility: hidden;
+ position: absolute;
+ top:0;
+ left:0;
+ }
+ #a, #c, #d, #e { width: 50px; height: 100px }
+</style>
+<svg id="a" width="100" height="200"/>
+<svg id="b" width="100" height="200"/>
+<svg id="c" width="100" height="200" viewBox="0 0 100 200"/>
+<svg id="d" viewBox="0 0 100 200"/>
+<svg id="e" viewBox="0 0 200 400">
+ <svg id="f" viewBox="0 0 100 200">
+ <g id="g"/>
+ </svg>
+</svg>
+</div>
+<div id=log></div>
+<script>
+function ctmToString(ctm) {
+ return [ ctm.a, ctm.b, ctm.c, ctm.d, ctm.e, ctm.f ].join(' ');
+}
+
+test(function() {
+ var ctm = ctmToString(document.getElementById("a").getScreenCTM());
+ assert_equals(ctm, "1 0 0 1 0 0", "");
+}, "css defined viewport");
+
+test(function() {
+ var ctm = ctmToString(document.getElementById("b").getScreenCTM());
+ assert_equals(ctm, "1 0 0 1 0 0", "");
+}, "svg defined viewport");
+
+test(function() {
+ var ctm = ctmToString(document.getElementById("c").getScreenCTM());
+ assert_equals(ctm, "0.5 0 0 0.5 0 0", "");
+}, "css defined viewport + svg has w, h, viewBox");
+
+test(function() {
+ var ctm = ctmToString(document.getElementById("d").getScreenCTM());
+ assert_equals(ctm, "0.5 0 0 0.5 0 0", "");
+}, "css defined viewport + svg has viewBox");
+
+test(function() {
+ var ctm = ctmToString(document.getElementById("f").getScreenCTM());
+ assert_equals(ctm, "0.5 0 0 0.5 0 0", "");
+}, "nested svg");
+
+test(function() {
+ var ctm = ctmToString(document.getElementById("g").getScreenCTM());
+ assert_equals(ctm, "0.5 0 0 0.5 0 0", "");
+}, "g child of nested svg");
+
+</script>
« 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