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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/round-up-all-line-width-less-than-1-greater-than-0.html

Issue 1412103005: Make sure line widths in the range of 0px and 1px are rounded up to 1px for visibility. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
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..327823da3ecdc60a8778e8e054e9bd8d07d9fc16
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/round-up-all-line-width-less-than-1-greater-than-0.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+
+<body>
+</body>
+
+<script>
+var actualValues = ["0px", "0.9px", "1px", "0.2px", "0.9pt", "1pt", "0.2pt", "1.9pt", "1pt", "1.2pt", "2.1px", "2.9px"]
+var expectedValues = ["0px", "1px", "1px", "1px", "1px", "1px", "1px", "2px", "1px", "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.
+
+for (var value of actualValues) {
+ var div = document.createElement("div");
+ div.style = "outline: solid " + value + " red; margin-bottom: 20px; display: none;";
+ document.body.appendChild(div);
+ div.textContent = "Div with outline of " + value + " computes to " + getComputedStyle(div).outlineWidth;
+}
+
+test(function() {
+ var targets = document.querySelectorAll("div");
+ for (var i=0; i < targets.length; i++) {
+ assert_equals(getComputedStyle(targets[i]).outlineWidth, expectedValues[i]);
+ }
+}, "Test that chrome rounds up all borders/outlines when they are less than 1px but greater than 0px but floors all other borders.");
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698