Changeset 286000 in webkit
- Timestamp:
- Nov 18, 2021, 6:43:13 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/inline/inline-box-with-unbreakable-decoration-and-word-break-expected.html (added)
-
LayoutTests/fast/inline/inline-box-with-unbreakable-decoration-and-word-break.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/layout/formattingContexts/inline/InlineContentBreaker.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r285998 r286000 1 2021-11-18 Alan Bujtas <zalan@apple.com> 2 3 [LFC][IFC] Inline boxes with unbreakable decoration can produce a breaking position with no trailing run 4 https://bugs.webkit.org/show_bug.cgi?id=233302 5 6 Reviewed by Antti Koivisto. 7 8 * fast/inline/inline-box-with-unbreakable-decoration-and-word-break-expected.html: Added. 9 * fast/inline/inline-box-with-unbreakable-decoration-and-word-break.html: Added. 10 1 11 2021-11-18 Ziran Sun <zsun@igalia.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r285999 r286000 1 2021-11-18 Alan Bujtas <zalan@apple.com> 2 3 [LFC][IFC] Inline boxes with unbreakable decoration can produce a breaking position with no trailing run 4 https://bugs.webkit.org/show_bug.cgi?id=233302 5 6 Reviewed by Antti Koivisto. 7 8 This is a rare case when the overflowing run is the first inline box start with unbreakable decoration while its content is breakable. 9 e.g. 10 <div style="width: 0xp"><span style="border: solid; word-break: break-word;">breakable</span></div> 11 12 While the overflowing run (inline box start) is unbreakable (border), we find the first breaking position right between 13 the <span> (inline box start) and its content (inline text item). 14 However we also don't want to separate the content from its parent inline box (i.e. should not be breaking between these 2 inline items) 15 so we start searching for a trailing run candidate by looking at the previous set of runs. 16 Now if this <span> is the first run in this set we won't find a trailing run and we should just return the breaking position with no trailing content. 17 18 Test: fast/inline/inline-box-with-unbreakable-decoration-and-word-break.html 19 20 * layout/formattingContexts/inline/InlineContentBreaker.cpp: 21 (WebCore::Layout::InlineContentBreaker::tryBreakingNextOverflowingRuns const): 22 1 23 2021-11-18 Alan Bujtas <zalan@apple.com> 2 24 -
trunk/Source/WebCore/layout/formattingContexts/inline/InlineContentBreaker.cpp
r285956 r286000 578 578 return OverflowingTextContent::BreakingPosition { index, OverflowingTextContent::BreakingPosition::TrailingContent { true, partialRun } }; 579 579 } 580 auto trailingRunIndex = *findTrailingRunIndex(runs, index); 581 // At worst we are back to the overflowing run, like in the example above. 582 ASSERT(trailingRunIndex >= overflowingRunIndex); 583 return OverflowingTextContent::BreakingPosition { trailingRunIndex, OverflowingTextContent::BreakingPosition::TrailingContent { true } }; 580 if (auto trailingRunIndex = findTrailingRunIndex(runs, index)) { 581 // At worst we are back to the overflowing run, like in the example above. 582 ASSERT(*trailingRunIndex >= overflowingRunIndex); 583 return OverflowingTextContent::BreakingPosition { *trailingRunIndex, OverflowingTextContent::BreakingPosition::TrailingContent { true } }; 584 } 585 // This happens when the overflowing run is also the first run in this set, no trailing run. 586 return OverflowingTextContent::BreakingPosition { overflowingRunIndex, { } }; 584 587 } 585 588 nextContentWidth += run.logicalWidth;
Note:
See TracChangeset
for help on using the changeset viewer.