Changeset 272649 in webkit
- Timestamp:
- Feb 10, 2021, 6:59:20 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/text/letter-spacing-produces-nan-width-expected.txt (added)
-
LayoutTests/fast/text/letter-spacing-produces-nan-width.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/layout/inlineformatting/InlineContentBreaker.cpp (modified) (1 diff)
-
Source/WebCore/layout/inlineformatting/text/TextUtil.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r272645 r272649 1 2021-02-10 Zalan Bujtas <zalan@apple.com> 2 3 [LFC][IFC] Pass in sane content width values to InlineContentBreaker 4 https://bugs.webkit.org/show_bug.cgi?id=221628 5 6 Reviewed by Antti Koivisto. 7 8 * fast/text/letter-spacing-produces-nan-width-expected.txt: Added. 9 * fast/text/letter-spacing-produces-nan-width.html: Added. 10 1 11 2021-02-10 Kimmo Kinnunen <kkinnunen@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r272648 r272649 1 2021-02-10 Zalan Bujtas <zalan@apple.com> 2 3 [LFC][IFC] Pass in sane content width values to InlineContentBreaker 4 https://bugs.webkit.org/show_bug.cgi?id=221628 5 rdar://problem/73874164 6 7 Reviewed by Antti Koivisto. 8 9 Insanely large zoom value could produce Nan letter-spacing values. 10 Let's tighten the inline content width values so that InlineContentBreaker can always expect valid InlineLayoutUnit values. 11 12 Test: fast/text/letter-spacing-produces-nan-width.html 13 14 * layout/inlineformatting/InlineContentBreaker.cpp: 15 (WebCore::Layout::InlineContentBreaker::ContinuousContent::append): 16 * layout/inlineformatting/text/TextUtil.cpp: 17 (WebCore::Layout::TextUtil::width): 18 1 19 2021-02-10 Zalan Bujtas <zalan@apple.com> 2 20 -
trunk/Source/WebCore/layout/inlineformatting/InlineContentBreaker.cpp
r272412 r272649 489 489 { 490 490 m_runs.append({ inlineItem, logicalWidth }); 491 m_logicalWidth += logicalWidth;491 m_logicalWidth = clampTo<InlineLayoutUnit>(m_logicalWidth + logicalWidth); 492 492 if (!collapsibleWidth) { 493 493 m_collapsibleLogicalWidth = { }; -
trunk/Source/WebCore/layout/inlineformatting/text/TextUtil.cpp
r272578 r272649 48 48 RELEASE_ASSERT(from >= inlineTextItem.start()); 49 49 RELEASE_ASSERT(to <= inlineTextItem.end()); 50 if (inlineTextItem.isWhitespace() && !InlineTextItem::shouldPreserveSpacesAndTabs(inlineTextItem)) 51 return inlineTextItem.style().fontCascade().spaceWidth(); 50 if (inlineTextItem.isWhitespace() && !InlineTextItem::shouldPreserveSpacesAndTabs(inlineTextItem)) { 51 auto spaceWidth = inlineTextItem.style().fontCascade().spaceWidth(); 52 return std::isnan(spaceWidth) ? 0.0f : std::isinf(spaceWidth) ? maxInlineLayoutUnit() : spaceWidth; 53 } 52 54 return TextUtil::width(inlineTextItem.inlineTextBox(), from, to, contentLogicalLeft); 53 55 } … … 80 82 width -= (font.spaceWidth() + font.wordSpacing()); 81 83 82 return width;84 return std::isnan(width) ? 0.0f : std::isinf(width) ? maxInlineLayoutUnit() : width; 83 85 } 84 86
Note:
See TracChangeset
for help on using the changeset viewer.