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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-lineHeight.html

Issue 1820773002: getComputedStyle() should return used value for 'line-height' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/getComputedStyle/getComputedStyle-lineHeight.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-lineHeight.html b/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-lineHeight.html
new file mode 100644
index 0000000000000000000000000000000000000000..5a4fccbcc89c2c18f0043d817f2f41be9ad61de7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-lineHeight.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<div id="target">Test</div>
+<script>
+test(function() {
+ var values = [
+ {input: "0.5in", expected: "48px"},
+ {input: "1.27cm", expected: "48px"},
+ {input: "12.7mm", expected: "48px"},
+ {input: "2cm", expected: "75.5906px"},
+ {input: "20mm", expected: "75.5906px"},
+ {input: "24pt", expected: "32px"},
+ {input: "2pc", expected: "32px"},
+ {input: "2em", expected: "32px"},
+ {input: "3ex", expected: "21px"},
+ {input: "200%", expected: "32px"},
+ {input: "2", expected: "32px"},
+ {input: "50px", expected: "50px"},
+ {input: "-1em", expected: "50px"},
+ {input: "normal", expected: "20px"},
+ {input: "inherit", expected: "20px"},
+ ];
+ for (let {input, expected} of values) {
+ target.style.lineHeight = input;
+ assert_equals(getComputedStyle(target).lineHeight, expected);
+ }
+ target.textContent = "";
+}, 'getComputedStyle(element) should return a length (the used value)');
+</script>

Powered by Google App Engine
This is Rietveld 408576698