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

Side by Side Diff: LayoutTests/svg/custom/getBBox-rect-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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2 <html>
3 <!-- Test that svg bounding boxes are valid for a zero-width or zero-height rect -->
4 <head>
5 <script type="text/javascript">
6 function checkBoundingBoxHasZeroValue() {
7 if (window.testRunner)
8 window.testRunner.dumpAsText();
9 var rectBox1 = document.getElementById('rect1').getBBox();
10 var rectBox2 = document.getElementById('rect2').getBBox();
11 var rectBox3 = document.getElementById('rect3').getBBox();
12 var rectBox4 = document.getElementById('rect4').getBBox();
13 var results = "FAIL";
14 if (rectBox1.height == 100 && rectBox1.width == 0 &&
15 rectBox2.height == 0 && rectBox2.width == 100 &&
16 rectBox3.height == 100 && rectBox3.width == 0 &&
17 rectBox4.height == 0 && rectBox4.width == 100)
18 results = "PASS";
19 document.body.innerHTML = results + ", bounding box sizes are (" +
20 rectBox1.width + ", " + rectBox1.height + "), (" +
21 rectBox2.width + ", " + rectBox2.height + "), (" +
22 rectBox3.width + ", " + rectBox3.height + ") and (" +
23 rectBox4.width + ", " + rectBox4.height + ")";
24 }
25 </script>
26 </head>
27 <body onload="checkBoundingBoxHasZeroValue()">
28 <svg>
29 <rect id="rect1" height="100" width="0"/>
30 </svg>
31 <svg>
32 <rect id="rect2" height="0" width="100"/>
33 </svg>
34 <svg>
35 <rect id="rect3" vector-effect="non-scaling-stroke" height="100" wid th="0"/>
36 </svg>
37 <svg>
38 <rect id="rect4" vector-effect="non-scaling-stroke" height="0" width ="100"/>
39 </svg>
40 <body>
41 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698