tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

shape-outside-polygon-006.html (3125B)


      1 <!DOCTYPE html>
      2 <html>
      3    <head>
      4        <title>Shape Outside Polygon 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-polygon">
      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="A polygon's arguments may be in calc() values.">
     12        <meta name="flags" content="ahem dom">
     13        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1">
     14        <script src="/resources/testharness.js"></script>
     15        <script src="/resources/testharnessreport.js"></script>
     16        <script src="support/parsing-utils.js"></script>
     17    </head>
     18    <body>
     19        <div id="log"></div>
     20        <script type="text/javascript">
     21            var polygon_calc_tests = [];
     22            ParsingUtils.calcTestValues.forEach(function(value) {
     23                testCase = ['polygon('+ value[0] +' '+ value[0] +')',
     24                            'polygon('+ value[1] +' '+ value[1] +')'];
     25                if(Object.prototype.toString.call( value[2] ) === '[object Array]' && value[2].length == 2) {
     26                    testCase.push([
     27                                    'polygon('+ value[2][0] +' '+ value[2][0] +')',
     28                                    'polygon('+ value[2][1] +' '+ value[2][1] +')'
     29                                 ]);
     30                } else {
     31                    testCase.push('polygon('+ value[2] +' '+ value[2] +')');
     32                }
     33                polygon_calc_tests.push(testCase);
     34            });
     35            ParsingUtils.calcTestValues.forEach(function(value) {
     36                testCase = ['polygon(evenodd, '+ value[0] +' '+ value[0] +', '+ value[0] +' '+ value[0] +')',
     37                            'polygon(evenodd, '+ value[1] +' '+ value[1] +', '+ value[1] +' '+ value[1] +')'];
     38                if(Object.prototype.toString.call( value[2] ) === '[object Array]' && value[2].length == 2) {
     39                    testCase.push([
     40                                    'polygon(evenodd, '+ value[2][0] +' '+ value[2][0] +', '+ value[2][0] +' '+ value[2][0] +')',
     41                                    'polygon(evenodd, '+ value[2][1] +' '+ value[2][1] +', '+ value[2][1] +' '+ value[2][1] +')'
     42                                 ]);
     43                } else {
     44                    testCase.push('polygon(evenodd, '+ value[2] +' '+ value[2] +', '+ value[2] +' '+ value[2] +')');
     45                }
     46                polygon_calc_tests.push(testCase);
     47            });
     48            generate_tests(ParsingUtils.testInlineStyle, ParsingUtils.buildCalcTests(polygon_calc_tests, 'inline'));
     49            generate_tests(ParsingUtils.testComputedStyle, ParsingUtils.buildCalcTests(polygon_calc_tests, 'computed'));
     50        </script>
     51    </body>
     52 </html>