SVG getBBox does not update bound after path data change
authorfmalita@chromium.org <fmalita@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Jul 2012 20:44:40 +0000 (20:44 +0000)
committerfmalita@chromium.org <fmalita@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Jul 2012 20:44:40 +0000 (20:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=82629

Reviewed by Dirk Schulze.

The bug appears to have been fixed - adding a test for it.

* svg/custom/path-bbox-update-expected.txt: Added.
* svg/custom/path-bbox-update.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122872 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/svg/custom/path-bbox-update-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/path-bbox-update.html [new file with mode: 0644]

index ece19ed..2b36ac9 100644 (file)
@@ -1,3 +1,15 @@
+2012-07-17  Florin Malita  <fmalita@chromium.org>
+
+        SVG getBBox does not update bound after path data change
+        https://bugs.webkit.org/show_bug.cgi?id=82629
+
+        Reviewed by Dirk Schulze.
+
+        The bug appears to have been fixed - adding a test for it.
+
+        * svg/custom/path-bbox-update-expected.txt: Added.
+        * svg/custom/path-bbox-update.html: Added.
+
 2012-07-17  Tony Chang  <tony@chromium.org>
 
         [chromium] Unreviewed gardening. Add baselines after r122861.
diff --git a/LayoutTests/svg/custom/path-bbox-update-expected.txt b/LayoutTests/svg/custom/path-bbox-update-expected.txt
new file mode 100644 (file)
index 0000000..48bc515
--- /dev/null
@@ -0,0 +1,2 @@
+PASS: bounding box is (80, 80, 100, 100)
+
diff --git a/LayoutTests/svg/custom/path-bbox-update.html b/LayoutTests/svg/custom/path-bbox-update.html
new file mode 100644 (file)
index 0000000..93f65e2
--- /dev/null
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+  <!-- Test for https://bugs.webkit.org/show_bug.cgi?id=82629 -->
+  <head>
+    <script>
+      if (window.testRunner) {
+        testRunner.dumpAsText();
+        testRunner.waitUntilDone();
+      }
+
+      function runTest() {
+        var path = document.getElementById('path');
+        path.setAttribute('d', "M80 80L100 100");
+
+        // The bounding box should be updated.
+        var box = path.getBBox();
+        var pass = (box.x == 80) && (box.y == 80) && (box.width == 20) && (box.height == 20);
+        document.getElementById('output').innerHTML = (pass ? 'PASS' : 'FAIL') + ': bounding box is ('
+          + box.x + ', ' + box.y + ', ' + (box.x + box.width) + ', ' + (box.y + box.height) + ')';
+
+        if (window.testRunner)
+          testRunner.notifyDone();
+      }
+    </script>
+  </head>
+  <body>
+    <div id="output"></div>
+    <svg xmlns="http://www.w3.org/2000/svg" onload="runTest()">
+      <path id="path" d="M30 30 L50 50" stroke-width="3" stroke="green"></path>
+    </svg>
+  </body>
+</html>
+