Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/css/round-up-all-line-width-less-than-1-greater-than-0.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/css/round-up-all-line-width-less-than-1-greater-than-0.html b/third_party/WebKit/LayoutTests/fast/css/round-up-all-line-width-less-than-1-greater-than-0.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..49e6d4f0219b2cc5c3e2c105b053d8f0722017d4 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/css/round-up-all-line-width-less-than-1-greater-than-0.html |
| @@ -0,0 +1,25 @@ |
| +<!DOCTYPE html> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| + |
| +<body> |
| +</body> |
| + |
| +<script> |
| +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:"1px"}, {actual:"1.9pt", expected:"2px"}, {actual:"1pt", expected:"1px"}, {actual:"1.2pt", expected:"1px"}, {actual:"2.1px", expected:"2px"}, {actual:"2.9px", expected:"2px"}]; |
|
nainar
2015/10/29 03:59:40
actual -> input
Each entry on a new line
|
| + |
| +for (var value of values) { |
| + var div = document.createElement("div"); |
| + div.style = "outline: solid " + value.actual + " red; margin-bottom: 20px; display: none;"; |
| + document.body.appendChild(div); |
| + div.textContent = "Div with outline of " + value + " computes to " + getComputedStyle(div).outlineWidth; |
|
nainar
2015/10/29 03:59:40
remove text and display: none
|
| +} |
| + |
| +test(function() { |
| + var targets = document.querySelectorAll("div"); |
| + for (var i=0; i < targets.length; i++) { |
| + assert_equals(getComputedStyle(targets[i]).outlineWidth, values[i].expected); |
| + } |
| +}, "Test that chrome rounds up all borders/outlines when they are less than 1px but greater than 0px but floors all other borders."); |
| + |
| +</script> |