Commit f4cefe72 authored by andersr@opera.com's avatar andersr@opera.com

Add a test for font/line-height cascade.

The line-height property has lots of special handling in the style
resolver which we want to remove at some point. When we do, it's nice to
know that this still works correctly.

R=rune@opera.com
BUG=353932

Review URL: https://codereview.chromium.org/678483005

git-svn-id: svn://svn.chromium.org/blink/trunk@184346 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent f6d06400
Test that line-height in font shorthands cascades correctly.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS lineHeight(system_font_1) is '100px'
PASS lineHeight(system_font_2) is 'normal'
PASS lineHeight(shorthand_normal_1) is '100px'
PASS lineHeight(shorthand_normal_2) is 'normal'
PASS lineHeight(shorthand_line_height_1) is '100px'
PASS lineHeight(shorthand_line_height_2) is '200px'
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<style>
#system_font_1 { font: caption; line-height: 100px; }
#system_font_2 { line-height: 100px; font: caption; }
#shorthand_normal_1 { font: 10px monospace; line-height: 100px; }
#shorthand_normal_2 { line-height: 100px; font: 10px monospace; }
#shorthand_line_height_1 { font: 10px/200px monospace; line-height: 100px; }
#shorthand_line_height_2 { line-height: 100px; font: 10px/200px monospace; }
</style>
<div id="system_font_1"></div>
<div id="system_font_2"></div>
<div id="shorthand_normal_1"></div>
<div id="shorthand_normal_2"></div>
<div id="shorthand_line_height_1"></div>
<div id="shorthand_line_height_2"></div>
<script>
description("Test that line-height in font shorthands cascades correctly.");
function lineHeight(target) {
return getComputedStyle(target).lineHeight;
}
shouldBe("lineHeight(system_font_1)", "'100px'");
shouldBe("lineHeight(system_font_2)", "'normal'");
shouldBe("lineHeight(shorthand_normal_1)", "'100px'");
shouldBe("lineHeight(shorthand_normal_2)", "'normal'");
shouldBe("lineHeight(shorthand_line_height_1)", "'100px'");
shouldBe("lineHeight(shorthand_line_height_2)", "'200px'");
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment