OLD | NEW |
1 <html xmlns="http://www.w3.org/1999/xhtml"> | 1 <html xmlns="http://www.w3.org/1999/xhtml"> |
2 <head> | 2 <head> |
3 <script>window.enablePixelTesting = true;</script> | 3 <script>window.enablePixelTesting = true;</script> |
4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
5 <script src="../../fast/repaint/resources/text-based-repaint.js"></script> | 5 <script src="../../fast/repaint/resources/text-based-repaint.js"></script> |
6 <script type="text/javascript"> | 6 <script type="text/javascript"> |
| 7 window.outputRepaintRects = false; |
7 function repaintTest() { | 8 function repaintTest() { |
8 window.jsTestIsAsync = true; | 9 window.jsTestIsAsync = true; |
9 if (window.testRunner) | 10 if (window.testRunner) |
10 testRunner.waitUntilDone(); | 11 testRunner.waitUntilDone(); |
11 | 12 |
12 path = document.getElementById("path"); | 13 path = document.getElementById("path"); |
13 shouldBe("path.pathSegList.numberOfItems", "3"); | 14 shouldBe("path.pathSegList.numberOfItems", "3"); |
14 | 15 |
15 // Check initial 'd' attribute value. | 16 // Check initial 'd' attribute value. |
16 shouldBeEqualToString("path.getAttribute('d').formatDAttribute()", "M 20
0 0 L 100 0 L 100 100"); | 17 shouldBeEqualToString("path.getAttribute('d').formatDAttribute()", "M 20
0 0 L 100 0 L 100 100"); |
(...skipping 29 matching lines...) Expand all Loading... |
46 String.prototype.formatDAttribute = function() { | 47 String.prototype.formatDAttribute = function() { |
47 return this.replace(/,/g, " ") // Remove Firefox commas | 48 return this.replace(/,/g, " ") // Remove Firefox commas |
48 .replace(/([A-Z])/g, " $1 ") // "M 100 0L 50 0" -> " M 100 0
L 50 0" | 49 .replace(/([A-Z])/g, " $1 ") // "M 100 0L 50 0" -> " M 100 0
L 50 0" |
49 .replace(/^\s/, "") // " M 100 0" -> "M 100 0" | 50 .replace(/^\s/, "") // " M 100 0" -> "M 100 0" |
50 .replace(/\s\s/g, " "); // If there was already whitespa
ce between coordinates & commands, fix it up again. | 51 .replace(/\s\s/g, " "); // If there was already whitespa
ce between coordinates & commands, fix it up again. |
51 } | 52 } |
52 ]]> | 53 ]]> |
53 </script> | 54 </script> |
54 </body> | 55 </body> |
55 </html> | 56 </html> |
OLD | NEW |