OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script> | 4 <script> |
5 window.onload = function() { | 5 window.onload = function() { |
6 var elem = document.getElementById("shape-inside"); | 6 var elem = document.getElementById("shape-inside"); |
7 elem.setAttribute("style", "shape-inside: rectangle(10px, 10px, 180px, 1
80px);"); | 7 elem.setAttribute("style", "shape-inside: polygon(10px 10px, 190px 10px,
190px 190px, 10px 190px);"); |
8 }; | 8 }; |
9 </script> | 9 </script> |
10 <style> | 10 <style> |
11 #shape-inside { | 11 #shape-inside { |
12 width: 200px; | 12 width: 200px; |
13 height: 200px; | 13 height: 200px; |
14 position: relative; | 14 position: relative; |
15 } | 15 } |
16 #border { | 16 #border { |
17 position: absolute; | 17 position: absolute; |
18 top: 8px; | 18 top: 8px; |
19 left: 8px; | 19 left: 8px; |
20 width: 180px; | 20 width: 180px; |
21 height: 180px; | 21 height: 180px; |
22 border: 2px solid blue; | 22 border: 2px solid blue; |
23 } | 23 } |
24 </style> | 24 </style> |
25 </head> | 25 </head> |
26 <body> | 26 <body> |
27 <div id="shape-inside"> | 27 <div id="shape-inside"> |
28 <div id="border"></div> | 28 <div id="border"></div> |
29 This text should be contained by the blue square. | 29 This text should be contained by the blue square. |
30 </div> | 30 </div> |
31 Test that setting a shape through javascript causes layout using the new sha
pe. | 31 Test that setting a shape through javascript causes layout using the new sha
pe. |
32 </body> | 32 </body> |
33 </html> | 33 </html> |
OLD | NEW |