Changeset 254425 in webkit
- Timestamp:
- Jan 13, 2020 2:11:00 AM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r254421 r254425 1 2020-01-13 Antti Koivisto <antti@apple.com> 2 3 [LFC][IFC] fast/text/fast-run-width-vs-slow-run-width.html is failing 4 https://bugs.webkit.org/show_bug.cgi?id=206143 5 6 Reviewed by Zalan Bujtas. 7 8 The test is constructed so that the preferred width computation produces float value that maps exactly to LayoutUnit 9 (usually it gets ceiled up). This get converted back to float and the same input widths are substracted from 10 the total during inline layout. Due to nature of floating point arithmetic this ends up producing slightly 11 different result and the last word doesn't fit. 12 13 * layout/inlineformatting/InlineLineBreaker.cpp: 14 (WebCore::Layout::LineBreaker::tryWrappingInlineContent const): 15 16 When using floats, do an additional equality comparison that accepts values within scaled float epsilon as equal. 17 1 18 2020-01-12 Zalan Bujtas <zalan@apple.com> 2 19 -
trunk/Source/WebCore/layout/inlineformatting/InlineLineBreaker.cpp
r254032 r254425 131 131 if (candidateContent.width() <= lineStatus.availableWidth) 132 132 return { Result::Action::Keep }; 133 134 #if USE_FLOAT_AS_INLINE_LAYOUT_UNIT 135 // Preferred width computation sums up floats while line breaker substracts them. This can lead to epsilon-scale differences. 136 if (WTF::areEssentiallyEqual(candidateContent.width(), lineStatus.availableWidth)) 137 return { Result::Action::Keep }; 138 #endif 139 133 140 if (candidateContent.hasTrailingCollapsibleContent()) { 134 141 ASSERT(candidateContent.hasTextContentOnly());
Note: See TracChangeset
for help on using the changeset viewer.