Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r222588 - Minimum font size may cause elements to have an infin…
…ite line-height https://bugs.webkit.org/show_bug.cgi?id=177573 <rdar://problem/34573792> Reviewed by Dan Bernstein. Source/WebCore: When minimum font size is specified, we were trying to preserve the ratio of specified font-size and specified line-height in order to boost the computed font size proportionately to the font-size boost. However, this doesn't work when the specified font-size is 0, because the ratio between line-height and font-size is infinite. The most straightforward solution is just to make small font-sizes opt out of the line-height adjustment because the result would be too big. Test: fast/text/line-height-minimumFontSize-text-small-font-size.html * css/StyleBuilderCustom.h: (WebCore::computeLineHeightMultiplierDueToFontSize): (WebCore::StyleBuilderCustom::applyValueLineHeight): LayoutTests: * fast/text/line-height-minimumFontSize-text-small-font-size-expected.txt: Added. * fast/text/line-height-minimumFontSize-text-small-font-size.html: Added.
- Loading branch information
1 parent
da0c1a8
commit 16eac30
Showing
5 changed files
with
61 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
LayoutTests/fast/text/line-height-minimumFontSize-text-small-font-size-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PASS document.getElementById('target').offsetHeight < 100 is true | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
Hi |
18 changes: 18 additions & 0 deletions
18
LayoutTests/fast/text/line-height-minimumFontSize-text-small-font-size.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script> | ||
if (window.internals) { | ||
internals.settings.setMinimumFontSize(32); | ||
} | ||
</script> | ||
<script src="../../resources/js-test-pre.js"></script> | ||
</head> | ||
<body style="font-size: 16px;"> | ||
<div id="target" style="font-size: 0px; line-height: 1rem;">Hi</div> | ||
<script> | ||
shouldBeTrue("document.getElementById('target').offsetHeight < 100"); | ||
</script> | ||
<script src="../../resources/js-test-post.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters