Index: LayoutTests/svg/custom/getBBox-polyline-nodata.html |
diff --git a/LayoutTests/svg/custom/getBBox-polyline-nodata.html b/LayoutTests/svg/custom/getBBox-polyline-nodata.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0a3b1a4385f22098af40c3de96af989ab36339c3 |
--- /dev/null |
+++ b/LayoutTests/svg/custom/getBBox-polyline-nodata.html |
@@ -0,0 +1,53 @@ |
+<!DOCTYPE html> |
+<html> |
+ <script> |
+ function check_rect_bbox(bbox, expected_bbox, test_name) |
+ { |
+ var result = true; |
+ var result_str = ""; |
+ |
+ if (bbox.x == expected_bbox.x && bbox.y == expected_bbox.y && bbox.width == expected_bbox.width && bbox.height == expected_bbox.height) { |
+ result_str = "Passed"; |
+ } else { |
+ result_str += test_name + ": Failed"; |
+ result_str += "("+bbox.x+","+bbox.y+":"+bbox.width + "," + bbox.height+")"; |
+ result = false; |
+ } |
+ |
+ var p_result = document.querySelector("#result"); |
+ p_result.appendChild(document.createTextNode(result_str + "; ")); |
+ return result; |
+ } |
+ |
+ function run() |
+ { |
+ if (window.testRunner) |
+ testRunner.dumpAsText(); |
+ |
+ var p_bbox = document.querySelector("#p1").getBBox(); |
+ var g_bbox = document.querySelector("g").getBBox(); |
+ |
+ var result = true; |
+ |
+ result &= check_rect_bbox(p_bbox, {"x":0, "y":0, "width":0, "height":0}, "getBBox on polyline with no points attribute") |
Erik Dahlström (inactive)
2014/06/25 14:57:42
BUG: no polyline here, probably c&p error in the o
|
+ result &= check_rect_bbox(g_bbox, document.querySelector("#r1").getBBox(),"polyline doesn't contribute to parent bbox") |
+ |
+ if (!result) { |
+ var visible_rect = document.querySelector("#r1"); |
+ visible_rect.setAttribute("fill", "red"); |
+ } |
+ } |
+ </script> |
+ |
+<body onload="run()"> |
+<p>Bug <a href="https://bugs.webkit.org/show_bug.cgi?id=134184">134184</a>: getBBox on polyline with no points attribute should return (0,0,0,0) and should not contribute to parent bbox</p> |
+<p>For this test to pass, you should see 'Passed' twice below.</a> |
+<p id="result"></p> |
+<svg xmlns="http://www.w3.org/2000/svg"> |
+<g> |
+ <path id="p1" fill="none" stroke="red" /> |
+ <rect id="r1" x="50" y="50" width="50" height="50" fill="green" /> |
+</g> |
+</svg> |
+</body> |
+</html> |