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