Changeset 222588 in webkit
- Timestamp:
- Sep 27, 2017 5:25:59 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r222587 r222588 1 2017-09-27 Myles C. Maxfield <mmaxfield@apple.com> 2 3 Minimum font size may cause elements to have an infinite line-height 4 https://bugs.webkit.org/show_bug.cgi?id=177573 5 <rdar://problem/34573792> 6 7 Reviewed by Dan Bernstein. 8 9 * fast/text/line-height-minimumFontSize-text-small-font-size-expected.txt: Added. 10 * fast/text/line-height-minimumFontSize-text-small-font-size.html: Added. 11 1 12 2017-09-27 Matt Lewis <jlewis3@apple.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r222584 r222588 1 2017-09-27 Myles C. Maxfield <mmaxfield@apple.com> 2 3 Minimum font size may cause elements to have an infinite line-height 4 https://bugs.webkit.org/show_bug.cgi?id=177573 5 <rdar://problem/34573792> 6 7 Reviewed by Dan Bernstein. 8 9 When minimum font size is specified, we were trying to preserve the ratio of specified font-size 10 and specified line-height in order to boost the computed font size proportionately to the font-size 11 boost. However, this doesn't work when the specified font-size is 0, because the ratio between 12 line-height and font-size is infinite. 13 14 The most straightforward solution is just to make small font-sizes opt out of the line-height 15 adjustment because the result would be too big. 16 17 Test: fast/text/line-height-minimumFontSize-text-small-font-size.html 18 19 * css/StyleBuilderCustom.h: 20 (WebCore::computeLineHeightMultiplierDueToFontSize): 21 (WebCore::StyleBuilderCustom::applyValueLineHeight): 22 1 23 2017-09-27 Alex Christensen <achristensen@webkit.org> 2 24 -
trunk/Source/WebCore/css/StyleBuilderCustom.h
r220685 r222588 671 671 if (minimumFontSize > 0) { 672 672 auto specifiedFontSize = computeBaseSpecifiedFontSize(document, style, percentageAutosizingEnabled); 673 if (specifiedFontSize < minimumFontSize) { 673 // Small font sizes cause a preposterously large (near infinity) line-height. Add a fuzz-factor of 1px which opts out of 674 // boosted line-height. 675 if (specifiedFontSize < minimumFontSize && specifiedFontSize >= 1) { 674 676 // FIXME: There are two settings which are relevant here: minimum font size, and minimum logical font size (as 675 677 // well as things like the zoom property, text zoom on the page, and text autosizing). The minimum logical font … … 707 709 if (multiplier == 1) 708 710 computedLineHeight = lineHeight.value(); 709 else { 710 std::optional<Length> lineHeight = StyleBuilderConverter::convertLineHeight(styleResolver, value, multiplier); 711 ASSERT(static_cast<bool>(lineHeight)); 712 computedLineHeight = lineHeight.value(); 713 } 711 else 712 computedLineHeight = StyleBuilderConverter::convertLineHeight(styleResolver, value, multiplier).value(); 714 713 } 715 714
Note: See TracChangeset
for help on using the changeset viewer.