shape-image-threshold-003.html (2443B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>Shape Image Threshold Inherit</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="help" href="http://www.w3.org/TR/css-shapes-1/#shape-image-threshold-property"> 8 <meta name="assert" content="shape-outside can be assigned the 'inherit' value and does not inherit by default."> 9 <meta name="flags" content="ahem dom"> 10 <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1"> 11 <script src="/resources/testharness.js"></script> 12 <script src="/resources/testharnessreport.js"></script> 13 <script src="support/parsing-utils.js"></script> 14 </head> 15 <body> 16 <div id="log"></div> 17 <script type="text/javascript"> 18 function setUpTest(parentValue, childValue) { 19 var outer = document.createElement("div"); 20 var inner = document.createElement("div"); 21 outer.appendChild(inner); 22 23 outer.style.setProperty("shape-outside", "content-box"); 24 outer.style.setProperty("shape-image-threshold", parentValue); 25 inner.style.setProperty("shape-outside", "circle()"); 26 inner.style.setProperty("shape-image-threshold", childValue); 27 28 document.body.appendChild(outer); 29 30 var inline = inner.style.getPropertyValue("shape-image-threshold"); 31 var style = getComputedStyle(inner); 32 var computed = style.getPropertyValue("shape-image-threshold"); 33 document.body.removeChild(outer); 34 35 return [inline, computed]; 36 } 37 38 test(function() { 39 var results = setUpTest("0.5", "inherit"); 40 assert_equals(results[0], "inherit"); 41 assert_equals(results[1], "0.5"); 42 }, "shape-image-threshold can be assigned 'inherit' value"); 43 44 test(function() { 45 var results = setUpTest("0.3", null); 46 assert_equals(results[0], ""); 47 assert_equals(results[1], "0"); 48 }, "shape-image-threshold is not inherited and defaults to 0"); 49 50 test(function() { 51 var results = setUpTest("0.2", "0.5"); 52 assert_equals(results[0], "0.5"); 53 assert_equals(results[1], "0.5"); 54 }, "shape-margin is not inherited"); 55 </script> 56 </body> 57 </html>