<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[193608] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/193608">193608</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2015-12-06 20:40:35 -0800 (Sun, 06 Dec 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Addressing post-review comments on <a href="http://trac.webkit.org/projects/webkit/changeset/193374">r193374</a>.
Reviewed by Antti Koivisto.
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForText):
(WebCore::SimpleLineLayout::canUseForFontAndText):
(WebCore::SimpleLineLayout::canUseForStyle):
(WebCore::SimpleLineLayout::canUseForWithReason):
(WebCore::SimpleLineLayout::canUseFor):
(WebCore::SimpleLineLayout::printSimpleLineLayoutBlockList):
(WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingSimpleLineLayoutcpp">trunk/Source/WebCore/rendering/SimpleLineLayout.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (193607 => 193608)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-12-07 03:27:30 UTC (rev 193607)
+++ trunk/Source/WebCore/ChangeLog        2015-12-07 04:40:35 UTC (rev 193608)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-12-06 Zalan Bujtas <zalan@apple.com>
+
+ Addressing post-review comments on r193374.
+
+ Reviewed by Antti Koivisto.
+
+ * rendering/SimpleLineLayout.cpp:
+ (WebCore::SimpleLineLayout::canUseForText):
+ (WebCore::SimpleLineLayout::canUseForFontAndText):
+ (WebCore::SimpleLineLayout::canUseForStyle):
+ (WebCore::SimpleLineLayout::canUseForWithReason):
+ (WebCore::SimpleLineLayout::canUseFor):
+ (WebCore::SimpleLineLayout::printSimpleLineLayoutBlockList):
+ (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):
+
</ins><span class="cx"> 2015-12-04 Myles C. Maxfield <mmaxfield@apple.com>
</span><span class="cx">
</span><span class="cx"> Remove CORETEXT_WEB_FONTS
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingSimpleLineLayoutcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/SimpleLineLayout.cpp (193607 => 193608)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/SimpleLineLayout.cpp        2015-12-07 03:27:30 UTC (rev 193607)
+++ trunk/Source/WebCore/rendering/SimpleLineLayout.cpp        2015-12-07 04:40:35 UTC (rev 193608)
</span><span class="lines">@@ -61,84 +61,85 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> enum AvoidanceReason_ : uint64_t {
</span><del>- NoReason = 1LLU << 0,
- FlowIsInsideRegion = 1LLU << 1,
- FlowHasHorizonalWritingMode = 1LLU << 2,
- FlowHasOutline = 1LLU << 3,
- FlowIsRuby = 1LLU << 4,
- FlowIsPaginated = 1LLU << 5,
- FlowHasTextOverflow = 1LLU << 6,
- FlowIsDepricatedFlexBox = 1LLU << 7,
- FlowParentIsPlaceholderElement = 1LLU << 8,
- FlowParentIsTextAreaWithWrapping = 1LLU << 9,
- FlowHasNonSupportedChild = 1LLU << 10,
- FlowHasUnsupportedFloat = 1LLU << 11,
- FlowHasTextDecoration = 1LLU << 12,
- FlowIsJustifyAligned = 1LLU << 13,
- FlowHasOverflowVisible = 1LLU << 14,
- FlowIsNotLTR = 1LLU << 15,
- FlowHasLineBoxContainProperty = 1LLU << 16,
- FlowIsNotTopToBottom = 1LLU << 17,
- FlowHasLineBreak = 1LLU << 18,
- FlowHasWordBreak = 1LLU << 19,
- FlowHasNonNormalUnicodeBiDi = 1LLU << 20,
- FlowHasRTLOrdering = 1LLU << 21,
- FlowHasLineAlignEdges = 1LLU << 22,
- FlowHasLineSnap = 1LLU << 23,
- FlowHasHypensAuto = 1LLU << 24,
- FlowHasTextEmphasisFillOrMark = 1LLU << 25,
- FlowHasTextShadow = 1LLU << 26,
- FlowHasPseudoFirstLine = 1LLU << 27,
- FlowHasPseudoFirstLetter = 1LLU << 28,
- FlowHasTextCombine = 1LLU << 29,
- FlowHasTextFillBox = 1LLU << 30,
- FlowHasBorderFitLines = 1LLU << 31,
- FlowHasNonAutoLineBreak = 1LLU << 32,
- FlowHasNonAutoTrailingWord = 1LLU << 33,
- FlowHasSVGFont = 1LLU << 34,
- FlowTextIsEmpty = 1LLU << 35,
- FlowTextHasNoBreakSpace = 1LLU << 36,
- FlowTextHasSoftHyphen = 1LLU << 37,
- FlowTextHasDirectionCharacter = 1LLU << 38,
- FlowIsMissingPrimaryFont = 1LLU << 39,
- FlowFontIsMissingGlyph = 1LLU << 40,
- FlowTextIsCombineText = 1LLU << 41,
- FlowTextIsRenderCounter = 1LLU << 42,
- FlowTextIsRenderQuote = 1LLU << 43,
- FlowTextIsTextFragment = 1LLU << 44,
- FlowTextIsSVGInlineText = 1LLU << 45,
- FlowFontIsNotSimple = 1LLU << 46,
- FeatureIsDisabled = 1LLU << 47,
- FlowHasNoParent = 1LLU << 48,
- FlowHasNoChild = 1LLU << 49,
- EndOfReasons = 1LLU << 50
</del><ins>+ FlowIsInsideRegion = 1LLU << 0,
+ FlowHasHorizonalWritingMode = 1LLU << 1,
+ FlowHasOutline = 1LLU << 2,
+ FlowIsRuby = 1LLU << 3,
+ FlowIsPaginated = 1LLU << 4,
+ FlowHasTextOverflow = 1LLU << 5,
+ FlowIsDepricatedFlexBox = 1LLU << 6,
+ FlowParentIsPlaceholderElement = 1LLU << 7,
+ FlowParentIsTextAreaWithWrapping = 1LLU << 8,
+ FlowHasNonSupportedChild = 1LLU << 9,
+ FlowHasUnsupportedFloat = 1LLU << 10,
+ FlowHasTextDecoration = 1LLU << 11,
+ FlowIsJustifyAligned = 1LLU << 12,
+ FlowHasOverflowVisible = 1LLU << 13,
+ FlowIsNotLTR = 1LLU << 14,
+ FlowHasLineBoxContainProperty = 1LLU << 15,
+ FlowIsNotTopToBottom = 1LLU << 16,
+ FlowHasLineBreak = 1LLU << 17,
+ FlowHasWordBreak = 1LLU << 18,
+ FlowHasNonNormalUnicodeBiDi = 1LLU << 19,
+ FlowHasRTLOrdering = 1LLU << 20,
+ FlowHasLineAlignEdges = 1LLU << 21,
+ FlowHasLineSnap = 1LLU << 22,
+ FlowHasHypensAuto = 1LLU << 23,
+ FlowHasTextEmphasisFillOrMark = 1LLU << 24,
+ FlowHasTextShadow = 1LLU << 25,
+ FlowHasPseudoFirstLine = 1LLU << 26,
+ FlowHasPseudoFirstLetter = 1LLU << 27,
+ FlowHasTextCombine = 1LLU << 28,
+ FlowHasTextFillBox = 1LLU << 29,
+ FlowHasBorderFitLines = 1LLU << 30,
+ FlowHasNonAutoLineBreak = 1LLU << 31,
+ FlowHasNonAutoTrailingWord = 1LLU << 32,
+ FlowHasSVGFont = 1LLU << 33,
+ FlowTextIsEmpty = 1LLU << 34,
+ FlowTextHasNoBreakSpace = 1LLU << 35,
+ FlowTextHasSoftHyphen = 1LLU << 36,
+ FlowTextHasDirectionCharacter = 1LLU << 37,
+ FlowIsMissingPrimaryFont = 1LLU << 38,
+ FlowFontIsMissingGlyph = 1LLU << 39,
+ FlowTextIsCombineText = 1LLU << 40,
+ FlowTextIsRenderCounter = 1LLU << 41,
+ FlowTextIsRenderQuote = 1LLU << 42,
+ FlowTextIsTextFragment = 1LLU << 43,
+ FlowTextIsSVGInlineText = 1LLU << 44,
+ FlowFontIsNotSimple = 1LLU << 45,
+ FeatureIsDisabled = 1LLU << 46,
+ FlowHasNoParent = 1LLU << 47,
+ FlowHasNoChild = 1LLU << 48,
+ EndOfReasons = 1LLU << 49
</ins><span class="cx"> };
</span><ins>+const unsigned NoReason = 0;
+
</ins><span class="cx"> typedef uint64_t AvoidanceReason;
</span><span class="cx"> typedef uint64_t AvoidanceReasonFlags;
</span><span class="cx">
</span><del>-enum class FallThrough { Yes, No };
</del><ins>+enum class IncludeReasons { First , All };
</ins><span class="cx">
</span><span class="cx"> #ifndef NDEBUG
</span><del>-#define SET_REASON_AND_RETURN_IF_NEEDED(reasons, reason, fallthrough) { \
</del><ins>+#define SET_REASON_AND_RETURN_IF_NEEDED(reason, reasons, includeReasons) { \
</ins><span class="cx"> reasons |= reason; \
</span><del>- if (fallthrough == FallThrough::No) \
</del><ins>+ if (includeReasons == IncludeReasons::First) \
</ins><span class="cx"> return reasons; \
</span><span class="cx"> }
</span><span class="cx"> #else
</span><del>-#define SET_REASON_AND_RETURN_IF_NEEDED(reasons, reason, fallthrough) { \
- ASSERT_UNUSED(fallthrough, fallthrough == FallThrough::No); \
</del><ins>+#define SET_REASON_AND_RETURN_IF_NEEDED(reason, reasons, includeReasons) { \
+ ASSERT_UNUSED(includeReasons, includeReasons == IncludeReasons::First); \
</ins><span class="cx"> reasons |= reason; \
</span><span class="cx"> return reasons; \
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> template <typename CharacterType>
</span><del>-static AvoidanceReasonFlags canUseForText(const CharacterType* text, unsigned length, const Font& font, FallThrough fallthrough)
</del><ins>+static AvoidanceReasonFlags canUseForText(const CharacterType* text, unsigned length, const Font& font, IncludeReasons includeReasons)
</ins><span class="cx"> {
</span><del>- AvoidanceReasonFlags reasons = NoReason;
</del><ins>+ AvoidanceReasonFlags reasons = { };
</ins><span class="cx"> // FIXME: <textarea maxlength=0> generates empty text node.
</span><span class="cx"> if (!length)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowTextIsEmpty, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowTextIsEmpty, reasons, includeReasons);
</ins><span class="cx">
</span><span class="cx"> for (unsigned i = 0; i < length; ++i) {
</span><span class="cx"> UChar character = text[i];
</span><span class="lines">@@ -147,118 +148,118 @@
</span><span class="cx">
</span><span class="cx"> // These would be easy to support.
</span><span class="cx"> if (character == noBreakSpace)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowTextHasNoBreakSpace, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowTextHasNoBreakSpace, reasons, includeReasons);
</ins><span class="cx"> if (character == softHyphen)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowTextHasSoftHyphen, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowTextHasSoftHyphen, reasons, includeReasons);
</ins><span class="cx">
</span><span class="cx"> UCharDirection direction = u_charDirection(character);
</span><span class="cx"> if (direction == U_RIGHT_TO_LEFT || direction == U_RIGHT_TO_LEFT_ARABIC
</span><span class="cx"> || direction == U_RIGHT_TO_LEFT_EMBEDDING || direction == U_RIGHT_TO_LEFT_OVERRIDE
</span><span class="cx"> || direction == U_LEFT_TO_RIGHT_EMBEDDING || direction == U_LEFT_TO_RIGHT_OVERRIDE
</span><span class="cx"> || direction == U_POP_DIRECTIONAL_FORMAT || direction == U_BOUNDARY_NEUTRAL)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowTextHasDirectionCharacter, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowTextHasDirectionCharacter, reasons, includeReasons);
</ins><span class="cx">
</span><span class="cx"> if (!font.glyphForCharacter(character))
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowFontIsMissingGlyph, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowFontIsMissingGlyph, reasons, includeReasons);
</ins><span class="cx"> }
</span><span class="cx"> return reasons;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static AvoidanceReasonFlags canUseForText(const RenderText& textRenderer, const Font& font, FallThrough fallthrough)
</del><ins>+static AvoidanceReasonFlags canUseForText(const RenderText& textRenderer, const Font& font, IncludeReasons includeReasons)
</ins><span class="cx"> {
</span><span class="cx"> if (textRenderer.is8Bit())
</span><del>- return canUseForText(textRenderer.characters8(), textRenderer.textLength(), font, fallthrough);
- return canUseForText(textRenderer.characters16(), textRenderer.textLength(), font, fallthrough);
</del><ins>+ return canUseForText(textRenderer.characters8(), textRenderer.textLength(), font, includeReasons);
+ return canUseForText(textRenderer.characters16(), textRenderer.textLength(), font, includeReasons);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static AvoidanceReasonFlags canUseForFontAndText(const RenderBlockFlow& flow, FallThrough fallthrough)
</del><ins>+static AvoidanceReasonFlags canUseForFontAndText(const RenderBlockFlow& flow, IncludeReasons includeReasons)
</ins><span class="cx"> {
</span><del>- AvoidanceReasonFlags reasons = NoReason;
</del><ins>+ AvoidanceReasonFlags reasons = { };
</ins><span class="cx"> // We assume that all lines have metrics based purely on the primary font.
</span><span class="cx"> const auto& style = flow.style();
</span><span class="cx"> auto& primaryFont = style.fontCascade().primaryFont();
</span><span class="cx"> if (primaryFont.isLoading())
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowIsMissingPrimaryFont, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowIsMissingPrimaryFont, reasons, includeReasons);
</ins><span class="cx"> if (primaryFont.isSVGFont())
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasSVGFont, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasSVGFont, reasons, includeReasons);
</ins><span class="cx">
</span><span class="cx"> for (const auto& textRenderer : childrenOfType<RenderText>(flow)) {
</span><span class="cx"> if (textRenderer.isCombineText())
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowTextIsCombineText, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowTextIsCombineText, reasons, includeReasons);
</ins><span class="cx"> if (textRenderer.isCounter())
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowTextIsRenderCounter, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowTextIsRenderCounter, reasons, includeReasons);
</ins><span class="cx"> if (textRenderer.isQuote())
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowTextIsRenderQuote, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowTextIsRenderQuote, reasons, includeReasons);
</ins><span class="cx"> if (textRenderer.isTextFragment())
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowTextIsTextFragment, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowTextIsTextFragment, reasons, includeReasons);
</ins><span class="cx"> if (textRenderer.isSVGInlineText())
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowTextIsSVGInlineText, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowTextIsSVGInlineText, reasons, includeReasons);
</ins><span class="cx"> if (style.fontCascade().codePath(TextRun(textRenderer.text())) != FontCascade::Simple)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowFontIsNotSimple, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowFontIsNotSimple, reasons, includeReasons);
</ins><span class="cx">
</span><del>- auto textReasons = canUseForText(textRenderer, primaryFont, fallthrough);
</del><ins>+ auto textReasons = canUseForText(textRenderer, primaryFont, includeReasons);
</ins><span class="cx"> if (textReasons != NoReason)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, textReasons, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(textReasons, reasons, includeReasons);
</ins><span class="cx"> }
</span><span class="cx"> return reasons;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static AvoidanceReasonFlags canUseForStyle(const RenderStyle& style, FallThrough fallthrough)
</del><ins>+static AvoidanceReasonFlags canUseForStyle(const RenderStyle& style, IncludeReasons includeReasons)
</ins><span class="cx"> {
</span><del>- AvoidanceReasonFlags reasons = NoReason;
</del><ins>+ AvoidanceReasonFlags reasons = { };
</ins><span class="cx"> if (style.textOverflow())
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasTextOverflow, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasTextOverflow, reasons, includeReasons);
</ins><span class="cx"> if (style.textDecorationsInEffect() != TextDecorationNone)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasTextDecoration, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasTextDecoration, reasons, includeReasons);
</ins><span class="cx"> if (style.textAlign() == JUSTIFY)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowIsJustifyAligned, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowIsJustifyAligned, reasons, includeReasons);
</ins><span class="cx"> // Non-visible overflow should be pretty easy to support.
</span><span class="cx"> if (style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasOverflowVisible, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasOverflowVisible, reasons, includeReasons);
</ins><span class="cx"> if (!style.isLeftToRightDirection())
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowIsNotLTR, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowIsNotLTR, reasons, includeReasons);
</ins><span class="cx"> if (style.lineBoxContain() != RenderStyle::initialLineBoxContain())
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasLineBoxContainProperty, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasLineBoxContainProperty, reasons, includeReasons);
</ins><span class="cx"> if (style.writingMode() != TopToBottomWritingMode)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowIsNotTopToBottom, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowIsNotTopToBottom, reasons, includeReasons);
</ins><span class="cx"> if (style.lineBreak() != LineBreakAuto)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasLineBreak, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasLineBreak, reasons, includeReasons);
</ins><span class="cx"> if (style.wordBreak() != NormalWordBreak)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasWordBreak, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasWordBreak, reasons, includeReasons);
</ins><span class="cx"> if (style.unicodeBidi() != UBNormal)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasNonNormalUnicodeBiDi, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasNonNormalUnicodeBiDi, reasons, includeReasons);
</ins><span class="cx"> if (style.rtlOrdering() != LogicalOrder)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasRTLOrdering, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasRTLOrdering, reasons, includeReasons);
</ins><span class="cx"> if (style.lineAlign() != LineAlignNone)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasLineAlignEdges, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasLineAlignEdges, reasons, includeReasons);
</ins><span class="cx"> if (style.lineSnap() != LineSnapNone)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasLineSnap, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasLineSnap, reasons, includeReasons);
</ins><span class="cx"> if (style.hyphens() == HyphensAuto)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasHypensAuto, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasHypensAuto, reasons, includeReasons);
</ins><span class="cx"> if (style.textEmphasisFill() != TextEmphasisFillFilled || style.textEmphasisMark() != TextEmphasisMarkNone)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasTextEmphasisFillOrMark, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasTextEmphasisFillOrMark, reasons, includeReasons);
</ins><span class="cx"> if (style.textShadow())
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasTextShadow, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasTextShadow, reasons, includeReasons);
</ins><span class="cx"> if (style.hasPseudoStyle(FIRST_LINE))
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasPseudoFirstLine, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasPseudoFirstLine, reasons, includeReasons);
</ins><span class="cx"> if (style.hasPseudoStyle(FIRST_LETTER))
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasPseudoFirstLetter, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasPseudoFirstLetter, reasons, includeReasons);
</ins><span class="cx"> if (style.hasTextCombine())
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasTextCombine, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasTextCombine, reasons, includeReasons);
</ins><span class="cx"> if (style.backgroundClip() == TextFillBox)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasTextFillBox, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasTextFillBox, reasons, includeReasons);
</ins><span class="cx"> if (style.borderFit() == BorderFitLines)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasBorderFitLines, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasBorderFitLines, reasons, includeReasons);
</ins><span class="cx"> if (style.lineBreak() != LineBreakAuto)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasNonAutoLineBreak, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasNonAutoLineBreak, reasons, includeReasons);
</ins><span class="cx"> #if ENABLE(CSS_TRAILING_WORD)
</span><span class="cx"> if (style.trailingWord() != TrailingWord::Auto)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasNonAutoTrailingWord, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasNonAutoTrailingWord, reasons, includeReasons);
</ins><span class="cx"> #endif
</span><span class="cx"> return reasons;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static AvoidanceReasonFlags canUseForWithReason(const RenderBlockFlow& flow, FallThrough fallthrough)
</del><ins>+static AvoidanceReasonFlags canUseForWithReason(const RenderBlockFlow& flow, IncludeReasons includeReasons)
</ins><span class="cx"> {
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx"> static std::once_flag onceFlag;
</span><span class="lines">@@ -267,36 +268,36 @@
</span><span class="cx"> registerNotifyCallback("com.apple.WebKit.showSimpleLineLayoutReasons", printSimpleLineLayoutBlockList);
</span><span class="cx"> });
</span><span class="cx"> #endif
</span><del>- AvoidanceReasonFlags reasons = NoReason;
</del><ins>+ AvoidanceReasonFlags reasons = { };
</ins><span class="cx"> if (!flow.frame().settings().simpleLineLayoutEnabled())
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FeatureIsDisabled, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FeatureIsDisabled, reasons, includeReasons);
</ins><span class="cx"> if (!flow.parent())
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasNoParent, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasNoParent, reasons, includeReasons);
</ins><span class="cx"> if (!flow.firstChild())
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasNoChild, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasNoChild, reasons, includeReasons);
</ins><span class="cx"> if (flow.flowThreadState() != RenderObject::NotInsideFlowThread)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowIsInsideRegion, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowIsInsideRegion, reasons, includeReasons);
</ins><span class="cx"> if (!flow.isHorizontalWritingMode())
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasHorizonalWritingMode, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasHorizonalWritingMode, reasons, includeReasons);
</ins><span class="cx"> if (flow.hasOutline())
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasOutline, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasOutline, reasons, includeReasons);
</ins><span class="cx"> if (flow.isRubyText() || flow.isRubyBase())
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowIsRuby, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowIsRuby, reasons, includeReasons);
</ins><span class="cx"> // Printing does pagination without a flow thread.
</span><span class="cx"> if (flow.document().paginated())
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowIsPaginated, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowIsPaginated, reasons, includeReasons);
</ins><span class="cx"> if (flow.isAnonymous() && flow.firstLineBlock())
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasPseudoFirstLine, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasPseudoFirstLine, reasons, includeReasons);
</ins><span class="cx"> if (flow.isAnonymousBlock() && flow.parent()->style().textOverflow())
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasTextOverflow, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasTextOverflow, reasons, includeReasons);
</ins><span class="cx"> if (flow.parent()->isDeprecatedFlexibleBox())
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowIsDepricatedFlexBox, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowIsDepricatedFlexBox, reasons, includeReasons);
</ins><span class="cx"> // FIXME: Placeholders do something strange.
</span><span class="cx"> if (is<RenderTextControl>(*flow.parent()) && downcast<RenderTextControl>(*flow.parent()).textFormControlElement().placeholderElement())
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowParentIsPlaceholderElement, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowParentIsPlaceholderElement, reasons, includeReasons);
</ins><span class="cx"> // FIXME: Implementation of wrap=hard looks into lineboxes.
</span><span class="cx"> if (flow.parent()->isTextArea() && flow.parent()->element()->fastHasAttribute(HTMLNames::wrapAttr))
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowParentIsTextAreaWithWrapping, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowParentIsTextAreaWithWrapping, reasons, includeReasons);
</ins><span class="cx"> // This currently covers <blockflow>#text</blockflow>, <blockflow>#text<br></blockflow> and mutiple (sibling) RenderText cases.
</span><span class="cx"> // The <blockflow><inline>#text</inline></blockflow> case is also popular and should be relatively easy to cover.
</span><span class="cx"> for (const auto* child = flow.firstChild(); child;) {
</span><span class="lines">@@ -308,12 +309,12 @@
</span><span class="cx"> child = child->nextSibling();
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasNonSupportedChild, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasNonSupportedChild, reasons, includeReasons);
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><del>- auto styleReasons = canUseForStyle(flow.style(), fallthrough);
</del><ins>+ auto styleReasons = canUseForStyle(flow.style(), includeReasons);
</ins><span class="cx"> if (styleReasons != NoReason)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, styleReasons, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(styleReasons, reasons, includeReasons);
</ins><span class="cx"> // We can't use the code path if any lines would need to be shifted below floats. This is because we don't keep per-line y coordinates.
</span><span class="cx"> if (flow.containsFloats()) {
</span><span class="cx"> float minimumWidthNeeded = std::numeric_limits<float>::max();
</span><span class="lines">@@ -326,23 +327,23 @@
</span><span class="cx"> // if a float has a shape, we cannot tell if content will need to be shifted until after we lay it out,
</span><span class="cx"> // since the amount of space is not uniform for the height of the float.
</span><span class="cx"> if (floatingObject->renderer().shapeOutsideInfo())
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasUnsupportedFloat, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasUnsupportedFloat, reasons, includeReasons);
</ins><span class="cx"> #endif
</span><span class="cx"> float availableWidth = flow.availableLogicalWidthForLine(floatingObject->y(), false);
</span><span class="cx"> if (availableWidth < minimumWidthNeeded)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, FlowHasUnsupportedFloat, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasUnsupportedFloat, reasons, includeReasons);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>- auto fontAndTextReasons = canUseForFontAndText(flow, fallthrough);
</del><ins>+ auto fontAndTextReasons = canUseForFontAndText(flow, includeReasons);
</ins><span class="cx"> if (fontAndTextReasons != NoReason)
</span><del>- SET_REASON_AND_RETURN_IF_NEEDED(reasons, fontAndTextReasons, fallthrough);
</del><ins>+ SET_REASON_AND_RETURN_IF_NEEDED(fontAndTextReasons, reasons, includeReasons);
</ins><span class="cx"> return reasons;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool canUseFor(const RenderBlockFlow& flow)
</span><span class="cx"> {
</span><del>- return canUseForWithReason(flow, FallThrough::No) == NoReason;
</del><ins>+ return canUseForWithReason(flow, IncludeReasons::First) == NoReason;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static float computeLineLeft(ETextAlign textAlign, float availableWidth, float committedWidth, float logicalLeftOffset)
</span><span class="lines">@@ -1009,7 +1010,7 @@
</span><span class="cx"> TextStream stream;
</span><span class="cx"> stream << "---------------------------------------------------\n";
</span><span class="cx"> for (const auto* flow : leafRenderers) {
</span><del>- auto reason = canUseForWithReason(*flow, FallThrough::Yes);
</del><ins>+ auto reason = canUseForWithReason(*flow, IncludeReasons::All);
</ins><span class="cx"> if (reason == NoReason)
</span><span class="cx"> continue;
</span><span class="cx"> unsigned printedLength = 30;
</span><span class="lines">@@ -1041,7 +1042,7 @@
</span><span class="cx"> for (const auto* flow : leafRenderers) {
</span><span class="cx"> auto flowLength = textLengthForSubtree(*flow);
</span><span class="cx"> textLength += flowLength;
</span><del>- auto reasons = canUseForWithReason(*flow, FallThrough::Yes);
</del><ins>+ auto reasons = canUseForWithReason(*flow, IncludeReasons::All);
</ins><span class="cx"> if (reasons == NoReason)
</span><span class="cx"> continue;
</span><span class="cx"> ++numberOfUnsupportedLeafBlocks;
</span></span></pre>
</div>
</div>
</body>
</html>