summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-transforms/css-transforms-transformlist.html
blob: a4620f59e6e69764113a8f2dd3af80f6b8486916 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html>
<html>
<!-- Submitted from TestTWF Paris -->
<head>
    <title>CSS Test: SVG transform in baseVal list</title>
    <link rel="author" title="Rik Cabanier" href="mailto:cabanier@adobe.com">
    <link rel="help" href="http://www.w3.org/TR/css-transforms-1/#transform-attribute-dom">
    <link rel="match" href="reference/css-transforms-transformlist-ref.html">
    <meta name="assert" content="This test verifies that the CSS transform does not end up in the list of SVG transforms">
    <style type="text/css">

       #rect {
		   fill: green;
		   transform: translate(10px, 10px);
	   }

	   #result {
		   width:100px;
		   height:100px;
		   background-color: red;
	   }

    </style>
    <script>
	window.addEventListener('load', function(){
		var r = document.getElementById("rect");
		var result = document.getElementById("result");
		if (r.transform.baseVal.length == 0)
			result.style.backgroundColor = "green";

		document.getElementById("svgelement").style.display="none";
	}, false);
	</script>
</head>
<body>
    <p>The test passes if there is a green square and no red.</p>
    <svg id="svgelement">
		<rect id="rect" style="transform: translate(20px, 20px)" width="100" height="100"></rect>
	</svg>
    <div id="result"></div>
</body>
</html>