Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src="../../resources/testharness.js"></script> | |
| 3 <script src="../../resources/testharnessreport.js"></script> | |
| 4 | |
| 5 <body> | |
| 6 </body> | |
| 7 | |
| 8 <script> | |
| 9 var actualValues = ["0px", "0.9px", "1px", "0.2px", "0.9pt", "1pt", "0.2pt", "1. 9pt", "1pt", "1.2pt", "2.1px", "2.9px"] | |
| 10 var expectedValues = ["0px", "1px", "1px", "1px", "1px", "1px", "1px", "2px", "1 px", "1px", "2px", "2px"] | |
|
alancutter (OOO until 2018)
2015/10/27 04:10:32
I would make this a dictionary of input: expected
nainar
2015/10/27 05:30:18
Done.
| |
| 11 | |
| 12 for (var value of actualValues) { | |
| 13 var div = document.createElement("div"); | |
| 14 div.style = "outline: solid " + value + " red; margin-bottom: 20px; display: n one;"; | |
| 15 document.body.appendChild(div); | |
| 16 div.textContent = "Div with outline of " + value + " computes to " + getCompu tedStyle(div).outlineWidth; | |
| 17 } | |
| 18 | |
| 19 test(function() { | |
| 20 var targets = document.querySelectorAll("div"); | |
| 21 for (var i=0; i < targets.length; i++) { | |
| 22 assert_equals(getComputedStyle(targets[i]).outlineWidth, expectedValues[i]); | |
| 23 } | |
| 24 }, "Test that chrome rounds up all borders/outlines when they are less than 1px but greater than 0px but floors all other borders."); | |
| 25 | |
| 26 </script> | |
| OLD | NEW |