Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / custom / svg-image-container-size.html
blob772220b72a86a98474a383158c4baf1245fa9687
1 <!DOCTYPE html>
2 <script src=../../resources/run-after-layout-and-paint.js></script>
3 <script>
4 if (window.testRunner)
5 testRunner.waitUntilDone();
7 function insertSVGImage() {
8 var image = document.createElementNS('http://www.w3.org/2000/svg', 'image');
9 image.setAttribute('width', 192);
10 image.setAttribute('height', 64);
11 image.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', 'resources/rgb.svg');
12 image.onload = function() {
13 runAfterLayoutAndPaint(function() {
14 if (window.testRunner)
15 testRunner.notifyDone();
16 });
18 document.querySelector('g').appendChild(image);
21 function startTest() {
22 if (window.testRunner)
23 testRunner.layoutAndPaintAsyncThen(insertSVGImage);
24 else
25 requestAnimationFrame(insertSVGImage);
27 </script>
28 <svg width="384" height="128" style="display: block">
29 <g transform="scale(2)"></g>
30 </svg>
31 <div>
32 <img src="resources/rgb.svg" onload="startTest()" style="width: 384px; height: 128px;">
33 </div>