haikuwebkit/LayoutTests/fast/css/font-shorthand-line-height....

33 lines
1.2 KiB
HTML
Raw Permalink Normal View History

<!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'");
getComputedStyle for line-height: normal should return the keyword instead of a length https://bugs.webkit.org/show_bug.cgi?id=201296 LayoutTests/imported/w3c: Reviewed by Ryosuke Niwa. Per https://github.com/w3c/csswg-drafts/issues/3749, Gecko and Blink has this behavior already. This patch makes WebKit has the same behavior with them. * web-platform-tests/css/css-inline/parsing/line-height-computed-expected.txt: Added. * web-platform-tests/css/css-inline/parsing/line-height-computed.html: Added. * web-platform-tests/css/cssom/getComputedStyle-line-height-expected.txt: Added. * web-platform-tests/css/cssom/getComputedStyle-line-height.html: Added. * web-platform-tests/html/rendering/replaced-elements/the-select-element/select-1-line-height-expected.html: Added. * web-platform-tests/html/rendering/replaced-elements/the-select-element/select-1-line-height.html: Added. Source/WebCore: Reviewed by Ryosuke Niwa. Per https://github.com/w3c/csswg-drafts/issues/3749, Gecko and Blink has this behavior already. This patch makes WebKit has the same behavior with them. Tests: imported/w3c/web-platform-tests/css/css-inline/parsing/line-height-computed.html imported/w3c/web-platform-tests/css/cssom/getComputedStyle-line-height.html imported/w3c/web-platform-tests/html/rendering/replaced-elements/the-select-element/select-1-line-height.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::lineHeightFromStyle): LayoutTests: Reviewed by Ryosuke Niwa. Per https://github.com/w3c/csswg-drafts/issues/3749, Gecko and Blink has this behavior already. This patch makes WebKit has the same behavior with them. * css3/calc/line-height-expected.txt: * fast/css/font-calculated-value-expected.txt: * fast/css/font-calculated-value.html: * fast/css/font-shorthand-from-longhands-expected.txt: * fast/css/font-shorthand-from-longhands.html: * fast/css/font-shorthand-line-height-expected.txt: * fast/css/font-shorthand-line-height.html: * fast/css/getComputedStyle/computed-style-expected.txt: * fast/css/getComputedStyle/computed-style-font-expected.txt: * fast/css/getComputedStyle/computed-style-font.html: * fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: * fast/ruby/ruby-line-height-expected.txt: * fast/ruby/ruby-line-height.html: * fast/text-autosizing/ios/idempotentmode/line-height-boosting-expected.txt: * fast/text-autosizing/ios/idempotentmode/line-height-boosting.html: * fast/text-autosizing/ios/line-height-text-autosizing-expected.txt: * fast/text-autosizing/ios/line-height-text-autosizing.html: * media/track/track-cue-rendering-on-resize-expected.txt: * media/track/track-cue-rendering-on-resize.html: * platform/gtk/fast/css/css2-system-fonts-expected.txt: * platform/gtk/fast/css/getComputedStyle/computed-style-expected.txt: * platform/gtk/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: * platform/gtk/svg/css/getComputedStyle-basic-expected.txt: * platform/ios/TestExpectations: * platform/ios/css3/calc/line-height-expected.txt: * platform/ios/fast/css/css2-system-fonts-expected.txt: * platform/ios/fast/css/getComputedStyle/computed-style-expected.txt: * platform/ios/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: * platform/ios/svg/css/getComputedStyle-basic-expected.txt: * platform/mac-sierra/fast/css/getComputedStyle/computed-style-expected.txt: * platform/mac-sierra/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: * platform/mac-sierra/svg/css/getComputedStyle-basic-expected.txt: * platform/mac/fast/css/css2-system-fonts-expected.txt: * platform/mac/fast/css/getComputedStyle/computed-style-expected.txt: * platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: * platform/mac/fast/text-autosizing/ios/line-height-text-autosizing-expected.txt: * platform/mac/svg/css/getComputedStyle-basic-expected.txt: * platform/wincairo/css3/calc/line-height-expected.txt: * platform/wincairo/fast/css/css2-system-fonts-expected.txt: * platform/wpe/fast/css/css2-system-fonts-expected.txt: * platform/wpe/fast/css/getComputedStyle/computed-style-expected.txt: * platform/wpe/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: * platform/wpe/svg/css/getComputedStyle-basic-expected.txt: * svg/css/getComputedStyle-basic-expected.txt: Canonical link: https://commits.webkit.org/215272@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249686 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-10 01:57:23 +00:00
shouldBe("lineHeight(system_font_2)", "'normal'");
shouldBe("lineHeight(shorthand_normal_1)", "'100px'");
getComputedStyle for line-height: normal should return the keyword instead of a length https://bugs.webkit.org/show_bug.cgi?id=201296 LayoutTests/imported/w3c: Reviewed by Ryosuke Niwa. Per https://github.com/w3c/csswg-drafts/issues/3749, Gecko and Blink has this behavior already. This patch makes WebKit has the same behavior with them. * web-platform-tests/css/css-inline/parsing/line-height-computed-expected.txt: Added. * web-platform-tests/css/css-inline/parsing/line-height-computed.html: Added. * web-platform-tests/css/cssom/getComputedStyle-line-height-expected.txt: Added. * web-platform-tests/css/cssom/getComputedStyle-line-height.html: Added. * web-platform-tests/html/rendering/replaced-elements/the-select-element/select-1-line-height-expected.html: Added. * web-platform-tests/html/rendering/replaced-elements/the-select-element/select-1-line-height.html: Added. Source/WebCore: Reviewed by Ryosuke Niwa. Per https://github.com/w3c/csswg-drafts/issues/3749, Gecko and Blink has this behavior already. This patch makes WebKit has the same behavior with them. Tests: imported/w3c/web-platform-tests/css/css-inline/parsing/line-height-computed.html imported/w3c/web-platform-tests/css/cssom/getComputedStyle-line-height.html imported/w3c/web-platform-tests/html/rendering/replaced-elements/the-select-element/select-1-line-height.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::lineHeightFromStyle): LayoutTests: Reviewed by Ryosuke Niwa. Per https://github.com/w3c/csswg-drafts/issues/3749, Gecko and Blink has this behavior already. This patch makes WebKit has the same behavior with them. * css3/calc/line-height-expected.txt: * fast/css/font-calculated-value-expected.txt: * fast/css/font-calculated-value.html: * fast/css/font-shorthand-from-longhands-expected.txt: * fast/css/font-shorthand-from-longhands.html: * fast/css/font-shorthand-line-height-expected.txt: * fast/css/font-shorthand-line-height.html: * fast/css/getComputedStyle/computed-style-expected.txt: * fast/css/getComputedStyle/computed-style-font-expected.txt: * fast/css/getComputedStyle/computed-style-font.html: * fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: * fast/ruby/ruby-line-height-expected.txt: * fast/ruby/ruby-line-height.html: * fast/text-autosizing/ios/idempotentmode/line-height-boosting-expected.txt: * fast/text-autosizing/ios/idempotentmode/line-height-boosting.html: * fast/text-autosizing/ios/line-height-text-autosizing-expected.txt: * fast/text-autosizing/ios/line-height-text-autosizing.html: * media/track/track-cue-rendering-on-resize-expected.txt: * media/track/track-cue-rendering-on-resize.html: * platform/gtk/fast/css/css2-system-fonts-expected.txt: * platform/gtk/fast/css/getComputedStyle/computed-style-expected.txt: * platform/gtk/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: * platform/gtk/svg/css/getComputedStyle-basic-expected.txt: * platform/ios/TestExpectations: * platform/ios/css3/calc/line-height-expected.txt: * platform/ios/fast/css/css2-system-fonts-expected.txt: * platform/ios/fast/css/getComputedStyle/computed-style-expected.txt: * platform/ios/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: * platform/ios/svg/css/getComputedStyle-basic-expected.txt: * platform/mac-sierra/fast/css/getComputedStyle/computed-style-expected.txt: * platform/mac-sierra/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: * platform/mac-sierra/svg/css/getComputedStyle-basic-expected.txt: * platform/mac/fast/css/css2-system-fonts-expected.txt: * platform/mac/fast/css/getComputedStyle/computed-style-expected.txt: * platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: * platform/mac/fast/text-autosizing/ios/line-height-text-autosizing-expected.txt: * platform/mac/svg/css/getComputedStyle-basic-expected.txt: * platform/wincairo/css3/calc/line-height-expected.txt: * platform/wincairo/fast/css/css2-system-fonts-expected.txt: * platform/wpe/fast/css/css2-system-fonts-expected.txt: * platform/wpe/fast/css/getComputedStyle/computed-style-expected.txt: * platform/wpe/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: * platform/wpe/svg/css/getComputedStyle-basic-expected.txt: * svg/css/getComputedStyle-basic-expected.txt: Canonical link: https://commits.webkit.org/215272@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249686 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-10 01:57:23 +00:00
shouldBe("lineHeight(shorthand_normal_2)", "'normal'");
shouldBe("lineHeight(shorthand_line_height_1)", "'100px'");
shouldBe("lineHeight(shorthand_line_height_2)", "'200px'");
</script>