Changeset 284680 in webkit
- Timestamp:
- Oct 22, 2021, 7:31:05 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/inline/white-space-nowrap-and-normal-inline-box-expected.html (added)
-
LayoutTests/fast/inline/white-space-nowrap-and-normal-inline-box.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r284677 r284680 1 2021-10-22 Alan Bujtas <zalan@apple.com> 2 3 [LFC][IFC] Add missing isAtSoftWrapOpportunity check when between two whitespace inline items 4 https://bugs.webkit.org/show_bug.cgi?id=232055 5 6 Reviewed by Antti Koivisto. 7 8 * fast/inline/white-space-nowrap-and-normal-inline-box-expected.html: Added. 9 * fast/inline/white-space-nowrap-and-normal-inline-box.html: Added. 10 1 11 2021-10-22 Alan Bujtas <zalan@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r284678 r284680 1 2021-10-22 Alan Bujtas <zalan@apple.com> 2 3 [LFC][IFC] Add missing isAtSoftWrapOpportunity check when between two whitespace inline items 4 https://bugs.webkit.org/show_bug.cgi?id=232055 5 6 Reviewed by Antti Koivisto. 7 8 Due to the isWrappingAllowed checks in isAtSoftWrapOpportunity() to speed up line breaking, 9 we may end up with adjacent whitespace content with different wrapping styles (embedded in separate inline boxes). 10 e.g. <span style="white-space: no-wrap">XXX </span><span style="white-space: normal"> X</span 11 12 Test: fast/inline/white-space-nowrap-and-normal-inline-box.html 13 14 * layout/formattingContexts/inline/InlineContentBreaker.cpp: 15 (WebCore::Layout::isVisuallyEmptyWhitespaceContent): 16 * layout/formattingContexts/inline/InlineLineBuilder.cpp: 17 (WebCore::Layout::isAtSoftWrapOpportunity): 18 1 19 2021-10-22 Alan Bujtas <zalan@apple.com> 2 20 -
trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp
r284452 r284680 93 93 auto& currentInlineTextItem = downcast<InlineTextItem>(current); 94 94 auto& nextInlineTextItem = downcast<InlineTextItem>(next); 95 if (currentInlineTextItem.isWhitespace() && nextInlineTextItem.isWhitespace()) { 96 // <span> </span><span> </span>. Depending on the styles, there may or may not be a soft wrap opportunity between these 2 whitespace content. 97 return TextUtil::isWrappingAllowed(currentInlineTextItem.style()) || TextUtil::isWrappingAllowed(nextInlineTextItem.style()); 98 } 95 99 if (currentInlineTextItem.isWhitespace()) { 96 // [ ][text]: after [whitespace] position is a soft wrap opportunity.100 // " <span>text</span>" : after [whitespace] position is a soft wrap opportunity. 97 101 return TextUtil::isWrappingAllowed(currentInlineTextItem.style()); 98 102 } 99 103 if (nextInlineTextItem.isWhitespace()) { 100 // [text][ ] (<span>text</span> )104 // "<span>text</span> " 101 105 // white-space: break-spaces: line breaking opportunity exists after every preserved white space character, but not before. 102 106 return TextUtil::isWrappingAllowed(nextInlineTextItem.style()) && nextInlineTextItem.style().whiteSpace() != WhiteSpace::BreakSpaces;
Note:
See TracChangeset
for help on using the changeset viewer.