955aee6bb28bec7437047df1c5119268a7e23741
[WebKit-https.git] / LayoutTests / fast / shapes / css-shapes-disabled.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../js/resources/js-test-pre.js"></script>
5 <script>
6
7 description('Test that parsing of css shapes related properties can be disabled.');
8
9 if (window.internals)
10     window.internals.settings.setCSSShapesEnabled(false);
11
12 function testInlineStyle(property, value) {
13     var div = document.createElement("div");
14     div.setAttribute("style", property + ": " + value);
15     return div.style.getPropertyValue(property);
16 }
17
18 function testComputedStyle(property, value) {
19     var div = document.createElement("div");
20     document.body.appendChild(div);
21     div.style.setProperty(property, value);
22     var computedValue = getComputedStyle(div).getPropertyValue(property);
23     document.body.removeChild(div);
24     return computedValue;
25 }
26
27 function testStyle(property, value, computedExpected) {
28     shouldBeNull('testInlineStyle("' + property + '", "' + value + '")');
29     shouldBeEqualToString('testComputedStyle("' + property + '", "' + value + '")', computedExpected);
30 }
31
32 testStyle("-webkit-shape-margin", "10px", "0px");
33 testStyle("-webkit-shape-padding", "10px", "0px");
34
35 testStyle("-webkit-shape-outside", "circle(10px, 10px, 10px)", "auto");
36 testStyle("-webkit-shape-inside", "circle(10px, 10px, 10px)", "outside-shape");
37
38 </script>
39 <script src="../js/resources/js-test-post.js"></script>
40 </body>
41 </html>