Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / custom / getBBox-ellipse-has-one-zero-value.html
blob883471f4bd8489709ebc2976d3c3ec957643c066
1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <title>SVG bounding boxes are valid for a zero-rx or zero-ry ellipse</title>
5 <svg height="0">
6 <ellipse cx="50" cy="100" rx="0" ry="50"/>
7 <ellipse cx="50" cy="100" rx="50" ry="0"/>
8 <ellipse vector-effect="non-scaling-stroke" cx="50" cy="100" rx="0" ry="50"/>
9 <ellipse vector-effect="non-scaling-stroke" cx="50" cy="100" rx="50" ry="0"/>
10 </svg>
11 <script>
12 BBox = function(x,y,w,h) {
13 this.x = x;
14 this.y = y;
15 this.width = w;
16 this.height = h;
18 BBox.prototype.toString = function() {
19 return this.x + "," + this.y + "," + this.width + "," + this.height;
21 // The order of expected sizes should equal the document order of the rects.
22 var expectedBoxes = [
23 new BBox(50, 50, 0, 100),
24 new BBox(0, 100, 100, 0),
25 new BBox(50, 50, 0, 100),
26 new BBox(0, 100, 100, 0),
28 var ellipses = document.getElementsByTagName('ellipse');
29 for (var i = 0, length = ellipses.length; i < length; ++i) {
30 var ellipseBBox = ellipses[i].getBBox();
31 test(function() {
32 assert_equals(ellipseBBox.x, expectedBoxes[i].x);
33 assert_equals(ellipseBBox.y, expectedBoxes[i].y);
34 assert_equals(ellipseBBox.width, expectedBoxes[i].width);
35 assert_equals(ellipseBBox.height, expectedBoxes[i].height);
36 }, 'Bounding box size ' + expectedBoxes[i]);
38 </script>