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

Unified Diff: LayoutTests/svg/custom/getBBox-circle-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-circle-has-one-zero-value.html
diff --git a/LayoutTests/svg/custom/getBBox-circle-has-one-zero-value.html b/LayoutTests/svg/custom/getBBox-circle-has-one-zero-value.html
new file mode 100644
index 0000000000000000000000000000000000000000..4b8401fe2c6d53d5cc74c22e95f096dfa7aa2fbe
--- /dev/null
+++ b/LayoutTests/svg/custom/getBBox-circle-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 circle -->
+ <head>
+ <script type="text/javascript">
+ function checkBoundingBoxHasZeroValue() {
+ if (window.testRunner)
+ window.testRunner.dumpAsText();
+ var circle1 = document.getElementById('circle1').getBBox();
+ var circle2 = document.getElementById('circle2').getBBox();
+ var circle3 = document.getElementById('circle3').getBBox();
+ var circle4 = document.getElementById('circle4').getBBox();
+ var results = "FAIL";
+ if (circle1.width == 100 &&
+ circle1.height == 100 &&
+ circle2.width == 0 &&
+ circle2.height == 0 &&
+ circle3.width == 100 &&
+ circle3.height == 100 &&
+ circle4.width == 0 &&
+ circle4.height == 0)
+ results = "PASS";
+ document.body.innerHTML = results + ", bounding boxes sizes are (" +
+ circle1.width + ", " + circle1.height + "), (" +
+ circle2.width + ", " + circle2.height + "), (" +
+ circle3.width + ", " + circle3.height + ") and (" +
+ circle4.width + ", " + circle4.height + ")";
+ }
+ </script>
+ </head>
+ <body onload="checkBoundingBoxHasZeroValue()">
+ <svg>
+ <circle id="circle1" cx="300" cy="300" r="50"/>
+ <circle id="circle2" cx="300" cy="300" r="0"/>
+ <circle id="circle3" vector-effect="non-scaling-stroke" cx="300" cy="300" r="50"/>
+ <circle id="circle4" vector-effect="non-scaling-stroke" cx="300" cy="300" r="0"/>
+ </svg>
+ <body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698