Rename ComplexLineLayout to LegacyLineLayout
https://bugs.webkit.org/show_bug.cgi?id=226482

Reviewed by Alan Bujtas.

Since we now handle most inline content with LFC, rename the legacy path as "legacy".

* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/integration/LayoutIntegrationInlineContentBuilder.cpp:
(WebCore::LayoutIntegration::lineOverflowWidth):
* rendering/InlineIterator.h:
(WebCore::IsolateTracker::addFakeRunIfNecessary):
(WebCore::InlineBidiResolver::appendRunInternal):
* rendering/LegacyLineLayout.cpp: Renamed from Source/WebCore/rendering/ComplexLineLayout.cpp.
(WebCore::LegacyLineLayout::LegacyLineLayout):
(WebCore::LegacyLineLayout::~LegacyLineLayout):
(WebCore::determineDirectionality):
(WebCore::createRun):
(WebCore::LegacyLineLayout::appendRunsForObject):
(WebCore::LegacyLineLayout::createRootInlineBox):
(WebCore::LegacyLineLayout::createAndAppendRootInlineBox):
(WebCore::LegacyLineLayout::createInlineBoxForRenderer):
(WebCore::dirtyLineBoxesForRenderer):
(WebCore::parentIsConstructedOrHaveNext):
(WebCore::LegacyLineLayout::createLineBoxes):
(WebCore::endsWithHTMLSpaces):
(WebCore::reachedEndOfTextRenderer):
(WebCore::LegacyLineLayout::constructLine):
(WebCore::LegacyLineLayout::textAlignmentForLine const):
(WebCore::updateLogicalWidthForLeftAlignedBlock):
(WebCore::updateLogicalWidthForRightAlignedBlock):
(WebCore::updateLogicalWidthForCenterAlignedBlock):
(WebCore::LegacyLineLayout::setMarginsForRubyRun):
(WebCore::setLogicalWidthForTextRun):
(WebCore::LegacyLineLayout::updateRubyForJustifiedText):
(WebCore::LegacyLineLayout::computeExpansionForJustifiedText):
(WebCore::LegacyLineLayout::updateLogicalWidthForAlignment):
(WebCore::updateLogicalInlinePositions):
(WebCore::LegacyLineLayout::computeInlineDirectionPositionsForLine):
(WebCore::expansionBehaviorForInlineTextBox):
(WebCore::applyExpansionBehavior):
(WebCore::inlineAncestorHasStartBorderPaddingOrMargin):
(WebCore::inlineAncestorHasEndBorderPaddingOrMargin):
(WebCore::isLastInFlowRun):
(WebCore::LegacyLineLayout::computeInlineDirectionPositionsForSegment):
(WebCore::LegacyLineLayout::removeInlineBox const):
(WebCore::LegacyLineLayout::computeBlockDirectionPositionsForLine):
(WebCore::isCollapsibleSpace):
(WebCore::findFirstTrailingSpace):
(WebCore::LegacyLineLayout::handleTrailingSpaces):
(WebCore::LegacyLineLayout::appendFloatingObjectToLastLine):
(WebCore::notifyResolverToResumeInIsolate):
(WebCore::setUpResolverToResumeInIsolate):
(WebCore::constructBidiRunsForSegment):
(WebCore::LegacyLineLayout::createLineBoxesFromBidiRuns):
(WebCore::deleteLineRange):
(WebCore::repaintDirtyFloats):
(WebCore::LegacyLineLayout::layoutRunsAndFloats):
(WebCore::LegacyLineLayout::restartLayoutRunsAndFloatsInRange):
(WebCore::LegacyLineLayout::layoutRunsAndFloatsInRange):
(WebCore::LegacyLineLayout::reattachCleanLineFloats):
(WebCore::LegacyLineLayout::linkToEndLineIfNeeded):
(WebCore::LegacyLineLayout::layoutLineBoxes):
(WebCore::LegacyLineLayout::checkFloatInCleanLine):
(WebCore::LegacyLineLayout::determineStartPosition):
(WebCore::LegacyLineLayout::determineEndPosition):
(WebCore::LegacyLineLayout::checkPaginationAndFloatsAtEndLine):
(WebCore::LegacyLineLayout::lineWidthForPaginatedLineChanged const):
(WebCore::LegacyLineLayout::matchedEndLine):
(WebCore::LegacyLineLayout::addOverflowFromInlineChildren):
(WebCore::LegacyLineLayout::lineCount const):
(WebCore::LegacyLineLayout::lineCountUntil const):
(WebCore::LegacyLineLayout::deleteEllipsisLineBoxes):
(WebCore::LegacyLineLayout::checkLinesForTextOverflow):
(WebCore::LegacyLineLayout::positionNewFloatOnLine):
(WebCore::LegacyLineLayout::updateFragmentForLine const):
(WebCore::LegacyLineLayout::style const):
(WebCore::LegacyLineLayout::layoutContext const):
* rendering/LegacyLineLayout.h: Renamed from Source/WebCore/rendering/ComplexLineLayout.h.
(WebCore::LegacyLineLayout::lineBoxes):
(WebCore::LegacyLineLayout::lineBoxes const):
(WebCore::LegacyLineLayout::firstRootBox const):
(WebCore::LegacyLineLayout::lastRootBox const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::willBeDestroyed):
(WebCore::RenderBlockFlow::layoutInlineChildren):
(WebCore::RenderBlockFlow::startAlignedOffsetForLine):
(WebCore::RenderBlockFlow::adjustLinePositionForPagination):
(WebCore::RenderBlockFlow::styleDidChange):
(WebCore::RenderBlockFlow::hitTestInlineChildren):
(WebCore::RenderBlockFlow::addOverflowFromInlineChildren):
(WebCore::RenderBlockFlow::inlineBlockBaseline const):
(WebCore::RenderBlockFlow::lineCount const):
(WebCore::RenderBlockFlow::paintInlineChildren):
(WebCore::RenderBlockFlow::hasLines const):
(WebCore::RenderBlockFlow::ensureLineBoxes):
* rendering/RenderBlockFlow.h:
(WebCore::RenderBlockFlow::firstRootBox const):
(WebCore::RenderBlockFlow::lastRootBox const):
(WebCore::RenderBlockFlow::hasLegacyLineLayout const):
(WebCore::RenderBlockFlow::legacyLineLayout const):
(WebCore::RenderBlockFlow::legacyLineLayout):
(WebCore::RenderBlockFlow::hasComplexLineLayout const): Deleted.
(WebCore::RenderBlockFlow::complexLineLayout const): Deleted.
(WebCore::RenderBlockFlow::complexLineLayout): Deleted.
* rendering/RenderText.cpp:
(WebCore::RenderText::usesLegacyLineLayoutPath const):
(WebCore::RenderText::usesComplexLineLayoutPath const): Deleted.
* rendering/RenderText.h:
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::removeLineBoxFromRenderObject):
(WebCore::RootInlineBox::extractLineBoxFromRenderObject):
(WebCore::RootInlineBox::attachLineBoxToRenderObject):
* rendering/line/LineBreaker.cpp:
(WebCore::LineBreaker::skipLeadingWhitespace):
* rendering/line/LineBreaker.h:
(WebCore::LineBreaker::positionNewFloatOnLine):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@278305 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/rendering/RenderBlockFlow.cpp b/Source/WebCore/rendering/RenderBlockFlow.cpp
index a20c85f..fe75a6b 100644
--- a/Source/WebCore/rendering/RenderBlockFlow.cpp
+++ b/Source/WebCore/rendering/RenderBlockFlow.cpp
@@ -24,7 +24,6 @@
 #include "config.h"
 #include "RenderBlockFlow.h"
 
-#include "ComplexLineLayout.h"
 #include "Editor.h"
 #include "FloatingObjects.h"
 #include "Frame.h"
@@ -40,6 +39,7 @@
 #include "LayoutIntegrationLineLayout.h"
 #include "LayoutIntegrationRunIterator.h"
 #include "LayoutRepainter.h"
+#include "LegacyLineLayout.h"
 #include "Logging.h"
 #include "RenderCombineText.h"
 #include "RenderFlexibleBox.h"
@@ -154,8 +154,8 @@
             parent()->dirtyLinesFromChangedChild(*this);
     }
 
-    if (complexLineLayout())
-        complexLineLayout()->lineBoxes().deleteLineBoxes();
+    if (legacyLineLayout())
+        legacyLineLayout()->lineBoxes().deleteLineBoxes();
 
     blockWillBeDestroyed();
 
@@ -700,10 +700,10 @@
     }
 #endif
 
-    if (!complexLineLayout())
-        m_lineLayout = makeUnique<ComplexLineLayout>(*this);
+    if (!legacyLineLayout())
+        m_lineLayout = makeUnique<LegacyLineLayout>(*this);
 
-    complexLineLayout()->layoutLineBoxes(relayoutChildren, repaintLogicalTop, repaintLogicalBottom);
+    legacyLineLayout()->layoutLineBoxes(relayoutChildren, repaintLogicalTop, repaintLogicalBottom);
 }
 
 void RenderBlockFlow::layoutBlockChild(RenderBox& child, MarginInfo& marginInfo, LayoutUnit& previousFloatLogicalBottom, LayoutUnit& maxFloatLogicalBottom)
@@ -970,7 +970,7 @@
     float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), DoNotIndentText);
     float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), DoNotIndentText) - logicalLeft;
 
-    ComplexLineLayout::updateLogicalWidthForAlignment(*this, textAlign, nullptr, nullptr, logicalLeft, totalLogicalWidth, availableLogicalWidth, 0);
+    LegacyLineLayout::updateLogicalWidthForAlignment(*this, textAlign, nullptr, nullptr, logicalLeft, totalLogicalWidth, availableLogicalWidth, 0);
 
     if (!style().isLeftToRightDirection())
         return LayoutUnit(logicalWidth() - logicalLeft);
@@ -1802,7 +1802,7 @@
     LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset, ExcludePageBoundary);
     overflowsFragment = (lineHeight > remainingLogicalHeight);
 
-    int lineIndex = complexLineLayout()->lineCountUntil(lineBox);
+    int lineIndex = legacyLineLayout()->lineCountUntil(lineBox);
     if (remainingLogicalHeight < lineHeight || (shouldBreakAtLineToAvoidWidow() && lineBreakToAvoidWidow() == lineIndex)) {
         if (lineBreakToAvoidWidow() == lineIndex)
             clearShouldBreakAtLineToAvoidWidowIfNeeded(*this);
@@ -2131,7 +2131,7 @@
 
     if (diff >= StyleDifference::Repaint) {
         auto shouldInvalidateLineLayoutPath = [&] {
-            if (selfNeedsLayout() || complexLineLayout())
+            if (selfNeedsLayout() || legacyLineLayout())
                 return true;
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
             if (modernLineLayout() && !LayoutIntegration::LineLayout::canUseForAfterStyleChange(*this, diff))
@@ -3017,7 +3017,7 @@
         return modernLineLayout()->hitTest(request, result, locationInContainer, accumulatedOffset, hitTestAction);
 #endif
 
-    return complexLineLayout() && complexLineLayout()->lineBoxes().hitTest(this, request, result, locationInContainer, accumulatedOffset, hitTestAction);
+    return legacyLineLayout() && legacyLineLayout()->lineBoxes().hitTest(this, request, result, locationInContainer, accumulatedOffset, hitTestAction);
 }
 
 void RenderBlockFlow::addOverflowFromInlineChildren()
@@ -3029,8 +3029,8 @@
     }
 #endif
     
-    if (complexLineLayout())
-        complexLineLayout()->addOverflowFromInlineChildren();
+    if (legacyLineLayout())
+        legacyLineLayout()->addOverflowFromInlineChildren();
 }
 
 void RenderBlockFlow::adjustForBorderFit(LayoutUnit x, LayoutUnit& left, LayoutUnit& right) const
@@ -3188,7 +3188,7 @@
                 + (lineDirection == HorizontalLine ? borderTop() + paddingTop() : borderRight() + paddingRight())).toInt() };
         }
 
-        if (complexLineLayout()) {
+        if (legacyLineLayout()) {
             bool isFirstLine = lastRootBox() == firstRootBox();
             const auto& style = isFirstLine ? firstLineStyle() : this->style();
             // InlineFlowBox::placeBoxesInBlockDirection will flip lines in case of verticalLR mode, so we can assume verticalRL for now.
@@ -3341,8 +3341,8 @@
         if (modernLineLayout())
             return modernLineLayout()->lineCount();
 #endif
-        if (complexLineLayout())
-            return complexLineLayout()->lineCount();
+        if (legacyLineLayout())
+            return legacyLineLayout()->lineCount();
 
         return 0;
     }
@@ -3593,8 +3593,8 @@
     }
 #endif
 
-    if (complexLineLayout())
-        complexLineLayout()->lineBoxes().paint(this, paintInfo, paintOffset);
+    if (legacyLineLayout())
+        legacyLineLayout()->lineBoxes().paint(this, paintInfo, paintOffset);
 }
 
 bool RenderBlockFlow::relayoutForPagination()
@@ -3651,7 +3651,7 @@
         return modernLineLayout()->lineCount();
 #endif
 
-    return complexLineLayout() && complexLineLayout()->lineBoxes().firstLineBox();
+    return legacyLineLayout() && legacyLineLayout()->lineBoxes().firstLineBox();
 }
 
 void RenderBlockFlow::invalidateLineLayoutPath()
@@ -3758,7 +3758,7 @@
 
     setLineLayoutPath(ForceLineBoxesPath);
 
-    if (complexLineLayout() || !hasLineLayout())
+    if (legacyLineLayout() || !hasLineLayout())
         return;
 
     bool needsToPaginateComplexLines = [&] {
@@ -3769,9 +3769,9 @@
         return false;
     }();
 
-    m_lineLayout = makeUnique<ComplexLineLayout>(*this);
+    m_lineLayout = makeUnique<LegacyLineLayout>(*this);
 
-    auto& complexLineLayout = *this->complexLineLayout();
+    auto& legacyLineLayout = *this->legacyLineLayout();
 
 #if ASSERT_ENABLED
     LayoutUnit oldHeight = logicalHeight();
@@ -3783,14 +3783,14 @@
     LayoutUnit repaintLogicalBottom;
     if (needsToPaginateComplexLines) {
         PaginatedLayoutStateMaintainer state(*this);
-        complexLineLayout.layoutLineBoxes(relayoutChildren, repaintLogicalTop, repaintLogicalBottom);
+        legacyLineLayout.layoutLineBoxes(relayoutChildren, repaintLogicalTop, repaintLogicalBottom);
         // This matches relayoutToAvoidWidows.
         if (shouldBreakAtLineToAvoidWidow())
-            complexLineLayout.layoutLineBoxes(relayoutChildren, repaintLogicalTop, repaintLogicalBottom);
+            legacyLineLayout.layoutLineBoxes(relayoutChildren, repaintLogicalTop, repaintLogicalBottom);
         // FIXME: This is needed as long as simple and normal line layout produce different line breakings.
         repaint();
     } else
-        complexLineLayout.layoutLineBoxes(relayoutChildren, repaintLogicalTop, repaintLogicalBottom);
+        legacyLineLayout.layoutLineBoxes(relayoutChildren, repaintLogicalTop, repaintLogicalBottom);
 
     updateLogicalHeight();
     ASSERT(didNeedLayout || ceilf(logicalHeight()) == ceilf(oldHeight));