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 values = [{actual:"0px", expected:"0px"}, {actual:"0.9px", expected:"1px"}, {actual:"1px", expected:"1px"}, {actual:"0.2px", expected:"1px"}, {actual:"0.9pt ", expected:"1px"}, {actual:"1pt", expected:"1px"}, {actual:"0.2pt", expected:"1 px"}, {actual:"1.9pt", expected:"2px"}, {actual:"1pt", expected:"1px"}, {actual: "1.2pt", expected:"1px"}, {actual:"2.1px", expected:"2px"}, {actual:"2.9px", exp ected:"2px"}]; | |
|
nainar
2015/10/29 03:59:40
actual -> input
Each entry on a new line
| |
| 10 | |
| 11 for (var value of values) { | |
| 12 var div = document.createElement("div"); | |
| 13 div.style = "outline: solid " + value.actual + " red; margin-bottom: 20px; dis play: none;"; | |
| 14 document.body.appendChild(div); | |
| 15 div.textContent = "Div with outline of " + value + " computes to " + getCompu tedStyle(div).outlineWidth; | |
|
nainar
2015/10/29 03:59:40
remove text and display: none
| |
| 16 } | |
| 17 | |
| 18 test(function() { | |
| 19 var targets = document.querySelectorAll("div"); | |
| 20 for (var i=0; i < targets.length; i++) { | |
| 21 assert_equals(getComputedStyle(targets[i]).outlineWidth, values[i].expected) ; | |
| 22 } | |
| 23 }, "Test that chrome rounds up all borders/outlines when they are less than 1px but greater than 0px but floors all other borders."); | |
| 24 | |
| 25 </script> | |
| OLD | NEW |