Changeset 284683 in webkit
- Timestamp:
- Oct 22, 2021, 8:17:11 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r284680 r284683 1 2021-10-22 Alan Bujtas <zalan@apple.com> 2 3 [LFC][IFC] Check the parent style for content wrapping when collecting wrap opportunities 4 https://bugs.webkit.org/show_bug.cgi?id=232056 5 6 Reviewed by Antti Koivisto. 7 8 * TestExpectations: 9 1 10 2021-10-22 Alan Bujtas <zalan@apple.com> 2 11 -
trunk/LayoutTests/TestExpectations
r284658 r284683 2578 2578 webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/line-breaking/line-breaking-016.html [ ImageOnlyFailure ] 2579 2579 webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/line-breaking/line-breaking-017.html [ ImageOnlyFailure ] 2580 webkit.org/b/183258 imported/w3c/web-platform-tests/css/css-text/line-breaking/line-breaking-ic-003.html [ ImageOnlyFailure ]2581 2580 webkit.org/b/195345 imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-anywhere-003.html [ ImageOnlyFailure ] 2582 2581 webkit.org/b/195345 imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-min-content-size-002.html [ ImageOnlyFailure ] -
trunk/Source/WebCore/ChangeLog
r284680 r284683 1 2021-10-22 Alan Bujtas <zalan@apple.com> 2 3 [LFC][IFC] Check the parent style for content wrapping when collecting wrap opportunities 4 https://bugs.webkit.org/show_bug.cgi?id=232056 5 6 Reviewed by Antti Koivisto. 7 8 See the comment in LineBuilder::handleInlineContent. 9 10 * layout/formattingContexts/inline/InlineLineBuilder.cpp: 11 (WebCore::Layout::LineBuilder::handleInlineContent): 12 1 13 2021-10-22 Alan Bujtas <zalan@apple.com> 2 14 -
trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp
r284680 r284683 771 771 for (auto& run : candidateRuns) 772 772 m_line.append(run.inlineItem, run.style, run.logicalWidth); 773 if (lineCandidate.inlineContent.hasTrailingSoftWrapOpportunity()) { 774 // Check if we are allowed to wrap at this position. 773 // We are keeping this content on the line but we need to check if we could have wrapped here 774 // in order to be able to revert back to this positon if needed. 775 // Let's just ignore cases like collapsed leading whitespace for now. 776 if (lineCandidate.inlineContent.hasTrailingSoftWrapOpportunity() && m_line.hasContent()) { 775 777 auto& trailingRun = candidateRuns.last(); 776 // FIXME: There must be a way to decide if the trailing run actually ended up on the line. 777 // Let's just deal with collapsed leading whitespace for now. 778 if (m_line.hasContent() && TextUtil::isWrappingAllowed(trailingRun.style)) 779 m_wrapOpportunityList.append(&trailingRun.inlineItem); 778 auto& trailingInlineItem = trailingRun.inlineItem; 779 // Note that wrapping here could be driven both by the style of the parent and the inline item itself. 780 // e.g inline boxes set the wrapping rules for their content and not for themselves. 781 auto& parentStyle = trailingInlineItem.layoutBox().parent().style(); 782 auto isWrapOpportunity = TextUtil::isWrappingAllowed(parentStyle); 783 if (!isWrapOpportunity && (trailingInlineItem.isInlineBoxStart() || trailingInlineItem.isInlineBoxEnd())) 784 isWrapOpportunity = TextUtil::isWrappingAllowed(trailingRun.style); 785 if (isWrapOpportunity) 786 m_wrapOpportunityList.append(&trailingInlineItem); 780 787 } 781 788 return { result.isEndOfLine, { candidateRuns.size(), false } };
Note:
See TracChangeset
for help on using the changeset viewer.