Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / transforms / transform-origin-css-property.xhtml
blob8fdf30a67ff9e3f5e5a445fe9268cfc23636872e
1 <html xmlns="http://www.w3.org/1999/xhtml">
2 <style>
3 #svgRoot {
4 position: absolute;
5 top: 0;
6 left: 0;
7 width: 100%;
8 height: 100%;
11 #transformOriginRect {
12 fill: green;
13 transform: rotate(90deg);
15 </style>
17 <!--
18 Test for bug 79068 - SVG should support transform-origin and relative values.
20 You should see 9 green 20x20 rectangles. Each green rectangle is actually one of a set of about 6, each one
21 with a different but equivalent value for the CSS transform-origin property.
22 -->
24 <body>
25 <svg id="svgRoot" xmlns="http://www.w3.org/2000/svg"></svg>
27 <script><![CDATA[
28 var svgNS = "http://www.w3.org/2000/svg";
30 function addTransformOriginRect(x, y, s)
32 var rect = document.createElementNS(svgNS, "rect");
33 var transformOrigin = (typeof(s) == "string") ? s : (x + s[0]) + " " + (y + s[1]);
34 rect.setAttribute("id", "transformOriginRect");
35 rect.setAttribute("x", x);
36 rect.setAttribute("y", y);
37 rect.setAttribute("width", 30);
38 rect.setAttribute("height", 30);
39 rect.setAttribute("style", "-webkit-transform-origin: " + transformOrigin + ";");
40 document.getElementById("svgRoot").appendChild(rect);
43 var equivalentTransformOrigins = [
44 ["50% 50%", "center 50%", "50% center", "center", "center center", [15, 15]],
45 ["0% 0%", "left 0%", "0% top", "left top", "top left", [0, 0]],
46 ["0% 50%", "left 50%", "0% center", "left", "left center", "center left", [0, 15]],
47 ["100% 0%", "right 0%", "100% top", "right top", "top right", [30, 0]],
48 ["0% 50%", "left 50%", "0% center", "left center", "center left", [0, 15]],
49 ["100% 50%", "right 50%", "100% center", "right center", "center right", [30, 15]],
50 ["0% 100%", "left 100%", "0% bottom", "left bottom", "left bottom", [0, 30]],
51 ["50% 100%", "center 100%", "50% bottom", "bottom", "center bottom", "bottom center", [15, 30]],
52 ["100% 100%", "right 100%", "100% bottom", "right bottom", "bottom right", [30, 30]]
55 for (var i = 0; i < equivalentTransformOrigins.length; i++) {
56 var x = 60 + (i % 4) * 60;
57 var y = 60 + Math.floor(i / 4) * 60;
58 equivalentTransformOrigins[i].map( function(s) { addTransformOriginRect(x, y, s); } );
61 ]]></script>
62 </body>
63 </html>