OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <title>SVG in <object> with zero intrinsic size</title> |
3 <style> | 3 <script src=../../resources/testharness.js></script> |
4 object { | 4 <script src=../../resources/testharnessreport.js></script> |
5 background: red; | 5 <object data-expected="0x0" data="data:image/svg+xml, |
6 } | |
7 </style> | |
8 <body style="margin: 0px; padding: 0px;"> | |
9 <!--There should not be any red rectangle visible. --> | |
10 <object data="data:image/svg+xml, | |
11 <svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/
xlink' width='0' height='0'> | 6 <svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/
xlink' width='0' height='0'> |
12 <rect width='50' height='50' fill='red'/> | 7 <rect width='50' height='50' fill='red'/> |
13 </svg> | 8 </svg>"></object> |
14 "></object> | 9 <object data-expected="50x0" data="data:image/svg+xml, |
15 <object data="data:image/svg+xml, | |
16 <svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/
xlink' width='50' height='0'> | 10 <svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/
xlink' width='50' height='0'> |
17 <rect width='50' height='50' fill='red'/> | 11 <rect width='50' height='50' fill='red'/> |
18 </svg> | 12 </svg>"></object> |
19 "></object> | 13 <object data-expected="0x50" data="data:image/svg+xml, |
20 <object data="data:image/svg+xml, | |
21 <svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/
xlink' width='0' height='50'> | 14 <svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/
xlink' width='0' height='50'> |
22 <rect width='50' height='50' fill='red'/> | 15 <rect width='50' height='50' fill='red'/> |
23 </svg> | 16 </svg>"></object> |
24 "></object> | 17 <object data-expected="0x150" data="data:image/svg+xml, |
25 <object data="data:image/svg+xml, | |
26 <svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/
xlink' width='0'> | 18 <svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/
xlink' width='0'> |
27 <rect width='50' height='50' fill='red'/> | 19 <rect width='50' height='50' fill='red'/> |
28 </svg> | 20 </svg>"></object> |
29 "></object> | 21 <object data-expected="300x0" data="data:image/svg+xml, |
30 <object data="data:image/svg+xml, | |
31 <svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/
xlink' height='0'> | 22 <svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/
xlink' height='0'> |
32 <rect width='50' height='50' fill='red'/> | 23 <rect width='50' height='50' fill='red'/> |
33 </svg> | 24 </svg>"></object> |
34 "></object> | 25 <script> |
35 </body> | 26 Array.prototype.forEach.call(document.querySelectorAll('object'), function(eleme
nt) { |
36 </html> | 27 var t = async_test(document.title + " - " + element.dataset.expected); |
| 28 element.onload = function() { |
| 29 requestAnimationFrame(t.step_func(function() { |
| 30 var clientRect = element.getBoundingClientRect(); |
| 31 assert_equals(clientRect.width + "x" + clientRect.height, element.da
taset.expected); |
| 32 t.done(); |
| 33 })); |
| 34 } |
| 35 }); |
| 36 </script> |
OLD | NEW |