Title: [267927] trunk/Source/WebCore
- Revision
- 267927
- Author
- [email protected]
- Date
- 2020-10-03 09:51:45 -0700 (Sat, 03 Oct 2020)
Log Message
[LFC][IFC] Rename InlineContentBreaker::Result::Action::Push to Wrap
https://bugs.webkit.org/show_bug.cgi?id=217273
Reviewed by Antti Koivisto.
"Wrap" is a more suitable name in this context.
* layout/inlineformatting/InlineContentBreaker.cpp:
(WebCore::Layout::isWrappingAllowed):
(WebCore::Layout::InlineContentBreaker::processInlineContent):
(WebCore::Layout::InlineContentBreaker::processOverflowingContent const):
* layout/inlineformatting/InlineContentBreaker.h:
* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::handleFloatsAndInlineContent):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (267926 => 267927)
--- trunk/Source/WebCore/ChangeLog 2020-10-03 16:21:36 UTC (rev 267926)
+++ trunk/Source/WebCore/ChangeLog 2020-10-03 16:51:45 UTC (rev 267927)
@@ -1,5 +1,22 @@
2020-10-03 Zalan Bujtas <[email protected]>
+ [LFC][IFC] Rename InlineContentBreaker::Result::Action::Push to Wrap
+ https://bugs.webkit.org/show_bug.cgi?id=217273
+
+ Reviewed by Antti Koivisto.
+
+ "Wrap" is a more suitable name in this context.
+
+ * layout/inlineformatting/InlineContentBreaker.cpp:
+ (WebCore::Layout::isWrappingAllowed):
+ (WebCore::Layout::InlineContentBreaker::processInlineContent):
+ (WebCore::Layout::InlineContentBreaker::processOverflowingContent const):
+ * layout/inlineformatting/InlineContentBreaker.h:
+ * layout/inlineformatting/InlineLineBuilder.cpp:
+ (WebCore::Layout::LineBuilder::handleFloatsAndInlineContent):
+
+2020-10-03 Zalan Bujtas <[email protected]>
+
[LFC][IFC][Soft hyphen] Rebuild the line when need to revert to a previous wrap opportunity due to soft hyphens
https://bugs.webkit.org/show_bug.cgi?id=217272
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineContentBreaker.cpp (267926 => 267927)
--- trunk/Source/WebCore/layout/inlineformatting/InlineContentBreaker.cpp 2020-10-03 16:21:36 UTC (rev 267926)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineContentBreaker.cpp 2020-10-03 16:51:45 UTC (rev 267927)
@@ -99,7 +99,7 @@
static inline bool isWrappingAllowed(const RenderStyle& style)
{
- // Do not try to push overflown 'pre' and 'no-wrap' content to next line.
+ // Do not try to wrap overflown 'pre' and 'no-wrap' content to next line.
return style.whiteSpace() != WhiteSpace::Pre && style.whiteSpace() != WhiteSpace::NoWrap;
}
@@ -169,8 +169,8 @@
m_hasWrapOpportunityAtPreviousPosition = true;
}
}
- } else if (result.action == Result::Action::Push && lineStatus.trailingSoftHyphenWidth) {
- // A trailing soft hyphen may turn action "Push" to action "Revert".
+ } else if (result.action == Result::Action::Wrap && lineStatus.trailingSoftHyphenWidth) {
+ // A trailing soft hyphen may turn action "Wrap" to action "Revert".
if (*lineStatus.trailingSoftHyphenWidth > lineStatus.availableWidth && isTextContentOnly(candidateContent))
result = { Result::Action::RevertToLastNonOverflowingWrapOpportunity, IsEndOfLine::Yes };
}
@@ -216,10 +216,10 @@
if (auto trailingContent = processOverflowingTextContent(continuousContent, lineStatus)) {
if (!trailingContent->runIndex && trailingContent->hasOverflow) {
// We tried to break the content but the available space can't even accommodate the first character.
- // 1. Push the content over to the next line when we've got content on the line already.
+ // 1. Wrap the content over to the next line when we've got content on the line already.
// 2. Keep the first character on the empty line (or keep the whole run if it has only one character).
if (!lineStatus.isEmpty)
- return { Result::Action::Push, IsEndOfLine::Yes };
+ return { Result::Action::Wrap, IsEndOfLine::Yes };
auto leadingTextRunIndex = *firstTextRunIndex(continuousContent);
auto& inlineTextItem = downcast<InlineTextItem>(continuousContent.runs()[leadingTextRunIndex].inlineItem);
ASSERT(inlineTextItem.length());
@@ -233,7 +233,7 @@
return { Result::Action::Break, IsEndOfLine::Yes, trailingPartialContent };
}
}
- // If we are not allowed to break this overflowing content, we still need to decide whether keep it or push it to the next line.
+ // If we are not allowed to break this overflowing content, we still need to decide whether keep it or wrap it to the next line.
if (lineStatus.isEmpty) {
ASSERT(!m_hasWrapOpportunityAtPreviousPosition);
return { Result::Action::Keep, IsEndOfLine::No };
@@ -240,7 +240,7 @@
}
// Now either wrap here or at an earlier position, or not wrap at all.
if (isContentWrappingAllowed(continuousContent))
- return { Result::Action::Push, IsEndOfLine::Yes };
+ return { Result::Action::Wrap, IsEndOfLine::Yes };
if (m_hasWrapOpportunityAtPreviousPosition)
return { Result::Action::RevertToLastWrapOpportunity, IsEndOfLine::Yes };
return { Result::Action::Keep, IsEndOfLine::No };
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineContentBreaker.h (267926 => 267927)
--- trunk/Source/WebCore/layout/inlineformatting/InlineContentBreaker.h 2020-10-03 16:21:36 UTC (rev 267926)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineContentBreaker.h 2020-10-03 16:51:45 UTC (rev 267927)
@@ -50,7 +50,7 @@
enum class Action {
Keep, // Keep content on the current line.
Break, // Partial content is on the current line.
- Push, // Content is pushed to the next line.
+ Wrap, // Content is wrapped to the next line.
// The current content overflows and can't get broken up into smaller bits.
RevertToLastWrapOpportunity, // The content needs to be reverted back to the last wrap opportunity.
RevertToLastNonOverflowingWrapOpportunity // The content needs to be reverted back to a wrap opportunity that still fits the line.
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp (267926 => 267927)
--- trunk/Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp 2020-10-03 16:21:36 UTC (rev 267926)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp 2020-10-03 16:51:45 UTC (rev 267927)
@@ -604,7 +604,7 @@
commitFloats(lineCandidate);
return { result.isEndOfLine, { candidateRuns.size(), false } };
}
- if (result.action == InlineContentBreaker::Result::Action::Push) {
+ if (result.action == InlineContentBreaker::Result::Action::Wrap) {
ASSERT(result.isEndOfLine == InlineContentBreaker::IsEndOfLine::Yes);
// This continuous content can't be placed on the current line. Nothing to commit at this time.
return { InlineContentBreaker::IsEndOfLine::Yes };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes