Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / custom / path-bbox-update.html
blob93f65e232c3fd6cd62de91ea7af5135d32deeb62
1 <!DOCTYPE html>
2 <html>
3 <!-- Test for https://bugs.webkit.org/show_bug.cgi?id=82629 -->
4 <head>
5 <script>
6 if (window.testRunner) {
7 testRunner.dumpAsText();
8 testRunner.waitUntilDone();
11 function runTest() {
12 var path = document.getElementById('path');
13 path.setAttribute('d', "M80 80L100 100");
15 // The bounding box should be updated.
16 var box = path.getBBox();
17 var pass = (box.x == 80) && (box.y == 80) && (box.width == 20) && (box.height == 20);
18 document.getElementById('output').innerHTML = (pass ? 'PASS' : 'FAIL') + ': bounding box is ('
19 + box.x + ', ' + box.y + ', ' + (box.x + box.width) + ', ' + (box.y + box.height) + ')';
21 if (window.testRunner)
22 testRunner.notifyDone();
24 </script>
25 </head>
26 <body>
27 <div id="output"></div>
28 <svg xmlns="http://www.w3.org/2000/svg" onload="runTest()">
29 <path id="path" d="M30 30 L50 50" stroke-width="3" stroke="green"></path>
30 </svg>
31 </body>
32 </html>