1 <!DOCTYPE html>
2 <html><head>
3 <title>Shape Outside Polygon args - calc() values</title>
4 <link href="http://html.adobe.com/" rel="author" title="Adobe">
5 <link href="mailto:rhauck@adobe.com" rel="author" title="Rebecca Hauck">
6 <link href="mailto:stearns@adobe.com" rel="reviewer" title="Alan Stearns"> <!-- 2014-03-04 -->
7 <link href="http://www.w3.org/TR/css-shapes-1/#funcdef-polygon" rel="help">
8 <link href="http://www.w3.org/TR/css-shapes-1/#shape-outside-property" rel="help">
9 <link href="http://www.w3.org/TR/css3-values/#calc-notation" rel="help">
10 <meta content="A polygon's arguments may be in calc() values." name="assert">
11 <meta content="dom" name="flags">
12 <script src="/resources/testharness.js"></script>
13 <script src="/resources/testharnessreport.js"></script>
14 <script src="support/parsing-utils.js"></script>
15 </head>
16 <body>
17 <div id="log"></div>
18 <script type="text/javascript">
19 var polygon_calc_tests = [];
20 ParsingUtils.calcTestValues.forEach(function(value) {
21 testCase = ['polygon('+ value[0] +' '+ value[0] +')',
22 'polygon('+ value[1] +' '+ value[1] +')'];
23 if(Object.prototype.toString.call( value[2] ) === '[object Array]' && value[2].length == 2) {
24 testCase.push([
25 'polygon('+ value[2][0] +' '+ value[2][0] +')',
26 'polygon('+ value[2][1] +' '+ value[2][1] +')'
27 ]);
28 } else {
29 testCase.push('polygon('+ value[2] +' '+ value[2] +')');
30 }
31 polygon_calc_tests.push(testCase);
32 });
33 ParsingUtils.calcTestValues.forEach(function(value) {
34 testCase = ['polygon(evenodd, '+ value[0] +' '+ value[0] +', '+ value[0] +' '+ value[0] +')',
35 'polygon(evenodd, '+ value[1] +' '+ value[1] +', '+ value[1] +' '+ value[1] +')'];
36 if(Object.prototype.toString.call( value[2] ) === '[object Array]' && value[2].length == 2) {
37 testCase.push([
38 'polygon(evenodd, '+ value[2][0] +' '+ value[2][0] +', '+ value[2][0] +' '+ value[2][0] +')',
39 'polygon(evenodd, '+ value[2][1] +' '+ value[2][1] +', '+ value[2][1] +' '+ value[2][1] +')'
40 ]);
41 } else {
42 testCase.push('polygon(evenodd, '+ value[2] +' '+ value[2] +', '+ value[2] +' '+ value[2] +')');
43 }
44 polygon_calc_tests.push(testCase);
45 });
46 generate_tests(ParsingUtils.testInlineStyle, ParsingUtils.buildCalcTests(polygon_calc_tests, 'inline'));
47 generate_tests(ParsingUtils.testComputedStyle, ParsingUtils.buildCalcTests(polygon_calc_tests, 'computed'));
48 </script>
49
50
51 </body></html>