Bug 1294966 - Part 3. Add test cases for get bbox of svg elements with empty size. draft
authorcku <cku@mozilla.com>
Wed, 06 Sep 2017 20:04:22 +0800
changeset 660003 2d3f1c29389a543b95778b2d5e81c63ac4dd0f10
parent 660002 b1c7a279ad5a27bab34127e993d947aab7260944
child 660004 25e6a4487fc793047cb04d306e8fcaf963ef6dd6
push id78273
push userbmo:cku@mozilla.com
push dateWed, 06 Sep 2017 14:43:42 +0000
bugs1294966
milestone57.0a1
Bug 1294966 - Part 3. Add test cases for get bbox of svg elements with empty size. MozReview-Commit-ID: 8nkVjMsWG4j
dom/svg/test/bbox-helper.svg
dom/svg/test/test_bbox.xhtml
--- a/dom/svg/test/bbox-helper.svg
+++ b/dom/svg/test/bbox-helper.svg
@@ -33,9 +33,13 @@
     <circle cx="100" cy="100" r="5"/>
     <g/>
     <circle cx="100" cy="100" r="5"/>
     <g/>
   </g>
   <use x="100" y="100" id="use_v" href="#v"/>
   <use x="100" y="100" id="use_h" href="#h"/>
   <use x="100" y="100" id="use_e" href="#e"/>
+  <circle id="empty_circle_1" cx="50" cy="30" r="0"/>
+  <circle id="empty_circle_2" cx="50" cy="30" r="0" stroke-width="10"/>
+  <rect id="empty_rect_1" x="40" y="20" width="0" height="10"/>
+  <rect id="empty_rect_2" x="40" y="20" width="0" height="10" stroke-width="10"/>
 </svg>
--- a/dom/svg/test/test_bbox.xhtml
+++ b/dom/svg/test/test_bbox.xhtml
@@ -60,16 +60,20 @@ function run()
   compareBBox("b", "tspan");
   compareBBoxHeight("text", "lrmText");
   checkBBox("v", 95, 45, 10, 155, 0.001);
   checkBBox("h", 195, 45, 105, 55, 0.001);
   checkBBox("e", 95, 95, 10, 10, 0.001);
   checkBBox("use_v", 195, 145, 10, 155, 0.001);
   checkBBox("use_h", 295, 145, 105, 55, 0.001);
   checkBBox("use_e", 195, 195, 10, 10, 0.001);
+  checkBBox("empty_circle_1", 50, 30, 0, 0, 0.0);
+  checkBBox("empty_circle_2", 50, 30, 0, 0, 0.0);
+  checkBBox("empty_rect_1", 40, 20, 0, 10, 0.0);
+  checkBBox("empty_rect_2", 40, 20, 0, 10, 0.0);
   SimpleTest.finish();
 }
 
 window.addEventListener("load", run);
 
 //]]></script>
 </pre>
 </body>