Index: third_party/WebKit/LayoutTests/svg/text/text-bbox-empty.html |
diff --git a/third_party/WebKit/LayoutTests/svg/text/text-bbox-empty.html b/third_party/WebKit/LayoutTests/svg/text/text-bbox-empty.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6cdd9ba7eff1f5b2838651729c2d5880204b4df4 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/svg/text/text-bbox-empty.html |
@@ -0,0 +1,20 @@ |
+<!DOCTYPE html> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<svg height="0" font-size="100"> |
+ <svg id="container1"> |
+ <rect x="200" y="300" width="100" height="400"/> |
+ <g id="container2"> |
+ <text transform="translate(1000, 1000)"></text> |
+ </g> |
+ <text> </text> |
+ </svg> |
+</svg> |
+<script> |
+test(function() { |
+ var bbox = document.querySelector('#container1').getBBox(); |
+ assert_array_equals([bbox.x, bbox.y, bbox.width, bbox.height], [200, 300, 100, 400]); |
+ var bbox = document.querySelector('#container2').getBBox(); |
+ assert_array_equals([bbox.x, bbox.y, bbox.width, bbox.height], [0, 0, 0, 0]); |
+}, 'Empty <text> does not contribute to ancestor bounding boxes.'); |
+</script> |