Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Unified Diff: LayoutTests/svg/custom/getBBox-ellipse-has-one-zero-value.html

Issue 208323007: Fix getBBox() returning (0,0) bug when width or height is zero (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@myzbackup
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/svg/custom/getBBox-ellipse-has-one-zero-value.html
diff --git a/LayoutTests/svg/custom/getBBox-ellipse-has-one-zero-value.html b/LayoutTests/svg/custom/getBBox-ellipse-has-one-zero-value.html
new file mode 100644
index 0000000000000000000000000000000000000000..966817473578f670e191f525fe4bfa35a45e4380
--- /dev/null
+++ b/LayoutTests/svg/custom/getBBox-ellipse-has-one-zero-value.html
@@ -0,0 +1,39 @@
+<!DOCTYPE HTML>
+<html>
+<!-- Test that svg bounding boxes are valid for a zero-width or zero-height ellipse -->
+ <head>
+ <script type="text/javascript">
+ function checkBoundingBoxHasZeroValue() {
+ if (window.testRunner)
+ window.testRunner.dumpAsText();
+ var ellipse1 = document.getElementById('ellipse1').getBBox();
+ var ellipse2 = document.getElementById('ellipse2').getBBox();
+ var ellipse3 = document.getElementById('ellipse3').getBBox();
+ var ellipse4 = document.getElementById('ellipse4').getBBox();
+ var results = "FAIL";
+ if (ellipse1.height == 100 &&
+ ellipse1.width == 0 &&
+ ellipse2.height == 0 &&
+ ellipse2.width == 100 &&
+ ellipse3.height == 100 &&
+ ellipse3.width == 0 &&
+ ellipse4.height == 0 &&
+ ellipse4.width == 100)
+ results = "PASS";
+ document.body.innerHTML = results + ", bounding boxes sizes are (" +
+ ellipse1.width + ", " + ellipse1.height + "), (" +
+ ellipse2.width + ", " + ellipse2.height + "), (" +
+ ellipse3.width + ", " + ellipse3.height + ") and (" +
+ ellipse4.width + ", " + ellipse4.height + ")";
+ }
+ </script>
+ </head>
+ <body onload="checkBoundingBoxHasZeroValue()">
+ <svg>
+ <ellipse id="ellipse1" cx="50" cy="100" rx="0" ry="50"/>
+ <ellipse id="ellipse2" cx="50" cy="100" rx="50" ry="0"/>
+ <ellipse id="ellipse3" vector-effect="non-scaling-stroke" cx="50" cy="100" rx="0" ry="50"/>
+ <ellipse id="ellipse4" vector-effect="non-scaling-stroke" cx="50" cy="100" rx="50" ry="0"/>
+ </svg>
+ <body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698