<!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>[278525] 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/278525">278525</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2021-06-05 05:19:10 -0700 (Sat, 05 Jun 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Rename InlineTextBox to LegacyInlineTextBox
https://bugs.webkit.org/show_bug.cgi?id=226633

Rubber-stamped by Sam Weinig.

More legacy line layout naming.

* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/ContainerNode.cpp:
* dom/DocumentMarkerController.cpp:
(WebCore::DocumentMarkerController::addMarker):
* dom/Position.cpp:
* editing/CompositeEditCommand.cpp:
* editing/Editor.h:
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::debugRenderer const):
* editing/RenderedPosition.cpp:
* editing/TextIterator.cpp:
* editing/VisiblePosition.cpp:
* layout/Verification.cpp:
(WebCore::Layout::checkForMatchingTextRuns):
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
* layout/formattingContexts/inline/text/TextUtil.h:
* layout/integration/LayoutIntegrationRunIterator.cpp:
(WebCore::LayoutIntegration::firstTextRunInTextOrderFor):
* layout/integration/LayoutIntegrationRunIterator.h:
(WebCore::LayoutIntegration::PathTextRun::legacyInlineBox const):
* layout/integration/LayoutIntegrationRunIteratorLegacyPath.h:
(WebCore::LayoutIntegration::RunIteratorLegacyPath::traverseNextTextRunInTextOrder):
(WebCore::LayoutIntegration::RunIteratorLegacyPath::inlineTextBox const):
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::isInlineTextBox const):
* layout/layouttree/LayoutInlineTextBox.cpp:
(WebCore::Layout::InlineTextBox::InlineTextBox):
* rendering/CaretRectComputation.cpp:
(WebCore::computeCaretRectForSVGInlineText):
* rendering/EllipsisBox.cpp:
* rendering/LegacyInlineBox.h:
* rendering/LegacyInlineFlowBox.cpp:
(WebCore::LegacyInlineFlowBox::addToLine):
(WebCore::LegacyInlineFlowBox::placeBoxRangeInInlineDirection):
(WebCore::LegacyInlineFlowBox::requiresIdeographicBaseline const):
(WebCore::LegacyInlineFlowBox::placeBoxesInBlockDirection):
(WebCore::LegacyInlineFlowBox::addTextBoxVisualOverflow):
(WebCore::LegacyInlineFlowBox::computeOverflow):
(WebCore::LegacyInlineFlowBox::computeOverAnnotationAdjustment const):
(WebCore::LegacyInlineFlowBox::computeUnderAnnotationAdjustment const):
* rendering/LegacyInlineFlowBox.h:
* rendering/LegacyInlineTextBox.cpp: Renamed from Source/WebCore/rendering/InlineTextBox.cpp.
(WebCore::LegacyInlineTextBox::~LegacyInlineTextBox):
(WebCore::LegacyInlineTextBox::hasTextContent const):
(WebCore::LegacyInlineTextBox::markDirty):
(WebCore::LegacyInlineTextBox::logicalOverflowRect const):
(WebCore::LegacyInlineTextBox::setLogicalOverflowRect):
(WebCore::LegacyInlineTextBox::baselinePosition const):
(WebCore::LegacyInlineTextBox::lineHeight const):
(WebCore::LegacyInlineTextBox::selectionTop const):
(WebCore::LegacyInlineTextBox::selectionBottom const):
(WebCore::LegacyInlineTextBox::selectionHeight const):
(WebCore::LegacyInlineTextBox::isSelected const):
(WebCore::LegacyInlineTextBox::selectionState):
(WebCore::LegacyInlineTextBox::verifySelectionState const):
(WebCore::LegacyInlineTextBox::lineFont const):
(WebCore::snappedSelectionRect):
(WebCore::LegacyInlineTextBox::localSelectionRect const):
(WebCore::LegacyInlineTextBox::deleteLine):
(WebCore::LegacyInlineTextBox::extractLine):
(WebCore::LegacyInlineTextBox::attachLine):
(WebCore::LegacyInlineTextBox::placeEllipsisBox):
(WebCore::LegacyInlineTextBox::isLineBreak const):
(WebCore::LegacyInlineTextBox::nodeAtPoint):
(WebCore::LegacyInlineTextBox::emphasisMarkExistsAndIsAbove const):
(WebCore::createMarkedTextFromSelectionInBox):
(WebCore::LegacyInlineTextBox::paint):
(WebCore::LegacyInlineTextBox::clampedOffset const):
(WebCore::LegacyInlineTextBox::clampedStartEndForState const):
(WebCore::LegacyInlineTextBox::selectionStartEnd const):
(WebCore::LegacyInlineTextBox::highlightStartEnd const):
(WebCore::LegacyInlineTextBox::hasMarkers const):
(WebCore::LegacyInlineTextBox::paintPlatformDocumentMarkers):
(WebCore::LegacyInlineTextBox::calculateUnionOfAllDocumentMarkerBounds const):
(WebCore::LegacyInlineTextBox::calculateDocumentMarkerBounds const):
(WebCore::LegacyInlineTextBox::paintPlatformDocumentMarker):
(WebCore::LegacyInlineTextBox::collectMarkedTextsForDraggedContent):
(WebCore::LegacyInlineTextBox::collectMarkedTextsForDocumentMarkers const):
(WebCore::LegacyInlineTextBox::collectMarkedTextsForHighlights const):
(WebCore::LegacyInlineTextBox::textOriginFromBoxRect const):
(WebCore::LegacyInlineTextBox::paintMarkedTexts):
(WebCore::LegacyInlineTextBox::paintMarkedTextBackground):
(WebCore::LegacyInlineTextBox::paintMarkedTextForeground):
(WebCore::LegacyInlineTextBox::paintMarkedTextDecoration):
(WebCore::LegacyInlineTextBox::paintCompositionBackground):
(WebCore::LegacyInlineTextBox::paintCompositionUnderlines const):
(WebCore::mirrorRTLSegment):
(WebCore::LegacyInlineTextBox::paintCompositionUnderline const):
(WebCore::LegacyInlineTextBox::caretMinOffset const):
(WebCore::LegacyInlineTextBox::caretMaxOffset const):
(WebCore::LegacyInlineTextBox::textPos const):
(WebCore::LegacyInlineTextBox::offsetForPosition const):
(WebCore::LegacyInlineTextBox::positionForOffset const):
(WebCore::LegacyInlineTextBox::createTextRun const):
(WebCore::LegacyInlineTextBox::text const):
(WebCore::LegacyInlineTextBox::combinedText const):
(WebCore::LegacyInlineTextBox::debugTextShadow):
(WebCore::LegacyInlineTextBox::expansionBehavior const):
(WebCore::LegacyInlineTextBox::boxName const):
(WebCore::LegacyInlineTextBox::outputLineBox const):
* rendering/LegacyInlineTextBox.h: Renamed from Source/WebCore/rendering/InlineTextBox.h.
(WebCore::LegacyInlineTextBox::LegacyInlineTextBox):
(WebCore::LegacyInlineTextBox::renderer const):
(WebCore::LegacyInlineTextBox::lineStyle const):
(WebCore::LegacyInlineTextBox::prevTextBox const):
(WebCore::LegacyInlineTextBox::nextTextBox const):
(WebCore::LegacyInlineTextBox::setNextTextBox):
(WebCore::LegacyInlineTextBox::setPreviousTextBox):
(WebCore::LegacyInlineTextBox::start const):
(WebCore::LegacyInlineTextBox::end const):
(WebCore::LegacyInlineTextBox::len const):
(WebCore::LegacyInlineTextBox::setStart):
(WebCore::LegacyInlineTextBox::setLen):
(WebCore::LegacyInlineTextBox::offsetRun):
(WebCore::LegacyInlineTextBox::truncation const):
(WebCore::LegacyInlineTextBox::compareByStart):
(WebCore::LegacyInlineTextBox::logicalTopVisualOverflow const):
(WebCore::LegacyInlineTextBox::logicalBottomVisualOverflow const):
(WebCore::LegacyInlineTextBox::logicalLeftVisualOverflow const):
(WebCore::LegacyInlineTextBox::logicalRightVisualOverflow const):
(WebCore::LegacyInlineTextBox::dirtyOwnLineBoxes):
(WebCore::LegacyInlineTextBox::paintMarkedTexts):
* rendering/LegacyLineLayout.cpp:
(WebCore::LegacyLineLayout::constructLine):
(WebCore::setLogicalWidthForTextRun):
(WebCore::LegacyLineLayout::computeExpansionForJustifiedText):
(WebCore::expansionBehaviorForInlineTextBox):
(WebCore::applyExpansionBehavior):
(WebCore::LegacyLineLayout::computeInlineDirectionPositionsForSegment):
(WebCore::LegacyLineLayout::removeInlineBox const):
(WebCore::LegacyLineLayout::computeBlockDirectionPositionsForLine):
(WebCore::LegacyLineLayout::createLineBoxesFromBidiRuns):
* rendering/LegacyRootInlineBox.cpp:
(WebCore::LegacyRootInlineBox::isHyphenated const):
(WebCore::LegacyRootInlineBox::ascentAndDescentForBox const):
* rendering/RenderBlock.cpp:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::inlineSelectionGaps):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::generateCulledLineBoxRects const):
(WebCore::RenderInline::culledInlineVisualOverflowBoundingBox const):
(WebCore::RenderInline::dirtyLineBoxes):
* rendering/RenderLineBoxList.cpp:
(WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
* rendering/RenderText.cpp:
(WebCore::RenderText::absoluteQuadsForRange const):
(WebCore::RenderText::createTextBox):
(WebCore::RenderText::positionLineBox):
* rendering/RenderText.h:
(WebCore::RenderText::extractTextBox):
(WebCore::RenderText::attachTextBox):
(WebCore::RenderText::removeTextBox):
(WebCore::RenderText::createInlineTextBox):
(WebCore::RenderText::firstTextBox const):
(WebCore::RenderText::lastTextBox const):
(WebCore::RenderText::findNextInlineTextBox const):
* rendering/RenderTextLineBoxes.cpp:
(WebCore::RenderTextLineBoxes::createAndAppendLineBox):
(WebCore::RenderTextLineBoxes::extract):
(WebCore::RenderTextLineBoxes::attach):
(WebCore::RenderTextLineBoxes::remove):
(WebCore::RenderTextLineBoxes::deleteAll):
(WebCore::RenderTextLineBoxes::findNext const):
(WebCore::RenderTextLineBoxes::checkConsistency const):
* rendering/RenderTextLineBoxes.h:
(WebCore::RenderTextLineBoxes::first const):
(WebCore::RenderTextLineBoxes::last const):
* rendering/RenderTreeAsText.cpp:
* rendering/TextDecorationPainter.h:
(WebCore::TextDecorationPainter::setInlineTextBox):
* rendering/TextPainter.cpp:
(WebCore::TextPainter::clearGlyphDisplayLists):
* rendering/svg/RenderSVGInlineText.cpp:
(WebCore::RenderSVGInlineText::createTextBox):
* rendering/svg/RenderSVGInlineText.h:
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::SVGInlineTextBox):
(WebCore::SVGInlineTextBox::dirtyOwnLineBoxes):
(WebCore::SVGInlineTextBox::dirtyLineBoxes):
(WebCore::SVGInlineTextBox::offsetForPositionInFragment const):
(WebCore::SVGInlineTextBox::paint):
(WebCore::SVGInlineTextBox::nodeAtPoint):
* rendering/svg/SVGInlineTextBox.h:
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::writeSVGInlineTextBoxes):
* style/InlineTextBoxStyle.cpp:
(WebCore::computeUnderlineOffset):
(WebCore::visualOverflowForDecorations):
* style/InlineTextBoxStyle.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreHeaderscmake">trunk/Source/WebCore/Headers.cmake</a></li>
<li><a href="#trunkSourceWebCoreSourcestxt">trunk/Source/WebCore/Sources.txt</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityatkWebKitAccessibleInterfaceTextcpp">trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp</a></li>
<li><a href="#trunkSourceWebCoredomContainerNodecpp">trunk/Source/WebCore/dom/ContainerNode.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumentMarkerControllercpp">trunk/Source/WebCore/dom/DocumentMarkerController.cpp</a></li>
<li><a href="#trunkSourceWebCoredomPositioncpp">trunk/Source/WebCore/dom/Position.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingCompositeEditCommandcpp">trunk/Source/WebCore/editing/CompositeEditCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorh">trunk/Source/WebCore/editing/Editor.h</a></li>
<li><a href="#trunkSourceWebCoreeditingFrameSelectioncpp">trunk/Source/WebCore/editing/FrameSelection.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingRenderedPositioncpp">trunk/Source/WebCore/editing/RenderedPosition.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingTextIteratorcpp">trunk/Source/WebCore/editing/TextIterator.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingVisiblePositioncpp">trunk/Source/WebCore/editing/VisiblePosition.cpp</a></li>
<li><a href="#trunkSourceWebCorelayoutVerificationcpp">trunk/Source/WebCore/layout/Verification.cpp</a></li>
<li><a href="#trunkSourceWebCorelayoutformattingContextsinlinetextTextUtilh">trunk/Source/WebCore/layout/formattingContexts/inline/text/TextUtil.h</a></li>
<li><a href="#trunkSourceWebCorelayoutintegrationLayoutIntegrationRunIteratorcpp">trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIterator.cpp</a></li>
<li><a href="#trunkSourceWebCorelayoutintegrationLayoutIntegrationRunIteratorh">trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIterator.h</a></li>
<li><a href="#trunkSourceWebCorelayoutintegrationLayoutIntegrationRunIteratorLegacyPathh">trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIteratorLegacyPath.h</a></li>
<li><a href="#trunkSourceWebCorelayoutlayouttreeLayoutBoxh">trunk/Source/WebCore/layout/layouttree/LayoutBox.h</a></li>
<li><a href="#trunkSourceWebCorelayoutlayouttreeLayoutInlineTextBoxcpp">trunk/Source/WebCore/layout/layouttree/LayoutInlineTextBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingCaretRectComputationcpp">trunk/Source/WebCore/rendering/CaretRectComputation.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingEllipsisBoxcpp">trunk/Source/WebCore/rendering/EllipsisBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingLegacyInlineBoxh">trunk/Source/WebCore/rendering/LegacyInlineBox.h</a></li>
<li><a href="#trunkSourceWebCorerenderingLegacyInlineFlowBoxcpp">trunk/Source/WebCore/rendering/LegacyInlineFlowBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingLegacyInlineFlowBoxh">trunk/Source/WebCore/rendering/LegacyInlineFlowBox.h</a></li>
<li><a href="#trunkSourceWebCorerenderingLegacyLineLayoutcpp">trunk/Source/WebCore/rendering/LegacyLineLayout.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingLegacyRootInlineBoxcpp">trunk/Source/WebCore/rendering/LegacyRootInlineBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockcpp">trunk/Source/WebCore/rendering/RenderBlock.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockFlowcpp">trunk/Source/WebCore/rendering/RenderBlockFlow.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxModelObjectcpp">trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderInlinecpp">trunk/Source/WebCore/rendering/RenderInline.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLineBoxListcpp">trunk/Source/WebCore/rendering/RenderLineBoxList.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTextcpp">trunk/Source/WebCore/rendering/RenderText.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTexth">trunk/Source/WebCore/rendering/RenderText.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTextLineBoxescpp">trunk/Source/WebCore/rendering/RenderTextLineBoxes.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTextLineBoxesh">trunk/Source/WebCore/rendering/RenderTextLineBoxes.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTreeAsTextcpp">trunk/Source/WebCore/rendering/RenderTreeAsText.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingTextDecorationPainterh">trunk/Source/WebCore/rendering/TextDecorationPainter.h</a></li>
<li><a href="#trunkSourceWebCorerenderingTextPaintercpp">trunk/Source/WebCore/rendering/TextPainter.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGInlineTextcpp">trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGInlineTexth">trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGInlineTextBoxcpp">trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGInlineTextBoxh">trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGRenderTreeAsTextcpp">trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleInlineTextBoxStylecpp">trunk/Source/WebCore/style/InlineTextBoxStyle.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleInlineTextBoxStyleh">trunk/Source/WebCore/style/InlineTextBoxStyle.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorerenderingLegacyInlineTextBoxcpp">trunk/Source/WebCore/rendering/LegacyInlineTextBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingLegacyInlineTextBoxh">trunk/Source/WebCore/rendering/LegacyInlineTextBox.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorerenderingInlineTextBoxcpp">trunk/Source/WebCore/rendering/InlineTextBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineTextBoxh">trunk/Source/WebCore/rendering/InlineTextBox.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/ChangeLog      2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -1,3 +1,206 @@
</span><ins>+2021-06-05  Antti Koivisto  <antti@apple.com>
+
+        Rename InlineTextBox to LegacyInlineTextBox
+        https://bugs.webkit.org/show_bug.cgi?id=226633
+
+        Rubber-stamped by Sam Weinig.
+
+        More legacy line layout naming.
+
+        * Headers.cmake:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/ContainerNode.cpp:
+        * dom/DocumentMarkerController.cpp:
+        (WebCore::DocumentMarkerController::addMarker):
+        * dom/Position.cpp:
+        * editing/CompositeEditCommand.cpp:
+        * editing/Editor.h:
+        * editing/FrameSelection.cpp:
+        (WebCore::FrameSelection::debugRenderer const):
+        * editing/RenderedPosition.cpp:
+        * editing/TextIterator.cpp:
+        * editing/VisiblePosition.cpp:
+        * layout/Verification.cpp:
+        (WebCore::Layout::checkForMatchingTextRuns):
+        (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
+        * layout/formattingContexts/inline/text/TextUtil.h:
+        * layout/integration/LayoutIntegrationRunIterator.cpp:
+        (WebCore::LayoutIntegration::firstTextRunInTextOrderFor):
+        * layout/integration/LayoutIntegrationRunIterator.h:
+        (WebCore::LayoutIntegration::PathTextRun::legacyInlineBox const):
+        * layout/integration/LayoutIntegrationRunIteratorLegacyPath.h:
+        (WebCore::LayoutIntegration::RunIteratorLegacyPath::traverseNextTextRunInTextOrder):
+        (WebCore::LayoutIntegration::RunIteratorLegacyPath::inlineTextBox const):
+        * layout/layouttree/LayoutBox.h:
+        (WebCore::Layout::Box::isInlineTextBox const):
+        * layout/layouttree/LayoutInlineTextBox.cpp:
+        (WebCore::Layout::InlineTextBox::InlineTextBox):
+        * rendering/CaretRectComputation.cpp:
+        (WebCore::computeCaretRectForSVGInlineText):
+        * rendering/EllipsisBox.cpp:
+        * rendering/LegacyInlineBox.h:
+        * rendering/LegacyInlineFlowBox.cpp:
+        (WebCore::LegacyInlineFlowBox::addToLine):
+        (WebCore::LegacyInlineFlowBox::placeBoxRangeInInlineDirection):
+        (WebCore::LegacyInlineFlowBox::requiresIdeographicBaseline const):
+        (WebCore::LegacyInlineFlowBox::placeBoxesInBlockDirection):
+        (WebCore::LegacyInlineFlowBox::addTextBoxVisualOverflow):
+        (WebCore::LegacyInlineFlowBox::computeOverflow):
+        (WebCore::LegacyInlineFlowBox::computeOverAnnotationAdjustment const):
+        (WebCore::LegacyInlineFlowBox::computeUnderAnnotationAdjustment const):
+        * rendering/LegacyInlineFlowBox.h:
+        * rendering/LegacyInlineTextBox.cpp: Renamed from Source/WebCore/rendering/InlineTextBox.cpp.
+        (WebCore::LegacyInlineTextBox::~LegacyInlineTextBox):
+        (WebCore::LegacyInlineTextBox::hasTextContent const):
+        (WebCore::LegacyInlineTextBox::markDirty):
+        (WebCore::LegacyInlineTextBox::logicalOverflowRect const):
+        (WebCore::LegacyInlineTextBox::setLogicalOverflowRect):
+        (WebCore::LegacyInlineTextBox::baselinePosition const):
+        (WebCore::LegacyInlineTextBox::lineHeight const):
+        (WebCore::LegacyInlineTextBox::selectionTop const):
+        (WebCore::LegacyInlineTextBox::selectionBottom const):
+        (WebCore::LegacyInlineTextBox::selectionHeight const):
+        (WebCore::LegacyInlineTextBox::isSelected const):
+        (WebCore::LegacyInlineTextBox::selectionState):
+        (WebCore::LegacyInlineTextBox::verifySelectionState const):
+        (WebCore::LegacyInlineTextBox::lineFont const):
+        (WebCore::snappedSelectionRect):
+        (WebCore::LegacyInlineTextBox::localSelectionRect const):
+        (WebCore::LegacyInlineTextBox::deleteLine):
+        (WebCore::LegacyInlineTextBox::extractLine):
+        (WebCore::LegacyInlineTextBox::attachLine):
+        (WebCore::LegacyInlineTextBox::placeEllipsisBox):
+        (WebCore::LegacyInlineTextBox::isLineBreak const):
+        (WebCore::LegacyInlineTextBox::nodeAtPoint):
+        (WebCore::LegacyInlineTextBox::emphasisMarkExistsAndIsAbove const):
+        (WebCore::createMarkedTextFromSelectionInBox):
+        (WebCore::LegacyInlineTextBox::paint):
+        (WebCore::LegacyInlineTextBox::clampedOffset const):
+        (WebCore::LegacyInlineTextBox::clampedStartEndForState const):
+        (WebCore::LegacyInlineTextBox::selectionStartEnd const):
+        (WebCore::LegacyInlineTextBox::highlightStartEnd const):
+        (WebCore::LegacyInlineTextBox::hasMarkers const):
+        (WebCore::LegacyInlineTextBox::paintPlatformDocumentMarkers):
+        (WebCore::LegacyInlineTextBox::calculateUnionOfAllDocumentMarkerBounds const):
+        (WebCore::LegacyInlineTextBox::calculateDocumentMarkerBounds const):
+        (WebCore::LegacyInlineTextBox::paintPlatformDocumentMarker):
+        (WebCore::LegacyInlineTextBox::collectMarkedTextsForDraggedContent):
+        (WebCore::LegacyInlineTextBox::collectMarkedTextsForDocumentMarkers const):
+        (WebCore::LegacyInlineTextBox::collectMarkedTextsForHighlights const):
+        (WebCore::LegacyInlineTextBox::textOriginFromBoxRect const):
+        (WebCore::LegacyInlineTextBox::paintMarkedTexts):
+        (WebCore::LegacyInlineTextBox::paintMarkedTextBackground):
+        (WebCore::LegacyInlineTextBox::paintMarkedTextForeground):
+        (WebCore::LegacyInlineTextBox::paintMarkedTextDecoration):
+        (WebCore::LegacyInlineTextBox::paintCompositionBackground):
+        (WebCore::LegacyInlineTextBox::paintCompositionUnderlines const):
+        (WebCore::mirrorRTLSegment):
+        (WebCore::LegacyInlineTextBox::paintCompositionUnderline const):
+        (WebCore::LegacyInlineTextBox::caretMinOffset const):
+        (WebCore::LegacyInlineTextBox::caretMaxOffset const):
+        (WebCore::LegacyInlineTextBox::textPos const):
+        (WebCore::LegacyInlineTextBox::offsetForPosition const):
+        (WebCore::LegacyInlineTextBox::positionForOffset const):
+        (WebCore::LegacyInlineTextBox::createTextRun const):
+        (WebCore::LegacyInlineTextBox::text const):
+        (WebCore::LegacyInlineTextBox::combinedText const):
+        (WebCore::LegacyInlineTextBox::debugTextShadow):
+        (WebCore::LegacyInlineTextBox::expansionBehavior const):
+        (WebCore::LegacyInlineTextBox::boxName const):
+        (WebCore::LegacyInlineTextBox::outputLineBox const):
+        * rendering/LegacyInlineTextBox.h: Renamed from Source/WebCore/rendering/InlineTextBox.h.
+        (WebCore::LegacyInlineTextBox::LegacyInlineTextBox):
+        (WebCore::LegacyInlineTextBox::renderer const):
+        (WebCore::LegacyInlineTextBox::lineStyle const):
+        (WebCore::LegacyInlineTextBox::prevTextBox const):
+        (WebCore::LegacyInlineTextBox::nextTextBox const):
+        (WebCore::LegacyInlineTextBox::setNextTextBox):
+        (WebCore::LegacyInlineTextBox::setPreviousTextBox):
+        (WebCore::LegacyInlineTextBox::start const):
+        (WebCore::LegacyInlineTextBox::end const):
+        (WebCore::LegacyInlineTextBox::len const):
+        (WebCore::LegacyInlineTextBox::setStart):
+        (WebCore::LegacyInlineTextBox::setLen):
+        (WebCore::LegacyInlineTextBox::offsetRun):
+        (WebCore::LegacyInlineTextBox::truncation const):
+        (WebCore::LegacyInlineTextBox::compareByStart):
+        (WebCore::LegacyInlineTextBox::logicalTopVisualOverflow const):
+        (WebCore::LegacyInlineTextBox::logicalBottomVisualOverflow const):
+        (WebCore::LegacyInlineTextBox::logicalLeftVisualOverflow const):
+        (WebCore::LegacyInlineTextBox::logicalRightVisualOverflow const):
+        (WebCore::LegacyInlineTextBox::dirtyOwnLineBoxes):
+        (WebCore::LegacyInlineTextBox::paintMarkedTexts):
+        * rendering/LegacyLineLayout.cpp:
+        (WebCore::LegacyLineLayout::constructLine):
+        (WebCore::setLogicalWidthForTextRun):
+        (WebCore::LegacyLineLayout::computeExpansionForJustifiedText):
+        (WebCore::expansionBehaviorForInlineTextBox):
+        (WebCore::applyExpansionBehavior):
+        (WebCore::LegacyLineLayout::computeInlineDirectionPositionsForSegment):
+        (WebCore::LegacyLineLayout::removeInlineBox const):
+        (WebCore::LegacyLineLayout::computeBlockDirectionPositionsForLine):
+        (WebCore::LegacyLineLayout::createLineBoxesFromBidiRuns):
+        * rendering/LegacyRootInlineBox.cpp:
+        (WebCore::LegacyRootInlineBox::isHyphenated const):
+        (WebCore::LegacyRootInlineBox::ascentAndDescentForBox const):
+        * rendering/RenderBlock.cpp:
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::inlineSelectionGaps):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::generateCulledLineBoxRects const):
+        (WebCore::RenderInline::culledInlineVisualOverflowBoundingBox const):
+        (WebCore::RenderInline::dirtyLineBoxes):
+        * rendering/RenderLineBoxList.cpp:
+        (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::absoluteQuadsForRange const):
+        (WebCore::RenderText::createTextBox):
+        (WebCore::RenderText::positionLineBox):
+        * rendering/RenderText.h:
+        (WebCore::RenderText::extractTextBox):
+        (WebCore::RenderText::attachTextBox):
+        (WebCore::RenderText::removeTextBox):
+        (WebCore::RenderText::createInlineTextBox):
+        (WebCore::RenderText::firstTextBox const):
+        (WebCore::RenderText::lastTextBox const):
+        (WebCore::RenderText::findNextInlineTextBox const):
+        * rendering/RenderTextLineBoxes.cpp:
+        (WebCore::RenderTextLineBoxes::createAndAppendLineBox):
+        (WebCore::RenderTextLineBoxes::extract):
+        (WebCore::RenderTextLineBoxes::attach):
+        (WebCore::RenderTextLineBoxes::remove):
+        (WebCore::RenderTextLineBoxes::deleteAll):
+        (WebCore::RenderTextLineBoxes::findNext const):
+        (WebCore::RenderTextLineBoxes::checkConsistency const):
+        * rendering/RenderTextLineBoxes.h:
+        (WebCore::RenderTextLineBoxes::first const):
+        (WebCore::RenderTextLineBoxes::last const):
+        * rendering/RenderTreeAsText.cpp:
+        * rendering/TextDecorationPainter.h:
+        (WebCore::TextDecorationPainter::setInlineTextBox):
+        * rendering/TextPainter.cpp:
+        (WebCore::TextPainter::clearGlyphDisplayLists):
+        * rendering/svg/RenderSVGInlineText.cpp:
+        (WebCore::RenderSVGInlineText::createTextBox):
+        * rendering/svg/RenderSVGInlineText.h:
+        * rendering/svg/SVGInlineTextBox.cpp:
+        (WebCore::SVGInlineTextBox::SVGInlineTextBox):
+        (WebCore::SVGInlineTextBox::dirtyOwnLineBoxes):
+        (WebCore::SVGInlineTextBox::dirtyLineBoxes):
+        (WebCore::SVGInlineTextBox::offsetForPositionInFragment const):
+        (WebCore::SVGInlineTextBox::paint):
+        (WebCore::SVGInlineTextBox::nodeAtPoint):
+        * rendering/svg/SVGInlineTextBox.h:
+        * rendering/svg/SVGRenderTreeAsText.cpp:
+        (WebCore::writeSVGInlineTextBoxes):
+        * style/InlineTextBoxStyle.cpp:
+        (WebCore::computeUnderlineOffset):
+        (WebCore::visualOverflowForDecorations):
+        * style/InlineTextBoxStyle.h:
+
</ins><span class="cx"> 2021-06-05  Cameron McCormack  <heycam@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Diff aspect-ratio property values correctly
</span></span></pre></div>
<a id="trunkSourceWebCoreHeaderscmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Headers.cmake (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Headers.cmake       2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/Headers.cmake  2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -1526,11 +1526,11 @@
</span><span class="cx">     rendering/HitTestRequest.h
</span><span class="cx">     rendering/HitTestResult.h
</span><span class="cx">     rendering/InlineElementBox.h
</span><del>-    rendering/InlineTextBox.h
</del><span class="cx">     rendering/LayerAncestorClippingStack.h
</span><span class="cx">     rendering/LayerFragment.h
</span><span class="cx">     rendering/LegacyInlineBox.h
</span><span class="cx">     rendering/LegacyInlineFlowBox.h
</span><ins>+    rendering/LegacyInlineTextBox.h
</ins><span class="cx">     rendering/LegacyLineLayout.h
</span><span class="cx">     rendering/LegacyRootInlineBox.h
</span><span class="cx">     rendering/MarkedText.h
</span></span></pre></div>
<a id="trunkSourceWebCoreSourcestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Sources.txt (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Sources.txt 2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/Sources.txt    2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -2256,7 +2256,6 @@
</span><span class="cx"> rendering/ImageQualityController.cpp
</span><span class="cx"> rendering/InlineElementBox.cpp
</span><span class="cx"> rendering/InlineIterator.cpp
</span><del>-rendering/InlineTextBox.cpp
</del><span class="cx"> rendering/LayerAncestorClippingStack.cpp
</span><span class="cx"> rendering/LayerOverlapMap.cpp
</span><span class="cx"> rendering/LayoutDisallowedScope.cpp
</span><span class="lines">@@ -2265,6 +2264,7 @@
</span><span class="cx"> rendering/LegacyInlineFlowBox.cpp
</span><span class="cx"> rendering/LegacyLineLayout.cpp
</span><span class="cx"> rendering/LegacyRootInlineBox.cpp
</span><ins>+rendering/LegacyInlineTextBox.cpp
</ins><span class="cx"> rendering/MarkedText.cpp
</span><span class="cx"> rendering/MarkedTextStyle.cpp
</span><span class="cx"> rendering/OrderIterator.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj   2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj      2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -4166,7 +4166,7 @@
</span><span class="cx">          BCE789861120E7A60060ECE5 /* BidiRun.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE789851120E7A60060ECE5 /* BidiRun.h */; };
</span><span class="cx">          BCE93F451517C567008CCF74 /* RenderFragmentContainerSet.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE93F441517C567008CCF74 /* RenderFragmentContainerSet.h */; };
</span><span class="cx">          BCEA4790097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA477D097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-               BCEA485A097D93020094C9E4 /* InlineTextBox.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA481B097D93020094C9E4 /* InlineTextBox.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><ins>+                BCEA485A097D93020094C9E4 /* LegacyInlineTextBox.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA481B097D93020094C9E4 /* LegacyInlineTextBox.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">           BCEA4860097D93020094C9E4 /* RenderBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA4821097D93020094C9E4 /* RenderBlock.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          BCEA4862097D93020094C9E4 /* RenderBox.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA4823097D93020094C9E4 /* RenderBox.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          BCEA4864097D93020094C9E4 /* RenderLineBreak.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA4825097D93020094C9E4 /* RenderLineBreak.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -14487,8 +14487,8 @@
</span><span class="cx">          BCEA4813097D93020094C9E4 /* LegacyLineLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyLineLayout.cpp; sourceTree = "<group>"; };
</span><span class="cx">          BCEA4815097D93020094C9E4 /* BreakLines.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BreakLines.cpp; sourceTree = "<group>"; };
</span><span class="cx">          BCEA4816097D93020094C9E4 /* BreakLines.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BreakLines.h; sourceTree = "<group>"; };
</span><del>-               BCEA481A097D93020094C9E4 /* InlineTextBox.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = InlineTextBox.cpp; sourceTree = "<group>"; };
-               BCEA481B097D93020094C9E4 /* InlineTextBox.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = InlineTextBox.h; sourceTree = "<group>"; };
</del><ins>+                BCEA481A097D93020094C9E4 /* LegacyInlineTextBox.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyInlineTextBox.cpp; sourceTree = "<group>"; };
+               BCEA481B097D93020094C9E4 /* LegacyInlineTextBox.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LegacyInlineTextBox.h; sourceTree = "<group>"; };
</ins><span class="cx">           BCEA4820097D93020094C9E4 /* RenderBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderBlock.cpp; sourceTree = "<group>"; };
</span><span class="cx">          BCEA4821097D93020094C9E4 /* RenderBlock.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderBlock.h; sourceTree = "<group>"; };
</span><span class="cx">          BCEA4822097D93020094C9E4 /* RenderBox.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderBox.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -30190,8 +30190,6 @@
</span><span class="cx">                          B57CB52B182A37F60079A647 /* InlineElementBox.h */,
</span><span class="cx">                          930C90DC19CF965300D6C21A /* InlineIterator.cpp */,
</span><span class="cx">                          BCE789151120D6080060ECE5 /* InlineIterator.h */,
</span><del>-                               BCEA481A097D93020094C9E4 /* InlineTextBox.cpp */,
-                               BCEA481B097D93020094C9E4 /* InlineTextBox.h */,
</del><span class="cx">                           0FEC120B22BF2CC7004E9D35 /* LayerAncestorClippingStack.cpp */,
</span><span class="cx">                          0FEC120922BF2CC7004E9D35 /* LayerAncestorClippingStack.h */,
</span><span class="cx">                          580371631A66F1D300BAF519 /* LayerFragment.h */,
</span><span class="lines">@@ -30205,6 +30203,8 @@
</span><span class="cx">                          A8CFF5DE0A155A05000A4234 /* LegacyInlineBox.h */,
</span><span class="cx">                          A8CFF5DD0A155A05000A4234 /* LegacyInlineFlowBox.cpp */,
</span><span class="cx">                          A8CFF5DC0A155A05000A4234 /* LegacyInlineFlowBox.h */,
</span><ins>+                               BCEA481A097D93020094C9E4 /* LegacyInlineTextBox.cpp */,
+                               BCEA481B097D93020094C9E4 /* LegacyInlineTextBox.h */,
</ins><span class="cx">                           BCEA4813097D93020094C9E4 /* LegacyLineLayout.cpp */,
</span><span class="cx">                          E4A1AC7822FAFD500017B75B /* LegacyLineLayout.h */,
</span><span class="cx">                          A8CFF5E00A155A05000A4234 /* LegacyRootInlineBox.cpp */,
</span><span class="lines">@@ -33156,7 +33156,7 @@
</span><span class="cx">                          E4D33F3B252AEECD00837D05 /* InlineRunAndOffset.h in Headers */,
</span><span class="cx">                          6F360E5023999421001512A7 /* InlineSoftLineBreakItem.h in Headers */,
</span><span class="cx">                          AA4C3A770B2B1679002334A2 /* InlineStyleSheetOwner.h in Headers */,
</span><del>-                               BCEA485A097D93020094C9E4 /* InlineTextBox.h in Headers */,
</del><ins>+                                BCEA485A097D93020094C9E4 /* LegacyInlineTextBox.h in Headers */,
</ins><span class="cx">                           1C010701192594DF008A4201 /* InlineTextBoxStyle.h in Headers */,
</span><span class="cx">                          6F1CC1DE225F8B4900720AD2 /* InlineTextItem.h in Headers */,
</span><span class="cx">                          1CE8864126105BF2000C816C /* InMemoryDisplayList.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityatkWebKitAccessibleInterfaceTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp 2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp    2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -41,7 +41,6 @@
</span><span class="cx"> #include "FrameView.h"
</span><span class="cx"> #include "HTMLParserIdioms.h"
</span><span class="cx"> #include "HostWindow.h"
</span><del>-#include "InlineTextBox.h"
</del><span class="cx"> #include "NotImplemented.h"
</span><span class="cx"> #include "Range.h"
</span><span class="cx"> #include "RenderListItem.h"
</span></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNode.cpp       2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp  2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -38,10 +38,10 @@
</span><span class="cx"> #include "HTMLOptionsCollection.h"
</span><span class="cx"> #include "HTMLSlotElement.h"
</span><span class="cx"> #include "HTMLTableRowsCollection.h"
</span><del>-#include "InlineTextBox.h"
</del><span class="cx"> #include "InspectorInstrumentation.h"
</span><span class="cx"> #include "JSNode.h"
</span><span class="cx"> #include "LabelsNodeList.h"
</span><ins>+#include "LegacyInlineTextBox.h"
</ins><span class="cx"> #include "LegacyRootInlineBox.h"
</span><span class="cx"> #include "MutationEvent.h"
</span><span class="cx"> #include "NameNodeList.h"
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentMarkerControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DocumentMarkerController.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DocumentMarkerController.cpp    2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/dom/DocumentMarkerController.cpp       2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -255,7 +255,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
</span><span class="cx">     if (auto* renderer = node.renderer()) {
</span><del>-        // FIXME: Factor the marker painting code out of InlineTextBox and teach simple line layout to use it.
</del><ins>+        // FIXME: Factor the marker painting code out of LegacyInlineTextBox and teach simple line layout to use it.
</ins><span class="cx">         if (auto* lineLayout = LayoutIntegration::LineLayout::containing(*renderer))
</span><span class="cx">             lineLayout->flow().ensureLineBoxes();
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoredomPositioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Position.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Position.cpp    2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/dom/Position.cpp       2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -38,9 +38,9 @@
</span><span class="cx"> #include "InlineElementBox.h"
</span><span class="cx"> #include "InlineIterator.h"
</span><span class="cx"> #include "InlineRunAndOffset.h"
</span><del>-#include "InlineTextBox.h"
</del><span class="cx"> #include "LayoutIntegrationLineIterator.h"
</span><span class="cx"> #include "LayoutIntegrationRunIterator.h"
</span><ins>+#include "LegacyInlineTextBox.h"
</ins><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "NodeTraversal.h"
</span><span class="cx"> #include "PositionIterator.h"
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingCompositeEditCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/CompositeEditCommand.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/CompositeEditCommand.cpp    2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/editing/CompositeEditCommand.cpp       2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -47,7 +47,6 @@
</span><span class="cx"> #include "HTMLLIElement.h"
</span><span class="cx"> #include "HTMLNames.h"
</span><span class="cx"> #include "HTMLSpanElement.h"
</span><del>-#include "InlineTextBox.h"
</del><span class="cx"> #include "InsertIntoTextNodeCommand.h"
</span><span class="cx"> #include "InsertLineBreakCommand.h"
</span><span class="cx"> #include "InsertNodeBeforeCommand.h"
</span><span class="lines">@@ -54,6 +53,7 @@
</span><span class="cx"> #include "InsertParagraphSeparatorCommand.h"
</span><span class="cx"> #include "InsertTextCommand.h"
</span><span class="cx"> #include "LayoutIntegrationRunIterator.h"
</span><ins>+#include "LegacyInlineTextBox.h"
</ins><span class="cx"> #include "MergeIdenticalElementsCommand.h"
</span><span class="cx"> #include "NodeTraversal.h"
</span><span class="cx"> #include "RemoveNodeCommand.h"
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.h (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.h    2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/editing/Editor.h       2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -389,7 +389,7 @@
</span><span class="cx">     WEBCORE_EXPORT std::optional<SimpleRange> compositionRange() const;
</span><span class="cx">     WEBCORE_EXPORT bool getCompositionSelection(unsigned& selectionStart, unsigned& selectionEnd) const;
</span><span class="cx"> 
</span><del>-    // getting international text input composition state (for use by InlineTextBox)
</del><ins>+    // getting international text input composition state (for use by LegacyInlineTextBox)
</ins><span class="cx">     Text* compositionNode() const { return m_compositionNode.get(); }
</span><span class="cx">     unsigned compositionStart() const { return m_compositionStart; }
</span><span class="cx">     unsigned compositionEnd() const { return m_compositionEnd; }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingFrameSelectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/FrameSelection.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/FrameSelection.cpp  2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/editing/FrameSelection.cpp     2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx"> #include "HitTestRequest.h"
</span><span class="cx"> #include "HitTestResult.h"
</span><span class="cx"> #include "InlineRunAndOffset.h"
</span><del>-#include "InlineTextBox.h"
</del><ins>+#include "LegacyInlineTextBox.h"
</ins><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "Page.h"
</span><span class="cx"> #include "Range.h"
</span><span class="lines">@@ -1850,7 +1850,7 @@
</span><span class="cx">                 offset = m_selection.end().computeOffsetInContainerNode();
</span><span class="cx"> 
</span><span class="cx">             int pos;
</span><del>-            InlineTextBox* box = textRenderer.findNextInlineTextBox(offset, pos);
</del><ins>+            LegacyInlineTextBox* box = textRenderer.findNextInlineTextBox(offset, pos);
</ins><span class="cx">             text = text.substring(box->start(), box->len());
</span><span class="cx">             
</span><span class="cx">             String show;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingRenderedPositioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/RenderedPosition.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/RenderedPosition.cpp        2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/editing/RenderedPosition.cpp   2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include "CaretRectComputation.h"
</span><span class="cx"> #include "InlineRunAndOffset.h"
</span><del>-#include "InlineTextBox.h"
</del><ins>+#include "LegacyInlineTextBox.h"
</ins><span class="cx"> #include "VisiblePosition.h"
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTextIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TextIterator.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TextIterator.cpp    2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/editing/TextIterator.cpp       2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx"> #include "HTMLSlotElement.h"
</span><span class="cx"> #include "HTMLTextAreaElement.h"
</span><span class="cx"> #include "HTMLTextFormControlElement.h"
</span><del>-#include "InlineTextBox.h"
</del><ins>+#include "LegacyInlineTextBox.h"
</ins><span class="cx"> #include "NodeTraversal.h"
</span><span class="cx"> #include "Range.h"
</span><span class="cx"> #include "RenderImage.h"
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingVisiblePositioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/VisiblePosition.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/VisiblePosition.cpp 2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/editing/VisiblePosition.cpp    2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -36,7 +36,6 @@
</span><span class="cx"> #include "HTMLHtmlElement.h"
</span><span class="cx"> #include "HTMLNames.h"
</span><span class="cx"> #include "InlineRunAndOffset.h"
</span><del>-#include "InlineTextBox.h"
</del><span class="cx"> #include "LayoutIntegrationLineIterator.h"
</span><span class="cx"> #include "LayoutIntegrationRunIterator.h"
</span><span class="cx"> #include "Logging.h"
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutVerificationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/Verification.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/Verification.cpp     2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/layout/Verification.cpp        2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -31,12 +31,12 @@
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx"> #include "BlockFormattingState.h"
</span><span class="cx"> #include "InlineFormattingState.h"
</span><del>-#include "InlineTextBox.h"
</del><span class="cx"> #include "LayoutBox.h"
</span><span class="cx"> #include "LayoutBoxGeometry.h"
</span><span class="cx"> #include "LayoutContainerBox.h"
</span><span class="cx"> #include "LayoutContext.h"
</span><span class="cx"> #include "LayoutTreeBuilder.h"
</span><ins>+#include "LegacyInlineTextBox.h"
</ins><span class="cx"> #include "RenderBox.h"
</span><span class="cx"> #include "RenderInline.h"
</span><span class="cx"> #include "RenderLineBreak.h"
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-static bool checkForMatchingTextRuns(const LineRun& lineRun, const WebCore::InlineTextBox& inlineTextBox)
</del><ins>+static bool checkForMatchingTextRuns(const LineRun& lineRun, const WebCore::LegacyInlineTextBox& inlineTextBox)
</ins><span class="cx"> {
</span><span class="cx">     if (!lineRun.text())
</span><span class="cx">         return false;
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx">     for (unsigned inlineBoxIndex = 0; inlineBoxIndex < inlineBoxes.size() && runIndex < lineRuns.size(); ++inlineBoxIndex) {
</span><span class="cx">         auto& lineRun = lineRuns[runIndex];
</span><span class="cx">         auto* inlineBox = inlineBoxes[inlineBoxIndex];
</span><del>-        auto* inlineTextBox = is<WebCore::InlineTextBox>(inlineBox) ? downcast<WebCore::InlineTextBox>(inlineBox) : nullptr;
</del><ins>+        auto* inlineTextBox = is<WebCore::LegacyInlineTextBox>(inlineBox) ? downcast<WebCore::LegacyInlineTextBox>(inlineBox) : nullptr;
</ins><span class="cx">         bool matchingRuns = inlineTextBox ? checkForMatchingTextRuns(lineRun, *inlineTextBox) : checkForMatchingNonTextRuns(lineRun, *inlineBox);
</span><span class="cx"> 
</span><span class="cx">         if (!matchingRuns) {
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutformattingContextsinlinetextTextUtilh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/formattingContexts/inline/text/TextUtil.h (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/formattingContexts/inline/text/TextUtil.h    2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/text/TextUtil.h       2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace Layout {
</span><span class="cx"> 
</span><del>-class InlineTextBox;
</del><ins>+class LegacyInlineTextBox;
</ins><span class="cx"> class InlineTextItem;
</span><span class="cx"> 
</span><span class="cx"> class TextUtil {
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutintegrationLayoutIntegrationRunIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIterator.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIterator.cpp 2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIterator.cpp    2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -171,7 +171,7 @@
</span><span class="cx">         for (auto* textBox = text.firstTextBox(); textBox; textBox = textBox->nextTextBox())
</span><span class="cx">             sortedTextBoxes.append(textBox);
</span><span class="cx">         std::sort(sortedTextBoxes.begin(), sortedTextBoxes.end(), [](auto* a, auto* b) {
</span><del>-            return InlineTextBox::compareByStart(downcast<InlineTextBox>(a), downcast<InlineTextBox>(b));
</del><ins>+            return LegacyInlineTextBox::compareByStart(downcast<LegacyInlineTextBox>(a), downcast<LegacyInlineTextBox>(b));
</ins><span class="cx">         });
</span><span class="cx">         auto* first = sortedTextBoxes[0];
</span><span class="cx">         return { RunIteratorLegacyPath { first, WTFMove(sortedTextBoxes), 0 } };
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutintegrationLayoutIntegrationRunIteratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIterator.h (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIterator.h   2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIterator.h      2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -113,7 +113,7 @@
</span><span class="cx">     bool isSelectable(unsigned start, unsigned end) const;
</span><span class="cx">     LayoutRect selectionRect(unsigned start, unsigned end) const;
</span><span class="cx"> 
</span><del>-    InlineTextBox* legacyInlineBox() const { return downcast<InlineTextBox>(PathRun::legacyInlineBox()); }
</del><ins>+    LegacyInlineTextBox* legacyInlineBox() const { return downcast<LegacyInlineTextBox>(PathRun::legacyInlineBox()); }
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class RunIterator {
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutintegrationLayoutIntegrationRunIteratorLegacyPathh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIteratorLegacyPath.h (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIteratorLegacyPath.h 2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIteratorLegacyPath.h    2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><del>-#include "InlineTextBox.h"
</del><ins>+#include "LegacyInlineTextBox.h"
</ins><span class="cx"> #include "LegacyRootInlineBox.h"
</span><span class="cx"> #include "RenderText.h"
</span><span class="cx"> #include <wtf/RefCountedArray.h>
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx">     {
</span><span class="cx">         if (!m_logicalOrderCache.isEmpty()) {
</span><span class="cx">             traverseNextInlineBoxInCacheOrder();
</span><del>-            ASSERT(!m_inlineBox || is<InlineTextBox>(m_inlineBox));
</del><ins>+            ASSERT(!m_inlineBox || is<LegacyInlineTextBox>(m_inlineBox));
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">         traverseNextTextRun();
</span><span class="lines">@@ -123,7 +123,7 @@
</span><span class="cx">     const LegacyRootInlineBox& rootInlineBox() const { return m_inlineBox->root(); }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    const InlineTextBox* inlineTextBox() const { return downcast<InlineTextBox>(m_inlineBox); }
</del><ins>+    const LegacyInlineTextBox* inlineTextBox() const { return downcast<LegacyInlineTextBox>(m_inlineBox); }
</ins><span class="cx"> 
</span><span class="cx">     static Vector<const LegacyInlineBox*> inlineBoxesInLogicalOrder(const LegacyRootInlineBox& root)
</span><span class="cx">     {
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutlayouttreeLayoutBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/layouttree/LayoutBox.h (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/layouttree/LayoutBox.h       2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/layout/layouttree/LayoutBox.h  2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx"> 
</span><span class="cx">     enum BaseTypeFlag : uint8_t {
</span><span class="cx">         BoxFlag                    = 1 << 0,
</span><del>-        InlineTextBoxFlag          = 1 << 1,
</del><ins>+        LegacyInlineTextBoxFlag          = 1 << 1,
</ins><span class="cx">         LineBreakBoxFlag           = 1 << 2,
</span><span class="cx">         ReplacedBoxFlag            = 1 << 3,
</span><span class="cx">         InitialContainingBlockFlag = 1 << 4,
</span><span class="lines">@@ -152,7 +152,7 @@
</span><span class="cx">     Box* nextSibling() { return m_nextSibling; }
</span><span class="cx"> 
</span><span class="cx">     bool isContainerBox() const { return baseTypeFlags().contains(ContainerBoxFlag); }
</span><del>-    bool isInlineTextBox() const { return baseTypeFlags().contains(InlineTextBoxFlag); }
</del><ins>+    bool isInlineTextBox() const { return baseTypeFlags().contains(LegacyInlineTextBoxFlag); }
</ins><span class="cx">     bool isLineBreakBox() const { return baseTypeFlags().contains(LineBreakBoxFlag); }
</span><span class="cx">     bool isReplacedBox() const { return baseTypeFlags().contains(ReplacedBoxFlag); }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutlayouttreeLayoutInlineTextBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/layouttree/LayoutInlineTextBox.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/layouttree/LayoutInlineTextBox.cpp   2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/layout/layouttree/LayoutInlineTextBox.cpp      2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> WTF_MAKE_ISO_ALLOCATED_IMPL(InlineTextBox);
</span><span class="cx"> 
</span><span class="cx"> InlineTextBox::InlineTextBox(String content, bool canUseSimplifiedContentMeasuring, RenderStyle&& style)
</span><del>-    : Box({ }, WTFMove(style), Box::InlineTextBoxFlag)
</del><ins>+    : Box({ }, WTFMove(style), Box::LegacyInlineTextBoxFlag)
</ins><span class="cx">     , m_content(content)
</span><span class="cx">     , m_canUseSimplifiedContentMeasuring(canUseSimplifiedContentMeasuring)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingCaretRectComputationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/CaretRectComputation.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/CaretRectComputation.cpp  2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/CaretRectComputation.cpp     2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -194,10 +194,10 @@
</span><span class="cx">     auto* box = runAndOffset.run ? runAndOffset.run->legacyInlineBox() : nullptr;
</span><span class="cx">     auto caretOffset = runAndOffset.offset;
</span><span class="cx"> 
</span><del>-    if (!is<InlineTextBox>(box))
</del><ins>+    if (!is<LegacyInlineTextBox>(box))
</ins><span class="cx">         return { };
</span><span class="cx"> 
</span><del>-    auto& textBox = downcast<InlineTextBox>(*box);
</del><ins>+    auto& textBox = downcast<LegacyInlineTextBox>(*box);
</ins><span class="cx">     if (caretOffset < textBox.start() || caretOffset > textBox.start() + textBox.len())
</span><span class="cx">         return { };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingEllipsisBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/EllipsisBox.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/EllipsisBox.cpp   2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/EllipsisBox.cpp      2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -24,7 +24,7 @@
</span><span class="cx"> #include "FontCascade.h"
</span><span class="cx"> #include "GraphicsContext.h"
</span><span class="cx"> #include "HitTestResult.h"
</span><del>-#include "InlineTextBox.h"
</del><ins>+#include "LegacyInlineTextBox.h"
</ins><span class="cx"> #include "LegacyRootInlineBox.h"
</span><span class="cx"> #include "PaintInfo.h"
</span><span class="cx"> #include "TextRun.h"
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingInlineTextBoxcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/rendering/InlineTextBox.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineTextBox.cpp 2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp    2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -1,1352 +0,0 @@
</span><del>-/*
- * (C) 1999 Lars Knoll (knoll@kde.org)
- * (C) 2000 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#include "config.h"
-#include "InlineTextBox.h"
-
-#include "BreakLines.h"
-#include "CompositionHighlight.h"
-#include "DashArray.h"
-#include "Document.h"
-#include "DocumentMarkerController.h"
-#include "Editor.h"
-#include "ElementRuleCollector.h"
-#include "EllipsisBox.h"
-#include "EventRegion.h"
-#include "FloatRoundedRect.h"
-#include "Frame.h"
-#include "GraphicsContext.h"
-#include "HighlightData.h"
-#include "HighlightRegister.h"
-#include "HitTestResult.h"
-#include "ImageBuffer.h"
-#include "InlineTextBoxStyle.h"
-#include "MarkedTextStyle.h"
-#include "Page.h"
-#include "PaintInfo.h"
-#include "RenderBlock.h"
-#include "RenderCombineText.h"
-#include "RenderLineBreak.h"
-#include "RenderRubyRun.h"
-#include "RenderRubyText.h"
-#include "RenderTheme.h"
-#include "RenderView.h"
-#include "RenderedDocumentMarker.h"
-#include "RuntimeEnabledFeatures.h"
-#include "Settings.h"
-#include "Text.h"
-#include "TextDecorationPainter.h"
-#include "TextPaintStyle.h"
-#include "TextPainter.h"
-#include <stdio.h>
-#include <wtf/IsoMallocInlines.h>
-#include <wtf/text/CString.h>
-#include <wtf/text/TextStream.h>
-
-namespace WebCore {
-
-WTF_MAKE_ISO_ALLOCATED_IMPL(InlineTextBox);
-
-struct SameSizeAsInlineTextBox : public LegacyInlineBox {
-    unsigned variables[1];
-    unsigned short variables2[2];
-    void* pointers[2];
-};
-
-COMPILE_ASSERT(sizeof(InlineTextBox) == sizeof(SameSizeAsInlineTextBox), InlineTextBox_should_stay_small);
-
-typedef WTF::HashMap<const InlineTextBox*, LayoutRect> InlineTextBoxOverflowMap;
-static InlineTextBoxOverflowMap* gTextBoxesWithOverflow;
-
-InlineTextBox::~InlineTextBox()
-{
-    if (!knownToHaveNoOverflow() && gTextBoxesWithOverflow)
-        gTextBoxesWithOverflow->remove(this);
-    TextPainter::removeGlyphDisplayList(*this);
-}
-
-bool InlineTextBox::hasTextContent() const
-{
-    if (m_len > 1)
-        return true;
-    if (auto* combinedText = this->combinedText()) {
-        ASSERT(m_len == 1);
-        return !combinedText->combinedStringForRendering().isEmpty();
-    }
-    return m_len;
-}
-
-void InlineTextBox::markDirty(bool dirty)
-{
-    if (dirty) {
-        m_len = 0;
-        m_start = 0;
-    }
-    LegacyInlineBox::markDirty(dirty);
-}
-
-LayoutRect InlineTextBox::logicalOverflowRect() const
-{
-    if (knownToHaveNoOverflow() || !gTextBoxesWithOverflow)
-        return enclosingIntRect(logicalFrameRect());
-    return gTextBoxesWithOverflow->get(this);
-}
-
-void InlineTextBox::setLogicalOverflowRect(const LayoutRect& rect)
-{
-    ASSERT(!knownToHaveNoOverflow());
-    if (!gTextBoxesWithOverflow)
-        gTextBoxesWithOverflow = new InlineTextBoxOverflowMap;
-    gTextBoxesWithOverflow->add(this, rect);
-}
-
-LayoutUnit InlineTextBox::baselinePosition(FontBaseline baselineType) const
-{
-    if (!parent())
-        return 0;
-    if (&parent()->renderer() == renderer().parent())
-        return parent()->baselinePosition(baselineType);
-    return downcast<RenderBoxModelObject>(*renderer().parent()).baselinePosition(baselineType, isFirstLine(), isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine);
-}
-
-LayoutUnit InlineTextBox::lineHeight() const
-{
-    if (!renderer().parent())
-        return 0;
-    if (&parent()->renderer() == renderer().parent())
-        return parent()->lineHeight();
-    return downcast<RenderBoxModelObject>(*renderer().parent()).lineHeight(isFirstLine(), isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine);
-}
-
-LayoutUnit InlineTextBox::selectionTop() const
-{
-    return root().selectionTop();
-}
-
-LayoutUnit InlineTextBox::selectionBottom() const
-{
-    return root().selectionBottom();
-}
-
-LayoutUnit InlineTextBox::selectionHeight() const
-{
-    return root().selectionHeight();
-}
-
-bool InlineTextBox::isSelected(unsigned startPosition, unsigned endPosition) const
-{
-    return clampedOffset(startPosition) < clampedOffset(endPosition);
-}
-
-RenderObject::HighlightState InlineTextBox::selectionState()
-{
-    auto state = verifySelectionState(renderer().selectionState(), renderer().view().selection());
-    
-    // FIXME: this code mutates selection state, but it's used at a simple getter elsewhere
-    // in this file. This code should likely live in HighlightData, or somewhere else.
-    // <rdar://problem/58125978>
-    // https://bugs.webkit.org/show_bug.cgi?id=205528
-    // If there are ellipsis following, make sure their selection is updated.
-    if (m_truncation != cNoTruncation && root().ellipsisBox()) {
-        EllipsisBox* ellipsis = root().ellipsisBox();
-        if (state != RenderObject::HighlightState::None) {
-            auto [selectionStart, selectionEnd] = selectionStartEnd();
-            // The ellipsis should be considered to be selected if the end of
-            // the selection is past the beginning of the truncation and the
-            // beginning of the selection is before or at the beginning of the
-            // truncation.
-            ellipsis->setSelectionState(selectionEnd >= m_truncation && selectionStart <= m_truncation ?
-                RenderObject::HighlightState::Inside : RenderObject::HighlightState::None);
-        } else
-            ellipsis->setSelectionState(RenderObject::HighlightState::None);
-    }
-    
-    return state;
-}
-
-RenderObject::HighlightState InlineTextBox::verifySelectionState(RenderObject::HighlightState state, HighlightData& selection) const
-{
-    if (state == RenderObject::HighlightState::Start || state == RenderObject::HighlightState::End || state == RenderObject::HighlightState::Both) {
-        auto startOffset = selection.startOffset();
-        auto endOffset = selection.endOffset();
-        // The position after a hard line break is considered to be past its end.
-        ASSERT(start() + len() >= (isLineBreak() ? 1 : 0));
-        unsigned lastSelectable = start() + len() - (isLineBreak() ? 1 : 0);
-
-        bool start = (state != RenderObject::HighlightState::End && startOffset >= m_start && startOffset < m_start + m_len);
-        bool end = (state != RenderObject::HighlightState::Start && endOffset > m_start && endOffset <= lastSelectable);
-        if (start && end)
-            state = RenderObject::HighlightState::Both;
-        else if (start)
-            state = RenderObject::HighlightState::Start;
-        else if (end)
-            state = RenderObject::HighlightState::End;
-        else if ((state == RenderObject::HighlightState::End || startOffset < m_start)
-            && (state == RenderObject::HighlightState::Start || endOffset > lastSelectable))
-            state = RenderObject::HighlightState::Inside;
-        else if (state == RenderObject::HighlightState::Both)
-            state = RenderObject::HighlightState::None;
-    }
-
-    return state;
-}
-
-inline const FontCascade& InlineTextBox::lineFont() const
-{
-    return combinedText() ? combinedText()->textCombineFont() : lineStyle().fontCascade();
-}
-
-LayoutRect snappedSelectionRect(const LayoutRect& selectionRect, float logicalRight, float selectionTop, float selectionHeight, bool isHorizontal)
-{
-    auto snappedSelectionRect = enclosingIntRect(selectionRect);
-    LayoutUnit logicalWidth = snappedSelectionRect.width();
-    if (snappedSelectionRect.x() > logicalRight)
-        logicalWidth = 0;
-    else if (snappedSelectionRect.maxX() > logicalRight)
-        logicalWidth = logicalRight - snappedSelectionRect.x();
-
-    LayoutPoint topPoint;
-    LayoutUnit width;
-    LayoutUnit height;
-    if (isHorizontal) {
-        topPoint = LayoutPoint { snappedSelectionRect.x(), selectionTop };
-        width = logicalWidth;
-        height = selectionHeight;
-    } else {
-        topPoint = LayoutPoint { selectionTop, snappedSelectionRect.x() };
-        width = selectionHeight;
-        height = logicalWidth;
-    }
-    return LayoutRect { topPoint, LayoutSize { width, height } };
-}
-
-// FIXME: Share more code with paintMarkedTextBackground().
-LayoutRect InlineTextBox::localSelectionRect(unsigned startPos, unsigned endPos) const
-{
-    unsigned sPos = clampedOffset(startPos);
-    unsigned ePos = clampedOffset(endPos);
-
-    if (sPos >= ePos && !(startPos == endPos && startPos >= start() && startPos <= (start() + len())))
-        return { };
-
-    LayoutUnit selectionTop = this->selectionTop();
-    LayoutUnit selectionHeight = this->selectionHeight();
-
-    TextRun textRun = createTextRun();
-
-    LayoutRect selectionRect { LayoutUnit(logicalLeft()), selectionTop, LayoutUnit(logicalWidth()), selectionHeight };
-    // Avoid measuring the text when the entire line box is selected as an optimization.
-    if (sPos || ePos != textRun.length())
-        lineFont().adjustSelectionRectForText(textRun, selectionRect, sPos, ePos);
-    // FIXME: The computation of the snapped selection rect differs from the computation of this rect
-    // in paintMarkedTextBackground(). See <https://bugs.webkit.org/show_bug.cgi?id=138913>.
-    return snappedSelectionRect(selectionRect, logicalRight(), selectionTop, selectionHeight, isHorizontal());
-}
-
-void InlineTextBox::deleteLine()
-{
-    renderer().removeTextBox(*this);
-    delete this;
-}
-
-void InlineTextBox::extractLine()
-{
-    if (extracted())
-        return;
-
-    renderer().extractTextBox(*this);
-}
-
-void InlineTextBox::attachLine()
-{
-    if (!extracted())
-        return;
-    
-    renderer().attachTextBox(*this);
-}
-
-float InlineTextBox::placeEllipsisBox(bool flowIsLTR, float visibleLeftEdge, float visibleRightEdge, float ellipsisWidth, float &truncatedWidth, bool& foundBox)
-{
-    if (foundBox) {
-        m_truncation = cFullTruncation;
-        return -1;
-    }
-
-    // For LTR this is the left edge of the box, for RTL, the right edge in parent coordinates.
-    float ellipsisX = flowIsLTR ? visibleRightEdge - ellipsisWidth : visibleLeftEdge + ellipsisWidth;
-    
-    // Criteria for full truncation:
-    // LTR: the left edge of the ellipsis is to the left of our text run.
-    // RTL: the right edge of the ellipsis is to the right of our text run.
-    bool ltrFullTruncation = flowIsLTR && ellipsisX <= left();
-    bool rtlFullTruncation = !flowIsLTR && ellipsisX >= left() + logicalWidth();
-    if (ltrFullTruncation || rtlFullTruncation) {
-        // Too far.  Just set full truncation, but return -1 and let the ellipsis just be placed at the edge of the box.
-        m_truncation = cFullTruncation;
-        foundBox = true;
-        return -1;
-    }
-
-    bool ltrEllipsisWithinBox = flowIsLTR && (ellipsisX < right());
-    bool rtlEllipsisWithinBox = !flowIsLTR && (ellipsisX > left());
-    if (ltrEllipsisWithinBox || rtlEllipsisWithinBox) {
-        foundBox = true;
-
-        // The inline box may have different directionality than it's parent.  Since truncation
-        // behavior depends both on both the parent and the inline block's directionality, we
-        // must keep track of these separately.
-        bool ltr = isLeftToRightDirection();
-        if (ltr != flowIsLTR) {
-          // Width in pixels of the visible portion of the box, excluding the ellipsis.
-          int visibleBoxWidth = visibleRightEdge - visibleLeftEdge  - ellipsisWidth;
-          ellipsisX = ltr ? left() + visibleBoxWidth : right() - visibleBoxWidth;
-        }
-
-        int offset = offsetForPosition(ellipsisX, false);
-        if (offset == 0) {
-            // No characters should be rendered.  Set ourselves to full truncation and place the ellipsis at the min of our start
-            // and the ellipsis edge.
-            m_truncation = cFullTruncation;
-            truncatedWidth += ellipsisWidth;
-            return flowIsLTR ? std::min(ellipsisX, x()) : std::max(ellipsisX, right() - ellipsisWidth);
-        }
-
-        // Set the truncation index on the text run.
-        m_truncation = offset;
-
-        // If we got here that means that we were only partially truncated and we need to return the pixel offset at which
-        // to place the ellipsis.
-        float widthOfVisibleText = renderer().width(m_start, offset, textPos(), isFirstLine());
-
-        // The ellipsis needs to be placed just after the last visible character.
-        // Where "after" is defined by the flow directionality, not the inline
-        // box directionality.
-        // e.g. In the case of an LTR inline box truncated in an RTL flow then we can
-        // have a situation such as |Hello| -> |...He|
-        truncatedWidth += widthOfVisibleText + ellipsisWidth;
-        if (flowIsLTR)
-            return left() + widthOfVisibleText;
-        else
-            return right() - widthOfVisibleText - ellipsisWidth;
-    }
-    truncatedWidth += logicalWidth();
-    return -1;
-}
-
-
-
-bool InlineTextBox::isLineBreak() const
-{
-    return renderer().style().preserveNewline() && len() == 1 && renderer().text()[start()] == '\n';
-}
-
-bool InlineTextBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit /* lineTop */, LayoutUnit /*lineBottom*/,
-    HitTestAction /*hitTestAction*/)
-{
-    if (!visibleToHitTesting(request))
-        return false;
-
-    if (isLineBreak())
-        return false;
-
-    if (m_truncation == cFullTruncation)
-        return false;
-
-    FloatRect rect(locationIncludingFlipping(), size());
-    // Make sure truncated text is ignored while hittesting.
-    if (m_truncation != cNoTruncation) {
-        LayoutUnit widthOfVisibleText { renderer().width(m_start, m_truncation, textPos(), isFirstLine()) };
-
-        if (isHorizontal())
-            renderer().style().isLeftToRightDirection() ? rect.setWidth(widthOfVisibleText) : rect.shiftXEdgeTo(right() - widthOfVisibleText);
-        else
-            rect.setHeight(widthOfVisibleText);
-    }
-
-    rect.moveBy(accumulatedOffset);
-
-    if (locationInContainer.intersects(rect)) {
-        renderer().updateHitTestResult(result, flipForWritingMode(locationInContainer.point() - toLayoutSize(accumulatedOffset)));
-        if (result.addNodeToListBasedTestResult(renderer().nodeForHitTest(), request, locationInContainer, rect) == HitTestProgress::Stop)
-            return true;
-    }
-    return false;
-}
-
-std::optional<bool> InlineTextBox::emphasisMarkExistsAndIsAbove(const RenderStyle& style) const
-{
-    // This function returns true if there are text emphasis marks and they are suppressed by ruby text.
-    if (style.textEmphasisMark() == TextEmphasisMark::None)
-        return std::nullopt;
-
-    const OptionSet<TextEmphasisPosition> horizontalMask { TextEmphasisPosition::Left, TextEmphasisPosition::Right };
-
-    auto emphasisPosition = style.textEmphasisPosition();
-    auto emphasisPositionHorizontalValue = emphasisPosition & horizontalMask;
-    ASSERT(!((emphasisPosition & TextEmphasisPosition::Over) && (emphasisPosition & TextEmphasisPosition::Under)));
-    ASSERT(emphasisPositionHorizontalValue != horizontalMask);
-
-    bool isAbove = false;
-    if (!emphasisPositionHorizontalValue)
-        isAbove = emphasisPosition.contains(TextEmphasisPosition::Over);
-    else if (style.isHorizontalWritingMode())
-        isAbove = emphasisPosition.contains(TextEmphasisPosition::Over);
-    else
-        isAbove = emphasisPositionHorizontalValue == TextEmphasisPosition::Right;
-
-    if ((style.isHorizontalWritingMode() && (emphasisPosition & TextEmphasisPosition::Under))
-        || (!style.isHorizontalWritingMode() && (emphasisPosition & TextEmphasisPosition::Left)))
-        return isAbove; // Ruby text is always over, so it cannot suppress emphasis marks under.
-
-    RenderBlock* containingBlock = renderer().containingBlock();
-    if (!containingBlock || !containingBlock->isRubyBase())
-        return isAbove; // This text is not inside a ruby base, so it does not have ruby text over it.
-
-    if (!is<RenderRubyRun>(*containingBlock->parent()))
-        return isAbove; // Cannot get the ruby text.
-
-    RenderRubyText* rubyText = downcast<RenderRubyRun>(*containingBlock->parent()).rubyText();
-
-    // The emphasis marks over are suppressed only if there is a ruby text box and it not empty.
-    if (rubyText && rubyText->hasLines())
-        return std::nullopt;
-
-    return isAbove;
-}
-
-static MarkedText createMarkedTextFromSelectionInBox(const InlineTextBox& box)
-{
-    auto [selectionStart, selectionEnd] = box.selectionStartEnd();
-    if (selectionStart < selectionEnd)
-        return { selectionStart, selectionEnd, MarkedText::Selection };
-    return { };
-}
-
-void InlineTextBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit /*lineTop*/, LayoutUnit /*lineBottom*/)
-{
-    if (isLineBreak() || !paintInfo.shouldPaintWithinRoot(renderer()) || renderer().style().visibility() != Visibility::Visible
-        || m_truncation == cFullTruncation || paintInfo.phase == PaintPhase::Outline || !hasTextContent())
-        return;
-
-    ASSERT(paintInfo.phase != PaintPhase::SelfOutline && paintInfo.phase != PaintPhase::ChildOutlines);
-
-    LayoutUnit logicalLeftSide = logicalLeftVisualOverflow();
-    LayoutUnit logicalRightSide = logicalRightVisualOverflow();
-    LayoutUnit logicalStart = logicalLeftSide + (isHorizontal() ? paintOffset.x() : paintOffset.y());
-    LayoutUnit logicalExtent = logicalRightSide - logicalLeftSide;
-    
-    LayoutUnit paintEnd = isHorizontal() ? paintInfo.rect.maxX() : paintInfo.rect.maxY();
-    LayoutUnit paintStart = isHorizontal() ? paintInfo.rect.x() : paintInfo.rect.y();
-    
-    FloatPoint localPaintOffset(paintOffset);
-    
-    if (logicalStart >= paintEnd || logicalStart + logicalExtent <= paintStart)
-        return;
-
-    bool isPrinting = renderer().document().printing();
-    
-    // Determine whether or not we're selected.
-    bool haveSelection = !isPrinting && paintInfo.phase != PaintPhase::TextClip && selectionState() != RenderObject::HighlightState::None;
-    if (!haveSelection && paintInfo.phase == PaintPhase::Selection) {
-        // When only painting the selection, don't bother to paint if there is none.
-        return;
-    }
-
-    if (m_truncation != cNoTruncation) {
-        if (renderer().containingBlock()->style().isLeftToRightDirection() != isLeftToRightDirection()) {
-            // Make the visible fragment of text hug the edge closest to the rest of the run by moving the origin
-            // at which we start drawing text.
-            // e.g. In the case of LTR text truncated in an RTL Context, the correct behavior is:
-            // |Hello|CBA| -> |...He|CBA|
-            // In order to draw the fragment "He" aligned to the right edge of it's box, we need to start drawing
-            // farther to the right.
-            // NOTE: WebKit's behavior differs from that of IE which appears to just overlay the ellipsis on top of the
-            // truncated string i.e.  |Hello|CBA| -> |...lo|CBA|
-            LayoutUnit widthOfVisibleText { renderer().width(m_start, m_truncation, textPos(), isFirstLine()) };
-            LayoutUnit widthOfHiddenText { logicalWidth() - widthOfVisibleText };
-            LayoutSize truncationOffset(isLeftToRightDirection() ? widthOfHiddenText : -widthOfHiddenText, 0_lu);
-            localPaintOffset.move(isHorizontal() ? truncationOffset : truncationOffset.transposedSize());
-        }
-    }
-
-    GraphicsContext& context = paintInfo.context();
-
-    const RenderStyle& lineStyle = this->lineStyle();
-    
-    localPaintOffset.move(0, lineStyle.isHorizontalWritingMode() ? 0 : -logicalHeight());
-
-    FloatPoint boxOrigin = locationIncludingFlipping();
-    boxOrigin.moveBy(localPaintOffset);
-    FloatRect boxRect(boxOrigin, FloatSize(logicalWidth(), logicalHeight()));
-
-    if (paintInfo.phase == PaintPhase::EventRegion) {
-        if (visibleToHitTesting())
-            paintInfo.eventRegionContext->unite(enclosingIntRect(boxRect), renderer().style());
-        return;
-    }
-
-    auto* combinedText = this->combinedText();
-
-    bool shouldRotate = !isHorizontal() && !combinedText;
-    if (shouldRotate)
-        context.concatCTM(rotation(boxRect, Clockwise));
-
-    // Determine whether or not we have composition underlines to draw.
-    bool containsComposition = renderer().textNode() && renderer().frame().editor().compositionNode() == renderer().textNode();
-    bool useCustomUnderlines = containsComposition && renderer().frame().editor().compositionUsesCustomUnderlines();
-
-    // 1. Paint backgrounds behind text if needed. Examples of such backgrounds include selection
-    // and composition underlines.
-    if (paintInfo.phase != PaintPhase::Selection && paintInfo.phase != PaintPhase::TextClip && !isPrinting) {
-        if (containsComposition && !useCustomUnderlines)
-            paintCompositionBackground(paintInfo, boxOrigin);
-
-        Vector<MarkedText> markedTexts = collectMarkedTextsForDocumentMarkers(TextPaintPhase::Background);
-        auto highlightMarkedTexts = collectMarkedTextsForHighlights(TextPaintPhase::Background);
-        if (!highlightMarkedTexts.isEmpty())
-            markedTexts.appendVector(WTFMove(highlightMarkedTexts));
-#if ENABLE(TEXT_SELECTION)
-        if (haveSelection && !useCustomUnderlines && !context.paintingDisabled()) {
-            auto selectionMarkedText = createMarkedTextFromSelectionInBox(*this);
-            if (!selectionMarkedText.isEmpty())
-                markedTexts.append(WTFMove(selectionMarkedText));
-        }
-#endif
-        auto styledMarkedTexts = subdivideAndResolveStyle(markedTexts, renderer(), isFirstLine(), paintInfo);
-
-        // Coalesce styles of adjacent marked texts to minimize the number of drawing commands.
-        auto coalescedStyledMarkedTexts = coalesceAdjacentMarkedTexts(styledMarkedTexts, &MarkedTextStyle::areBackgroundMarkedTextStylesEqual);
-
-        paintMarkedTexts(paintInfo, TextPaintPhase::Background, boxRect, coalescedStyledMarkedTexts);
-    }
-
-    // FIXME: Right now, InlineTextBoxes never call addRelevantUnpaintedObject() even though they might
-    // legitimately be unpainted if they are waiting on a slow-loading web font. We should fix that, and
-    // when we do, we will have to account for the fact the InlineTextBoxes do not always have unique
-    // renderers and Page currently relies on each unpainted object having a unique renderer.
-    if (paintInfo.phase == PaintPhase::Foreground)
-        renderer().page().addRelevantRepaintedObject(&renderer(), IntRect(boxOrigin.x(), boxOrigin.y(), logicalWidth(), logicalHeight()));
-
-    if (paintInfo.phase == PaintPhase::Foreground)
-        paintPlatformDocumentMarkers(context, boxOrigin);
-
-    // 2. Now paint the foreground, including text and decorations like underline/overline (in quirks mode only).
-    bool shouldPaintSelectionForeground = haveSelection && !useCustomUnderlines;
-    Vector<MarkedText> markedTexts;
-    if (paintInfo.phase != PaintPhase::Selection) {
-        // The marked texts for the gaps between document markers and selection are implicitly created by subdividing the entire line.
-        markedTexts.append({ clampedOffset(m_start), clampedOffset(end()), MarkedText::Unmarked });
-        if (!isPrinting) {
-            markedTexts.appendVector(collectMarkedTextsForDocumentMarkers(TextPaintPhase::Foreground));
-            auto highlightMarkedTexts = collectMarkedTextsForHighlights(TextPaintPhase::Foreground);
-            if (!highlightMarkedTexts.isEmpty())
-                markedTexts.appendVector(WTFMove(highlightMarkedTexts));
-
-            bool shouldPaintDraggedContent = !(paintInfo.paintBehavior.contains(PaintBehavior::ExcludeSelection));
-            if (shouldPaintDraggedContent) {
-                auto markedTextsForDraggedContent = collectMarkedTextsForDraggedContent();
-                if (!markedTextsForDraggedContent.isEmpty()) {
-                    shouldPaintSelectionForeground = false;
-                    markedTexts.appendVector(markedTextsForDraggedContent);
-                }
-            }
-        }
-    }
-    // The selection marked text acts as a placeholder when computing the marked texts for the gaps...
-    if (shouldPaintSelectionForeground) {
-        ASSERT(!isPrinting);
-        auto selectionMarkedText = createMarkedTextFromSelectionInBox(*this);
-        if (!selectionMarkedText.isEmpty())
-            markedTexts.append(WTFMove(selectionMarkedText));
-    }
-
-    auto styledMarkedTexts = subdivideAndResolveStyle(markedTexts, renderer(), isFirstLine(), paintInfo);
-
-    // ... now remove the selection marked text if we are excluding selection.
-    if (!isPrinting && paintInfo.paintBehavior.contains(PaintBehavior::ExcludeSelection))
-        styledMarkedTexts.removeAllMatching([] (const StyledMarkedText& markedText) { return markedText.type == MarkedText::Selection; });
-
-    // Coalesce styles of adjacent marked texts to minimize the number of drawing commands.
-    auto coalescedStyledMarkedTexts = coalesceAdjacentMarkedTexts(styledMarkedTexts, &MarkedTextStyle::areForegroundMarkedTextStylesEqual);
-
-    paintMarkedTexts(paintInfo, TextPaintPhase::Foreground, boxRect, coalescedStyledMarkedTexts);
-
-    // Paint decorations
-    auto textDecorations = lineStyle.textDecorationsInEffect();
-    bool highlightDecorations = !collectMarkedTextsForHighlights(TextPaintPhase::Decoration).isEmpty();
-    bool lineDecorations = !textDecorations.isEmpty();
-    if ((lineDecorations || highlightDecorations) && paintInfo.phase != PaintPhase::Selection) {
-        TextRun textRun = createTextRun();
-        unsigned length = textRun.length();
-        if (m_truncation != cNoTruncation)
-            length = m_truncation;
-        unsigned selectionStart = 0;
-        unsigned selectionEnd = 0;
-        if (haveSelection)
-            std::tie(selectionStart, selectionEnd) = selectionStartEnd();
-
-        FloatRect textDecorationSelectionClipOutRect;
-        if ((paintInfo.paintBehavior.contains(PaintBehavior::ExcludeSelection)) && selectionStart < selectionEnd && selectionEnd <= length) {
-            textDecorationSelectionClipOutRect = logicalOverflowRect();
-            textDecorationSelectionClipOutRect.moveBy(localPaintOffset);
-            float logicalWidthBeforeRange;
-            float logicalWidthAfterRange;
-            float logicalSelectionWidth = lineFont().widthOfTextRange(textRun, selectionStart, selectionEnd, nullptr, &logicalWidthBeforeRange, &logicalWidthAfterRange);
-            // FIXME: Do we need to handle vertical bottom to top text?
-            if (!isHorizontal()) {
-                textDecorationSelectionClipOutRect.move(0, logicalWidthBeforeRange);
-                textDecorationSelectionClipOutRect.setHeight(logicalSelectionWidth);
-            } else if (direction() == TextDirection::RTL) {
-                textDecorationSelectionClipOutRect.move(logicalWidthAfterRange, 0);
-                textDecorationSelectionClipOutRect.setWidth(logicalSelectionWidth);
-            } else {
-                textDecorationSelectionClipOutRect.move(logicalWidthBeforeRange, 0);
-                textDecorationSelectionClipOutRect.setWidth(logicalSelectionWidth);
-            }
-        }
-
-        // Coalesce styles of adjacent marked texts to minimize the number of drawing commands.
-        auto coalescedStyledMarkedTexts = coalesceAdjacentMarkedTexts(styledMarkedTexts, &MarkedTextStyle::areDecorationMarkedTextStylesEqual);
-
-        paintMarkedTexts(paintInfo, TextPaintPhase::Decoration, boxRect, coalescedStyledMarkedTexts, textDecorationSelectionClipOutRect);
-    }
-
-    // 3. Paint fancy decorations, including composition underlines and platform-specific underlines for spelling errors, grammar errors, et cetera.
-    if (paintInfo.phase == PaintPhase::Foreground && useCustomUnderlines)
-        paintCompositionUnderlines(paintInfo, boxOrigin);
-    
-    if (shouldRotate)
-        context.concatCTM(rotation(boxRect, Counterclockwise));
-}
-
-unsigned InlineTextBox::clampedOffset(unsigned x) const
-{
-    unsigned offset = std::max(std::min(x, m_start + m_len), m_start) - m_start;
-    if (m_truncation == cFullTruncation)
-        return offset;
-    if (m_truncation != cNoTruncation)
-        offset = std::min<unsigned>(offset, m_truncation);
-    else if (offset == m_len) {
-        // Fix up the offset if we are combined text or have a hyphen because we manage these embellishments.
-        // That is, they are not reflected in renderer().text(). We treat combined text as a single unit.
-        // We also treat the last codepoint in this box and the hyphen as a single unit.
-        if (auto* combinedText = this->combinedText())
-            offset = combinedText->combinedStringForRendering().length();
-        else if (hasHyphen())
-            offset += lineStyle().hyphenString().length();
-    }
-    return offset;
-}
-
-std::pair<unsigned, unsigned> InlineTextBox::clampedStartEndForState(unsigned start, unsigned end, RenderObject::HighlightState selectionState) const
-{
-    if (selectionState == RenderObject::HighlightState::Inside)
-        return { 0, clampedOffset(m_start + m_len) };
-    
-    if (selectionState == RenderObject::HighlightState::Start)
-        end = renderer().text().length();
-    else if (selectionState == RenderObject::HighlightState::End)
-        start = 0;
-    return { clampedOffset(start), clampedOffset(end) };
-}
-
-std::pair<unsigned, unsigned> InlineTextBox::selectionStartEnd() const
-{
-    auto selectionState = renderer().selectionState();
-    
-    return clampedStartEndForState(renderer().view().selection().startOffset(), renderer().view().selection().endOffset(), selectionState);
-}
-
-std::pair<unsigned, unsigned> InlineTextBox::highlightStartEnd(HighlightData &rangeData) const
-{
-    auto state = rangeData.highlightStateForRenderer(renderer());
-    state = verifySelectionState(state, rangeData);
-    
-    if (state == RenderObject::HighlightState::None)
-        return {0, 0};
-    
-    return clampedStartEndForState(rangeData.startOffset(), rangeData.endOffset(), state);
-}
-
-bool InlineTextBox::hasMarkers() const
-{
-    return collectMarkedTextsForDocumentMarkers(TextPaintPhase::Decoration).size();
-}
-
-void InlineTextBox::paintPlatformDocumentMarkers(GraphicsContext& context, const FloatPoint& boxOrigin)
-{
-    // This must match calculateUnionOfAllDocumentMarkerBounds().
-    for (auto& markedText : subdivide(collectMarkedTextsForDocumentMarkers(TextPaintPhase::Decoration), OverlapStrategy::Frontmost))
-        paintPlatformDocumentMarker(context, boxOrigin, markedText);
-}
-
-FloatRect InlineTextBox::calculateUnionOfAllDocumentMarkerBounds() const
-{
-    // This must match paintPlatformDocumentMarkers().
-    FloatRect result;
-    for (auto& markedText : subdivide(collectMarkedTextsForDocumentMarkers(TextPaintPhase::Decoration), OverlapStrategy::Frontmost))
-        result = unionRect(result, calculateDocumentMarkerBounds(markedText));
-    return result;
-}
-
-FloatRect InlineTextBox::calculateDocumentMarkerBounds(const MarkedText& markedText) const
-{
-    auto& font = lineFont();
-    auto ascent = font.fontMetrics().ascent();
-    auto fontSize = std::min(std::max(font.size(), 10.0f), 40.0f);
-    auto y = ascent + 0.11035 * fontSize;
-    auto height = 0.13247 * fontSize;
-
-    // Avoid measuring the text when the entire line box is selected as an optimization.
-    if (markedText.startOffset || markedText.endOffset != clampedOffset(end())) {
-        TextRun run = createTextRun();
-        LayoutRect selectionRect = LayoutRect(0, y, 0, height);
-        lineFont().adjustSelectionRectForText(run, selectionRect, markedText.startOffset, markedText.endOffset);
-        return selectionRect;
-    }
-
-    return FloatRect(0, y, logicalWidth(), height);
-}
-
-void InlineTextBox::paintPlatformDocumentMarker(GraphicsContext& context, const FloatPoint& boxOrigin, const MarkedText& markedText)
-{
-    // Never print spelling/grammar markers (5327887)
-    if (renderer().document().printing())
-        return;
-
-    if (m_truncation == cFullTruncation)
-        return;
-
-    auto bounds = calculateDocumentMarkerBounds(markedText);
-
-    auto lineStyleForMarkedTextType = [&]() -> DocumentMarkerLineStyle {
-        bool shouldUseDarkAppearance = renderer().useDarkAppearance();
-        switch (markedText.type) {
-        case MarkedText::SpellingError:
-            return { DocumentMarkerLineStyle::Mode::Spelling, shouldUseDarkAppearance };
-        case MarkedText::GrammarError:
-            return { DocumentMarkerLineStyle::Mode::Grammar, shouldUseDarkAppearance };
-        case MarkedText::Correction:
-            return { DocumentMarkerLineStyle::Mode::AutocorrectionReplacement, shouldUseDarkAppearance };
-        case MarkedText::DictationAlternatives:
-            return { DocumentMarkerLineStyle::Mode::DictationAlternatives, shouldUseDarkAppearance };
-#if PLATFORM(IOS_FAMILY)
-        case MarkedText::DictationPhraseWithAlternatives:
-            // FIXME: Rename DocumentMarkerLineStyle::TextCheckingDictationPhraseWithAlternatives and remove the PLATFORM(IOS_FAMILY)-guard.
-            return { DocumentMarkerLineStyle::Mode::TextCheckingDictationPhraseWithAlternatives, shouldUseDarkAppearance };
-#endif
-        default:
-            ASSERT_NOT_REACHED();
-            return { DocumentMarkerLineStyle::Mode::Spelling, shouldUseDarkAppearance };
-        }
-    };
-
-    bounds.moveBy(boxOrigin);
-    context.drawDotsForDocumentMarker(bounds, lineStyleForMarkedTextType());
-}
-
-Vector<MarkedText> InlineTextBox::collectMarkedTextsForDraggedContent()
-{
-    using DraggendContentRange = std::pair<unsigned, unsigned>;
-    auto draggedContentRanges = renderer().draggedContentRangesBetweenOffsets(m_start, m_start + m_len);
-    Vector<MarkedText> result = draggedContentRanges.map([this] (const DraggendContentRange& range) -> MarkedText {
-        return { clampedOffset(range.first), clampedOffset(range.second), MarkedText::DraggedContent };
-    });
-    return result;
-}
-
-Vector<MarkedText> InlineTextBox::collectMarkedTextsForDocumentMarkers(TextPaintPhase phase) const
-{
-    ASSERT_ARG(phase, phase == TextPaintPhase::Background || phase == TextPaintPhase::Foreground || phase == TextPaintPhase::Decoration);
-
-    if (!renderer().textNode())
-        return { };
-
-    Vector<RenderedDocumentMarker*> markers = renderer().document().markers().markersFor(*renderer().textNode());
-
-    auto markedTextTypeForMarkerType = [] (DocumentMarker::MarkerType type) {
-        switch (type) {
-        case DocumentMarker::Spelling:
-            return MarkedText::SpellingError;
-        case DocumentMarker::Grammar:
-            return MarkedText::GrammarError;
-        case DocumentMarker::CorrectionIndicator:
-            return MarkedText::Correction;
-        case DocumentMarker::TextMatch:
-            return MarkedText::TextMatch;
-        case DocumentMarker::DictationAlternatives:
-            return MarkedText::DictationAlternatives;
-#if PLATFORM(IOS_FAMILY)
-        case DocumentMarker::DictationPhraseWithAlternatives:
-            return MarkedText::DictationPhraseWithAlternatives;
-#endif
-        default:
-            return MarkedText::Unmarked;
-        }
-    };
-
-    Vector<MarkedText> markedTexts;
-    markedTexts.reserveInitialCapacity(markers.size());
-
-    // Give any document markers that touch this run a chance to draw before the text has been drawn.
-    // Note end() points at the last char, not one past it like endOffset and ranges do.
-    for (auto* marker : markers) {
-        // Collect either the background markers or the foreground markers, but not both
-        switch (marker->type()) {
-        case DocumentMarker::Grammar:
-        case DocumentMarker::Spelling:
-        case DocumentMarker::CorrectionIndicator:
-        case DocumentMarker::Replacement:
-        case DocumentMarker::DictationAlternatives:
-#if PLATFORM(IOS_FAMILY)
-        // FIXME: Remove the PLATFORM(IOS_FAMILY)-guard.
-        case DocumentMarker::DictationPhraseWithAlternatives:
-#endif
-            if (phase != TextPaintPhase::Decoration)
-                continue;
-            break;
-        case DocumentMarker::TextMatch:
-            if (!renderer().frame().editor().markedTextMatchesAreHighlighted())
-                continue;
-            if (phase == TextPaintPhase::Decoration)
-                continue;
-            break;
-#if ENABLE(TELEPHONE_NUMBER_DETECTION)
-        case DocumentMarker::TelephoneNumber:
-            if (!renderer().frame().editor().markedTextMatchesAreHighlighted())
-                continue;
-            if (phase != TextPaintPhase::Background)
-                continue;
-            break;
-#endif
-        default:
-            continue;
-        }
-
-        if (marker->endOffset() <= start()) {
-            // Marker is completely before this run. This might be a marker that sits before the
-            // first run we draw, or markers that were within runs we skipped due to truncation.
-            continue;
-        }
-
-        if (marker->startOffset() >= end()) {
-            // Marker is completely after this run, bail. A later run will paint it.
-            break;
-        }
-
-        // Marker intersects this run. Collect it.
-        switch (marker->type()) {
-        case DocumentMarker::Spelling:
-        case DocumentMarker::CorrectionIndicator:
-        case DocumentMarker::DictationAlternatives:
-        case DocumentMarker::Grammar:
-#if PLATFORM(IOS_FAMILY)
-        // FIXME: See <rdar://problem/8933352>. Also, remove the PLATFORM(IOS_FAMILY)-guard.
-        case DocumentMarker::DictationPhraseWithAlternatives:
-#endif
-        case DocumentMarker::TextMatch:
-            markedTexts.uncheckedAppend({ clampedOffset(marker->startOffset()), clampedOffset(marker->endOffset()), markedTextTypeForMarkerType(marker->type()), marker });
-            break;
-        case DocumentMarker::Replacement:
-            break;
-#if ENABLE(TELEPHONE_NUMBER_DETECTION)
-        case DocumentMarker::TelephoneNumber:
-            break;
-#endif
-        default:
-            ASSERT_NOT_REACHED();
-        }
-    }
-    return markedTexts;
-}
-
-Vector<MarkedText> InlineTextBox::collectMarkedTextsForHighlights(TextPaintPhase phase) const
-{
-    ASSERT_ARG(phase, phase == TextPaintPhase::Background || phase == TextPaintPhase::Foreground || phase == TextPaintPhase::Decoration);
-    UNUSED_PARAM(phase);
-    if (!renderer().textNode())
-        return { };
-
-    Vector<MarkedText> markedTexts;
-    HighlightData highlightData;
-    if (RuntimeEnabledFeatures::sharedFeatures().highlightAPIEnabled()) {
-        auto& parentRenderer = parent()->renderer();
-        auto& parentStyle = parentRenderer.style();
-        if (auto highlightRegister = renderer().document().highlightRegisterIfExists()) {
-            for (auto& highlight : highlightRegister->map()) {
-                auto renderStyle = parentRenderer.getUncachedPseudoStyle({ PseudoId::Highlight, highlight.key }, &parentStyle);
-                if (!renderStyle)
-                    continue;
-                if (renderStyle->textDecorationsInEffect().isEmpty() && phase == TextPaintPhase::Decoration)
-                    continue;
-                for (auto& rangeData : highlight.value->rangesData()) {
-                    if (!highlightData.setRenderRange(rangeData))
-                        continue;
-
-                    auto [highlightStart, highlightEnd] = highlightStartEnd(highlightData);
-                    if (highlightStart < highlightEnd)
-                        markedTexts.append({ highlightStart, highlightEnd, MarkedText::Highlight, nullptr, highlight.key });
-                }
-            }
-        }
-    }
-#if ENABLE(APP_HIGHLIGHTS)
-    if (auto appHighlightRegister = renderer().document().appHighlightRegisterIfExists()) {
-        if (appHighlightRegister->highlightsVisibility() == HighlightVisibility::Visible) {
-            for (auto& highlight : appHighlightRegister->map()) {
-                for (auto& rangeData : highlight.value->rangesData()) {
-                    if (!highlightData.setRenderRange(rangeData))
-                        continue;
-
-                    auto [highlightStart, highlightEnd] = highlightStartEnd(highlightData);
-                    if (highlightStart < highlightEnd)
-                        markedTexts.append({ highlightStart, highlightEnd, MarkedText::AppHighlight });
-                }
-            }
-        }
-    }
-#endif
-    return markedTexts;
-}
-
-FloatPoint InlineTextBox::textOriginFromBoxRect(const FloatRect& boxRect) const
-{
-    FloatPoint textOrigin { boxRect.x(), boxRect.y() + lineFont().fontMetrics().ascent() };
-    if (auto* combinedText = this->combinedText()) {
-        if (auto newOrigin = combinedText->computeTextOrigin(boxRect))
-            textOrigin = newOrigin.value();
-    }
-    if (isHorizontal())
-        textOrigin.setY(roundToDevicePixel(LayoutUnit { textOrigin.y() }, renderer().document().deviceScaleFactor()));
-    else
-        textOrigin.setX(roundToDevicePixel(LayoutUnit { textOrigin.x() }, renderer().document().deviceScaleFactor()));
-    return textOrigin;
-}
-
-void InlineTextBox::paintMarkedTexts(PaintInfo& paintInfo, TextPaintPhase phase, const FloatRect& boxRect, const Vector<StyledMarkedText>& markedTexts, const FloatRect& decorationClipOutRect)
-{
-    switch (phase) {
-    case TextPaintPhase::Background:
-        for (auto& markedText : markedTexts)
-            paintMarkedTextBackground(paintInfo, boxRect.location(), markedText.style.backgroundColor, markedText.startOffset, markedText.endOffset);
-        return;
-    case TextPaintPhase::Foreground:
-        for (auto& markedText : markedTexts)
-            paintMarkedTextForeground(paintInfo, boxRect, markedText);
-        return;
-    case TextPaintPhase::Decoration:
-        for (auto& markedText : markedTexts)
-            paintMarkedTextDecoration(paintInfo, boxRect, decorationClipOutRect, markedText);
-        return;
-    }
-}
-
-void InlineTextBox::paintMarkedTextBackground(PaintInfo& paintInfo, const FloatPoint& boxOrigin, const Color& color, unsigned clampedStartOffset, unsigned clampedEndOffset, MarkedTextBackgroundStyle style)
-{
-    if (clampedStartOffset >= clampedEndOffset)
-        return;
-
-    GraphicsContext& context = paintInfo.context();
-    GraphicsContextStateSaver stateSaver { context };
-    updateGraphicsContext(context, TextPaintStyle { color }); // Don't draw text at all!
-
-    // Note that if the text is truncated, we let the thing being painted in the truncation
-    // draw its own highlight.
-    TextRun textRun = createTextRun();
-
-    const LegacyRootInlineBox& rootBox = root();
-    LayoutUnit selectionBottom = rootBox.selectionBottom();
-    LayoutUnit selectionTop = rootBox.selectionTopAdjustedForPrecedingBlock();
-
-    // Use same y positioning and height as for selection, so that when the selection and this subrange are on
-    // the same word there are no pieces sticking out.
-    LayoutUnit deltaY { renderer().style().isFlippedLinesWritingMode() ? selectionBottom - logicalBottom() : logicalTop() - selectionTop };
-    LayoutUnit selectionHeight = std::max<LayoutUnit>(0, selectionBottom - selectionTop);
-
-    LayoutRect selectionRect { LayoutUnit(boxOrigin.x()), LayoutUnit(boxOrigin.y() - deltaY), LayoutUnit(logicalWidth()), selectionHeight };
-    lineFont().adjustSelectionRectForText(textRun, selectionRect, clampedStartOffset, clampedEndOffset);
-
-    // FIXME: Support painting combined text. See <https://bugs.webkit.org/show_bug.cgi?id=180993>.
-    auto backgroundRect = snapRectToDevicePixelsWithWritingDirection(selectionRect, renderer().document().deviceScaleFactor(), textRun.ltr());
-    if (style == MarkedTextBackgroundStyle::Rounded) {
-        backgroundRect.expand(-1, -1);
-        backgroundRect.move(0.5, 0.5);
-        context.fillRoundedRect(FloatRoundedRect { backgroundRect, FloatRoundedRect::Radii { 2 } }, color);
-        return;
-    }
-
-    context.fillRect(backgroundRect, color);
-}
-
-void InlineTextBox::paintMarkedTextForeground(PaintInfo& paintInfo, const FloatRect& boxRect, const StyledMarkedText& markedText)
-{
-    if (markedText.startOffset >= markedText.endOffset)
-        return;
-
-    GraphicsContext& context = paintInfo.context();
-    const FontCascade& font = lineFont();
-    const RenderStyle& lineStyle = this->lineStyle();
-
-    float emphasisMarkOffset = 0;
-    std::optional<bool> markExistsAndIsAbove = emphasisMarkExistsAndIsAbove(lineStyle);
-    const AtomString& emphasisMark = markExistsAndIsAbove ? lineStyle.textEmphasisMarkString() : nullAtom();
-    if (!emphasisMark.isEmpty())
-        emphasisMarkOffset = *markExistsAndIsAbove ? -font.fontMetrics().ascent() - font.emphasisMarkDescent(emphasisMark) : font.fontMetrics().descent() + font.emphasisMarkAscent(emphasisMark);
-
-    TextPainter textPainter { context };
-    textPainter.setFont(font);
-    textPainter.setStyle(markedText.style.textStyles);
-    textPainter.setIsHorizontal(isHorizontal());
-    if (markedText.style.textShadow) {
-        textPainter.setShadow(&markedText.style.textShadow.value());
-        if (lineStyle.hasAppleColorFilter())
-            textPainter.setShadowColorFilter(&lineStyle.appleColorFilter());
-    }
-    textPainter.setEmphasisMark(emphasisMark, emphasisMarkOffset, combinedText());
-    if (auto* debugShadow = debugTextShadow())
-        textPainter.setShadow(debugShadow);
-
-    TextRun textRun = createTextRun();
-    textPainter.setGlyphDisplayListIfNeeded(*this, paintInfo, font, context, textRun);
-
-    GraphicsContextStateSaver stateSaver { context, false };
-    if (markedText.type == MarkedText::DraggedContent) {
-        stateSaver.save();
-        context.setAlpha(markedText.style.alpha);
-    }
-    // TextPainter wants the box rectangle and text origin of the entire line box.
-    textPainter.paintRange(textRun, boxRect, textOriginFromBoxRect(boxRect), markedText.startOffset, markedText.endOffset);
-}
-
-void InlineTextBox::paintMarkedTextDecoration(PaintInfo& paintInfo, const FloatRect& boxRect, const FloatRect& clipOutRect, const StyledMarkedText& markedText)
-{
-    if (m_truncation == cFullTruncation)
-        return;
-
-    GraphicsContext& context = paintInfo.context();
-    updateGraphicsContext(context, markedText.style.textStyles);
-
-    bool isCombinedText = combinedText();
-    if (isCombinedText)
-        context.concatCTM(rotation(boxRect, Clockwise));
-
-    // 1. Compute text selection
-    unsigned startOffset = markedText.startOffset;
-    unsigned endOffset = markedText.endOffset;
-    if (startOffset >= endOffset)
-        return;
-
-    // Note that if the text is truncated, we let the thing being painted in the truncation
-    // draw its own decoration.
-    TextRun textRun = createTextRun();
-
-    // Avoid measuring the text when the entire line box is selected as an optimization.
-    FloatRect snappedSelectionRect = boxRect;
-    if (startOffset || endOffset != textRun.length()) {
-        LayoutRect selectionRect = { boxRect.x(), boxRect.y(), boxRect.width(), boxRect.height() };
-        lineFont().adjustSelectionRectForText(textRun, selectionRect, startOffset, endOffset);
-        snappedSelectionRect = snapRectToDevicePixelsWithWritingDirection(selectionRect, renderer().document().deviceScaleFactor(), textRun.ltr());
-    }
-
-    // 2. Paint
-    auto textDecorations = lineStyle().textDecorationsInEffect();
-    textDecorations.add(TextDecorationPainter::textDecorationsInEffectForStyle(markedText.style.textDecorationStyles));
-    TextDecorationPainter decorationPainter { context, textDecorations, renderer(), isFirstLine(), lineFont(), markedText.style.textDecorationStyles };
-    decorationPainter.setInlineTextBox(this);
-    decorationPainter.setWidth(snappedSelectionRect.width());
-    decorationPainter.setIsHorizontal(isHorizontal());
-    if (markedText.style.textShadow) {
-        decorationPainter.setTextShadow(&markedText.style.textShadow.value());
-        if (lineStyle().hasAppleColorFilter())
-            decorationPainter.setShadowColorFilter(&lineStyle().appleColorFilter());
-    }
-
-    {
-        GraphicsContextStateSaver stateSaver { context, false };
-        bool isDraggedContent = markedText.type == MarkedText::DraggedContent;
-        if (isDraggedContent || !clipOutRect.isEmpty()) {
-            stateSaver.save();
-            if (isDraggedContent)
-                context.setAlpha(markedText.style.alpha);
-            if (!clipOutRect.isEmpty())
-                context.clipOut(clipOutRect);
-        }
-        decorationPainter.paintTextDecoration(textRun.subRun(startOffset, endOffset - startOffset), textOriginFromBoxRect(snappedSelectionRect), snappedSelectionRect.location());
-    }
-
-    if (isCombinedText)
-        context.concatCTM(rotation(boxRect, Counterclockwise));
-}
-
-void InlineTextBox::paintCompositionBackground(PaintInfo& paintInfo, const FloatPoint& boxOrigin)
-{
-    if (!renderer().frame().editor().compositionUsesCustomHighlights()) {
-        paintMarkedTextBackground(paintInfo, boxOrigin, CompositionHighlight::defaultCompositionFillColor, clampedOffset(renderer().frame().editor().compositionStart()), clampedOffset(renderer().frame().editor().compositionEnd()));
-        return;
-    }
-
-    for (auto& highlight : renderer().frame().editor().customCompositionHighlights()) {
-        if (highlight.endOffset <= m_start)
-            continue;
-
-        if (highlight.startOffset >= end())
-            break;
-
-        paintMarkedTextBackground(paintInfo, boxOrigin, highlight.color, clampedOffset(highlight.startOffset), clampedOffset(highlight.endOffset), MarkedTextBackgroundStyle::Rounded);
-
-        if (highlight.endOffset > end())
-            break;
-    }
-}
-
-void InlineTextBox::paintCompositionUnderlines(PaintInfo& paintInfo, const FloatPoint& boxOrigin) const
-{
-    if (m_truncation == cFullTruncation)
-        return;
-
-    for (auto& underline : renderer().frame().editor().customCompositionUnderlines()) {
-        if (underline.endOffset <= m_start) {
-            // Underline is completely before this run. This might be an underline that sits
-            // before the first run we draw, or underlines that were within runs we skipped
-            // due to truncation.
-            continue;
-        }
-
-        if (underline.startOffset >= end())
-            break; // Underline is completely after this run, bail. A later run will paint it.
-
-        // Underline intersects this run. Paint it.
-        paintCompositionUnderline(paintInfo, boxOrigin, underline);
-
-        if (underline.endOffset > end())
-            break; // Underline also runs into the next run. Bail now, no more marker advancement.
-    }
-}
-
-static inline void mirrorRTLSegment(float logicalWidth, TextDirection direction, float& start, float width)
-{
-    if (direction == TextDirection::LTR)
-        return;
-    start = logicalWidth - width - start;
-}
-
-void InlineTextBox::paintCompositionUnderline(PaintInfo& paintInfo, const FloatPoint& boxOrigin, const CompositionUnderline& underline) const
-{
-    if (m_truncation == cFullTruncation)
-        return;
-    
-    float start = 0; // start of line to draw, relative to tx
-    float width = logicalWidth(); // how much line to draw
-    bool useWholeWidth = true;
-    unsigned paintStart = m_start;
-    unsigned paintEnd = end();
-    if (paintStart <= underline.startOffset) {
-        paintStart = underline.startOffset;
-        useWholeWidth = false;
-        start = renderer().width(m_start, paintStart - m_start, textPos(), isFirstLine());
-    }
-    if (paintEnd != underline.endOffset) {      // end points at the last char, not past it
-        paintEnd = std::min(paintEnd, (unsigned)underline.endOffset);
-        useWholeWidth = false;
-    }
-    if (m_truncation != cNoTruncation) {
-        paintEnd = std::min(paintEnd, (unsigned)m_start + m_truncation);
-        useWholeWidth = false;
-    }
-    if (!useWholeWidth) {
-        width = renderer().width(paintStart, paintEnd - paintStart, textPos() + start, isFirstLine());
-        mirrorRTLSegment(logicalWidth(), direction(), start, width);
-    }
-
-    // Thick marked text underlines are 2px thick as long as there is room for the 2px line under the baseline.
-    // All other marked text underlines are 1px thick.
-    // If there's not enough space the underline will touch or overlap characters.
-    int lineThickness = 1;
-    int baseline = lineStyle().fontMetrics().ascent();
-    if (underline.thick && logicalHeight() - baseline >= 2)
-        lineThickness = 2;
-
-    // We need to have some space between underlines of subsequent clauses, because some input methods do not use different underline styles for those.
-    // We make each line shorter, which has a harmless side effect of shortening the first and last clauses, too.
-    start += 1;
-    width -= 2;
-
-    GraphicsContext& context = paintInfo.context();
-    Color underlineColor = underline.compositionUnderlineColor == CompositionUnderlineColor::TextColor ? renderer().style().visitedDependentColorWithColorFilter(CSSPropertyWebkitTextFillColor) : renderer().style().colorByApplyingColorFilter(underline.color);
-    context.setStrokeColor(underlineColor);
-    context.setStrokeThickness(lineThickness);
-    context.drawLineForText(FloatRect(boxOrigin.x() + start, boxOrigin.y() + logicalHeight() - lineThickness, width, lineThickness), renderer().document().printing());
-}
-
-int InlineTextBox::caretMinOffset() const
-{
-    return m_start;
-}
-
-int InlineTextBox::caretMaxOffset() const
-{
-    return m_start + m_len;
-}
-
-float InlineTextBox::textPos() const
-{
-    // When computing the width of a text run, RenderBlock::computeInlineDirectionPositionsForLine() doesn't include the actual offset
-    // from the containing block edge in its measurement. textPos() should be consistent so the text are rendered in the same width.
-    if (logicalLeft() == 0)
-        return 0;
-    return logicalLeft() - root().logicalLeft();
-}
-
-int InlineTextBox::offsetForPosition(float lineOffset, bool includePartialGlyphs) const
-{
-    if (isLineBreak())
-        return 0;
-    if (lineOffset - logicalLeft() > logicalWidth())
-        return isLeftToRightDirection() ? len() : 0;
-    if (lineOffset - logicalLeft() < 0)
-        return isLeftToRightDirection() ? 0 : len();
-    bool ignoreCombinedText = true;
-    bool ignoreHyphen = true;
-    return lineFont().offsetForPosition(createTextRun(ignoreCombinedText, ignoreHyphen), lineOffset - logicalLeft(), includePartialGlyphs);
-}
-
-float InlineTextBox::positionForOffset(unsigned offset) const
-{
-    ASSERT(offset >= m_start);
-    ASSERT(offset <= m_start + len());
-
-    if (isLineBreak())
-        return logicalLeft();
-
-    unsigned startOffset;
-    unsigned endOffset;
-    if (isLeftToRightDirection()) {
-        startOffset = 0;
-        endOffset = clampedOffset(offset);
-    } else {
-        startOffset = clampedOffset(offset);
-        endOffset = m_len;
-    }
-
-    // FIXME: Do we need to add rightBearing here?
-    LayoutRect selectionRect = LayoutRect(logicalLeft(), 0, 0, 0);
-    bool ignoreCombinedText = true;
-    bool ignoreHyphen = true;
-    TextRun textRun = createTextRun(ignoreCombinedText, ignoreHyphen);
-    lineFont().adjustSelectionRectForText(textRun, selectionRect, startOffset, endOffset);
-    return snapRectToDevicePixelsWithWritingDirection(selectionRect, renderer().document().deviceScaleFactor(), textRun.ltr()).maxX();
-}
-
-TextRun InlineTextBox::createTextRun(bool ignoreCombinedText, bool ignoreHyphen) const
-{
-    const auto& style = lineStyle();
-    TextRun textRun { text(ignoreCombinedText, ignoreHyphen), textPos(), expansion(), expansionBehavior(), direction(), dirOverride() || style.rtlOrdering() == Order::Visual, !renderer().canUseSimpleFontCodePath() };
-    textRun.setTabSize(!style.collapseWhiteSpace(), style.tabSize());
-    return textRun;
-}
-
-String InlineTextBox::text(bool ignoreCombinedText, bool ignoreHyphen) const
-{
-    String result;
-    if (auto* combinedText = this->combinedText()) {
-        if (ignoreCombinedText)
-            result = renderer().text().substring(m_start, m_len);
-        else
-            result = combinedText->combinedStringForRendering();
-    } else if (hasHyphen()) {
-        if (ignoreHyphen)
-            result = renderer().text().substring(m_start, m_len);
-        else
-            result = makeString(StringView(renderer().text()).substring(m_start, m_len), lineStyle().hyphenString());
-    } else
-        result = renderer().text().substring(m_start, m_len);
-
-    // This works because this replacement doesn't affect string indices. We're replacing a single Unicode code unit with another Unicode code unit.
-    // How convenient.
-    return RenderBlock::updateSecurityDiscCharacters(lineStyle(), WTFMove(result));
-}
-
-inline const RenderCombineText* InlineTextBox::combinedText() const
-{
-    return lineStyle().hasTextCombine() && is<RenderCombineText>(renderer()) && downcast<RenderCombineText>(renderer()).isCombined() ? &downcast<RenderCombineText>(renderer()) : nullptr;
-}
-
-ShadowData* InlineTextBox::debugTextShadow()
-{
-    if (!renderer().settings().legacyLineLayoutVisualCoverageEnabled())
-        return nullptr;
-
-    static NeverDestroyed<ShadowData> debugTextShadow(IntPoint(0, 0), 10, 20, ShadowStyle::Normal, true, SRGBA<uint8_t> { 150, 0, 0, 190 });
-    return &debugTextShadow.get();
-}
-
-ExpansionBehavior InlineTextBox::expansionBehavior() const
-{
-    ExpansionBehavior leftBehavior;
-    if (forceLeftExpansion())
-        leftBehavior = ForceLeftExpansion;
-    else if (canHaveLeftExpansion())
-        leftBehavior = AllowLeftExpansion;
-    else
-        leftBehavior = ForbidLeftExpansion;
-
-    ExpansionBehavior rightBehavior;
-    if (forceRightExpansion())
-        rightBehavior = ForceRightExpansion;
-    else if (expansion() && nextLeafOnLine() && !nextLeafOnLine()->isLineBreak())
-        rightBehavior = AllowRightExpansion;
-    else
-        rightBehavior = ForbidRightExpansion;
-
-    return leftBehavior | rightBehavior;
-}
-
-#if ENABLE(TREE_DEBUGGING)
-
-const char* InlineTextBox::boxName() const
-{
-    return "InlineTextBox";
-}
-
-void InlineTextBox::outputLineBox(TextStream& stream, bool mark, int depth) const
-{
-    stream << "-------- " << (isDirty() ? "D" : "-") << "-";
-
-    int printedCharacters = 0;
-    if (mark) {
-        stream << "*";
-        ++printedCharacters;
-    }
-    while (++printedCharacters <= depth * 2)
-        stream << " ";
-
-    String value = renderer().text();
-    value = value.substring(start(), len());
-    value.replaceWithLiteral('\\', "\\\\");
-    value.replaceWithLiteral('\n', "\\n");
-    stream << boxName() << " " << FloatRect(x(), y(), width(), height()) << " (" << this << ") renderer->(" << &renderer() << ") run(" << start() << ", " << start() + len() << ") \"" << value.utf8().data() << "\"";
-    stream.nextLine();
-}
-
-#endif
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCorerenderingInlineTextBoxh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/rendering/InlineTextBox.h (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineTextBox.h   2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/InlineTextBox.h      2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -1,217 +0,0 @@
</span><del>-/*
- * (C) 1999 Lars Knoll (knoll@kde.org)
- * (C) 2000 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#pragma once
-
-#include "LegacyInlineBox.h"
-#include "RenderText.h"
-#include "TextRun.h"
-
-namespace WebCore {
-
-class RenderCombineText;
-class RenderedDocumentMarker;
-class TextPainter;
-struct CompositionUnderline;
-struct MarkedText;
-struct StyledMarkedText;
-struct TextPaintStyle;
-
-const unsigned short cNoTruncation = USHRT_MAX;
-const unsigned short cFullTruncation = USHRT_MAX - 1;
-
-class InlineTextBox : public LegacyInlineBox {
-    WTF_MAKE_ISO_ALLOCATED(InlineTextBox);
-public:
-    explicit InlineTextBox(RenderText& renderer)
-        : LegacyInlineBox(renderer)
-    {
-        setBehavesLikeText(true);
-    }
-
-    virtual ~InlineTextBox();
-
-    RenderText& renderer() const { return downcast<RenderText>(LegacyInlineBox::renderer()); }
-    const RenderStyle& lineStyle() const { return isFirstLine() ? renderer().firstLineStyle() : renderer().style(); }
-
-    InlineTextBox* prevTextBox() const { return m_prevTextBox; }
-    InlineTextBox* nextTextBox() const { return m_nextTextBox; }
-    void setNextTextBox(InlineTextBox* n) { m_nextTextBox = n; }
-    void setPreviousTextBox(InlineTextBox* p) { m_prevTextBox = p; }
-
-    bool hasTextContent() const;
-
-    // These functions do not account for combined text. For combined text this box will always have len() == 1
-    // regardless of whether the resulting composition is the empty string. Use hasTextContent() if you want to
-    // know whether this box has text content.
-    //
-    // FIXME: These accessors should ASSERT(!isDirty()). See https://bugs.webkit.org/show_bug.cgi?id=97264
-    // Note len() == 1 for combined text regardless of whether the composition is empty. Use hasTextContent() to
-    unsigned start() const { return m_start; }
-    unsigned end() const { return m_start + m_len; }
-    unsigned len() const { return m_len; }
-
-    void setStart(unsigned start) { m_start = start; }
-    void setLen(unsigned len) { m_len = len; }
-
-    void offsetRun(int d) { ASSERT(!isDirty()); ASSERT(d > 0 || m_start >= static_cast<unsigned>(-d)); m_start += d; }
-
-    unsigned short truncation() const { return m_truncation; }
-
-    void markDirty(bool dirty = true) final;
-
-    using LegacyInlineBox::hasHyphen;
-    using LegacyInlineBox::setHasHyphen;
-    using LegacyInlineBox::canHaveLeftExpansion;
-    using LegacyInlineBox::setCanHaveLeftExpansion;
-    using LegacyInlineBox::canHaveRightExpansion;
-    using LegacyInlineBox::setCanHaveRightExpansion;
-    using LegacyInlineBox::forceRightExpansion;
-    using LegacyInlineBox::setForceRightExpansion;
-    using LegacyInlineBox::forceLeftExpansion;
-    using LegacyInlineBox::setForceLeftExpansion;
-
-    static inline bool compareByStart(const InlineTextBox* first, const InlineTextBox* second) { return first->start() < second->start(); }
-
-    LayoutUnit baselinePosition(FontBaseline) const final;
-    LayoutUnit lineHeight() const final;
-
-    std::optional<bool> emphasisMarkExistsAndIsAbove(const RenderStyle&) const;
-
-    LayoutRect logicalOverflowRect() const;
-    void setLogicalOverflowRect(const LayoutRect&);
-    LayoutUnit logicalTopVisualOverflow() const { return logicalOverflowRect().y(); }
-    LayoutUnit logicalBottomVisualOverflow() const { return logicalOverflowRect().maxY(); }
-    LayoutUnit logicalLeftVisualOverflow() const { return logicalOverflowRect().x(); }
-    LayoutUnit logicalRightVisualOverflow() const { return logicalOverflowRect().maxX(); }
-
-    virtual void dirtyOwnLineBoxes() { dirtyLineBoxes(); }
-
-#if ENABLE(TREE_DEBUGGING)
-    void outputLineBox(WTF::TextStream&, bool mark, int depth) const final;
-    const char* boxName() const final;
-#endif
-
-private:
-    LayoutUnit selectionTop() const;
-    LayoutUnit selectionBottom() const;
-    LayoutUnit selectionHeight() const;
-
-public:
-    virtual LayoutRect localSelectionRect(unsigned startPos, unsigned endPos) const;
-    bool isSelected(unsigned startPosition, unsigned endPosition) const;
-    std::pair<unsigned, unsigned> selectionStartEnd() const;
-    std::pair<unsigned, unsigned> highlightStartEnd(HighlightData&) const;
-
-protected:
-    void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom) override;
-    bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom, HitTestAction) override;
-
-    unsigned clampedOffset(unsigned) const;
-
-private:
-    void deleteLine() final;
-    void extractLine() final;
-    void attachLine() final;
-    
-    RenderObject::HighlightState verifySelectionState(RenderObject::HighlightState, HighlightData&) const;
-    std::pair<unsigned, unsigned> clampedStartEndForState(unsigned, unsigned, RenderObject::HighlightState) const;
-
-public:
-    RenderObject::HighlightState selectionState() final;
-
-private:
-    void clearTruncation() final { m_truncation = cNoTruncation; }
-    float placeEllipsisBox(bool flowIsLTR, float visibleLeftEdge, float visibleRightEdge, float ellipsisWidth, float &truncatedWidth, bool& foundBox) final;
-
-public:
-    bool isLineBreak() const final;
-
-private:
-    bool isInlineTextBox() const final { return true; }
-
-public:
-    int caretMinOffset() const final;
-    int caretMaxOffset() const final;
-
-private:
-    float textPos() const; // returns the x position relative to the left start of the text line.
-
-public:
-    virtual int offsetForPosition(float x, bool includePartialGlyphs = true) const;
-    virtual float positionForOffset(unsigned offset) const;
-
-    bool hasMarkers() const;
-    FloatRect calculateUnionOfAllDocumentMarkerBounds() const;
-    FloatRect calculateDocumentMarkerBounds(const MarkedText&) const;
-
-private:
-    enum class TextPaintPhase { Background, Foreground, Decoration };
-
-    Vector<MarkedText> collectMarkedTextsForDraggedContent();
-    Vector<MarkedText> collectMarkedTextsForDocumentMarkers(TextPaintPhase) const;
-    Vector<MarkedText> collectMarkedTextsForHighlights(TextPaintPhase) const;
-
-    FloatPoint textOriginFromBoxRect(const FloatRect&) const;
-
-    void paintMarkedTexts(PaintInfo&, TextPaintPhase, const FloatRect& boxRect, const Vector<StyledMarkedText>&, const FloatRect& decorationClipOutRect = { });
-
-    void paintPlatformDocumentMarker(GraphicsContext&, const FloatPoint& boxOrigin, const MarkedText&);
-    void paintPlatformDocumentMarkers(GraphicsContext&, const FloatPoint& boxOrigin);
-
-    void paintCompositionBackground(PaintInfo&, const FloatPoint& boxOrigin);
-    void paintCompositionUnderlines(PaintInfo&, const FloatPoint& boxOrigin) const;
-    void paintCompositionUnderline(PaintInfo&, const FloatPoint& boxOrigin, const CompositionUnderline&) const;
-
-    enum class MarkedTextBackgroundStyle : bool { Default, Rounded };
-    void paintMarkedTextBackground(PaintInfo&, const FloatPoint& boxOrigin, const Color&, unsigned clampedStartOffset, unsigned clampedEndOffset, MarkedTextBackgroundStyle = MarkedTextBackgroundStyle::Default);
-    void paintMarkedTextForeground(PaintInfo&, const FloatRect& boxRect, const StyledMarkedText&);
-    void paintMarkedTextDecoration(PaintInfo&, const FloatRect& boxRect, const FloatRect& clipOutRect, const StyledMarkedText&);
-
-    const RenderCombineText* combinedText() const;
-    const FontCascade& lineFont() const;
-
-    ShadowData* debugTextShadow();
-
-    String text(bool ignoreCombinedText = false, bool ignoreHyphen = false) const; // The effective text for the run.
-    TextRun createTextRun(bool ignoreCombinedText = false, bool ignoreHyphen = false) const;
-
-    ExpansionBehavior expansionBehavior() const;
-
-    void behavesLikeText() const = delete;
-
-    InlineTextBox* m_prevTextBox { nullptr }; // The previous box that also uses our RenderObject
-    InlineTextBox* m_nextTextBox { nullptr }; // The next box that also uses our RenderObject
-
-    unsigned m_start { 0 };
-    unsigned short m_len { 0 };
-
-    // Where to truncate when text overflow is applied. We use special constants to
-    // denote no truncation (the whole run paints) and full truncation (nothing paints at all).
-    unsigned short m_truncation { cNoTruncation };
-};
-
-LayoutRect snappedSelectionRect(const LayoutRect&, float logicalRight, float selectionTop, float selectionHeight, bool isHorizontal);
-
-} // namespace WebCore
-
-SPECIALIZE_TYPE_TRAITS_INLINE_BOX(InlineTextBox, isInlineTextBox())
</del></span></pre></div>
<a id="trunkSourceWebCorerenderingLegacyInlineBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/LegacyInlineBox.h (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/LegacyInlineBox.h 2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/LegacyInlineBox.h    2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -346,12 +346,12 @@
</span><span class="cx">         ADD_BOOLEAN_BITFIELD(isHorizontal, IsHorizontal);
</span><span class="cx">         // for RootInlineBox
</span><span class="cx">         ADD_BOOLEAN_BITFIELD(endsWithBreak, EndsWithBreak); // Whether the line ends with a <br>.
</span><del>-        // shared between RootInlineBox and InlineTextBox
</del><ins>+        // shared between RootInlineBox and LegacyInlineTextBox
</ins><span class="cx">         ADD_BOOLEAN_BITFIELD(canHaveLeftExpansion, CanHaveLeftExpansion);
</span><span class="cx">         ADD_BOOLEAN_BITFIELD(canHaveRightExpansion, CanHaveRightExpansion);
</span><span class="cx">         ADD_BOOLEAN_BITFIELD(knownToHaveNoOverflow, KnownToHaveNoOverflow);
</span><span class="cx">         ADD_BOOLEAN_BITFIELD(hasEllipsisBoxOrHyphen, HasEllipsisBoxOrHyphen);
</span><del>-        // for InlineTextBox
</del><ins>+        // for LegacyInlineTextBox
</ins><span class="cx">         ADD_BOOLEAN_BITFIELD(dirOverride, DirOverride);
</span><span class="cx">         ADD_BOOLEAN_BITFIELD(behavesLikeText, BehavesLikeText); // Whether or not this object represents text with a non-zero height. Includes non-image list markers, text boxes, br.
</span><span class="cx">         ADD_BOOLEAN_BITFIELD(forceRightExpansion, ForceRightExpansion);
</span><span class="lines">@@ -398,7 +398,7 @@
</span><span class="cx">     bool hasEllipsisBox() const { return m_bitfields.hasEllipsisBoxOrHyphen(); }
</span><span class="cx">     void setHasEllipsisBox(bool hasEllipsisBox) { m_bitfields.setHasEllipsisBoxOrHyphen(hasEllipsisBox); }
</span><span class="cx"> 
</span><del>-    // For InlineTextBox
</del><ins>+    // For LegacyInlineTextBox
</ins><span class="cx">     bool hasHyphen() const { return m_bitfields.hasEllipsisBoxOrHyphen(); }
</span><span class="cx">     bool canHaveLeftExpansion() const { return m_bitfields.canHaveLeftExpansion(); }
</span><span class="cx">     bool canHaveRightExpansion() const { return m_bitfields.canHaveRightExpansion(); }
</span><span class="lines">@@ -405,7 +405,7 @@
</span><span class="cx">     bool forceRightExpansion() const { return m_bitfields.forceRightExpansion(); }
</span><span class="cx">     bool forceLeftExpansion() const { return m_bitfields.forceLeftExpansion(); }
</span><span class="cx">     
</span><del>-    // For LegacyInlineFlowBox and InlineTextBox
</del><ins>+    // For LegacyInlineFlowBox and LegacyInlineTextBox
</ins><span class="cx">     bool extracted() const { return m_bitfields.extracted(); }
</span><span class="cx"> 
</span><span class="cx"> protected:
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingLegacyInlineFlowBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/LegacyInlineFlowBox.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/LegacyInlineFlowBox.cpp   2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/LegacyInlineFlowBox.cpp      2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> #include "FontCascade.h"
</span><span class="cx"> #include "GraphicsContext.h"
</span><span class="cx"> #include "HitTestResult.h"
</span><del>-#include "InlineTextBox.h"
</del><ins>+#include "LegacyInlineTextBox.h"
</ins><span class="cx"> #include "LegacyRootInlineBox.h"
</span><span class="cx"> #include "RenderBlock.h"
</span><span class="cx"> #include "RenderInline.h"
</span><span class="lines">@@ -161,8 +161,8 @@
</span><span class="cx">         if (child->behavesLikeText()) {
</span><span class="cx">             const RenderStyle* childStyle = &child->lineStyle();
</span><span class="cx">             bool hasMarkers = false;
</span><del>-            if (is<InlineTextBox>(child)) {
-                const auto* textBox = downcast<InlineTextBox>(child);
</del><ins>+            if (is<LegacyInlineTextBox>(child)) {
+                const auto* textBox = downcast<LegacyInlineTextBox>(child);
</ins><span class="cx">                 hasMarkers = textBox->hasMarkers();
</span><span class="cx">             }
</span><span class="cx">             if (childStyle->letterSpacing() < 0 || childStyle->textShadow() || childStyle->textEmphasisMark() != TextEmphasisMark::None || childStyle->hasPositiveStrokeWidth() || hasMarkers || !childStyle->textUnderlineOffset().isAuto() || !childStyle->textDecorationThickness().isAuto() || childStyle->textUnderlinePosition() != TextUnderlinePosition::Auto)
</span><span class="lines">@@ -392,7 +392,7 @@
</span><span class="cx">     float totalExpansion = 0;
</span><span class="cx">     for (auto* child = firstChild; child && child != lastChild; child = child->nextOnLine()) {
</span><span class="cx">         if (is<RenderText>(child->renderer())) {
</span><del>-            auto& textBox = downcast<InlineTextBox>(*child);
</del><ins>+            auto& textBox = downcast<LegacyInlineTextBox>(*child);
</ins><span class="cx">             RenderText& renderText = textBox.renderer();
</span><span class="cx">             if (renderText.text().length()) {
</span><span class="cx">                 if (needsWordSpacing && isSpaceOrNewline(renderText.characterAt(textBox.start())))
</span><span class="lines">@@ -472,8 +472,8 @@
</span><span class="cx">                 return true;
</span><span class="cx">             
</span><span class="cx">             const Vector<const Font*>* usedFonts = nullptr;
</span><del>-            if (is<InlineTextBox>(*child)) {
-                GlyphOverflowAndFallbackFontsMap::const_iterator it = textBoxDataMap.find(downcast<InlineTextBox>(child));
</del><ins>+            if (is<LegacyInlineTextBox>(*child)) {
+                GlyphOverflowAndFallbackFontsMap::const_iterator it = textBoxDataMap.find(downcast<LegacyInlineTextBox>(child));
</ins><span class="cx">                 usedFonts = it == textBoxDataMap.end() ? nullptr : &it->value.first;
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="lines">@@ -734,8 +734,8 @@
</span><span class="cx">                     boxHeight -= (topRubyBaseLeading + bottomRubyBaseLeading);
</span><span class="cx">                 }
</span><span class="cx">             }
</span><del>-            if (is<InlineTextBox>(*child)) {
-                if (std::optional<bool> markExistsAndIsAbove = downcast<InlineTextBox>(*child).emphasisMarkExistsAndIsAbove(childLineStyle)) {
</del><ins>+            if (is<LegacyInlineTextBox>(*child)) {
+                if (std::optional<bool> markExistsAndIsAbove = downcast<LegacyInlineTextBox>(*child).emphasisMarkExistsAndIsAbove(childLineStyle)) {
</ins><span class="cx">                     if (*markExistsAndIsAbove != childLineStyle.isFlippedLinesWritingMode())
</span><span class="cx">                         hasAnnotationsBefore = true;
</span><span class="cx">                     else
</span><span class="lines">@@ -906,7 +906,7 @@
</span><span class="cx">     logicalVisualOverflow = LayoutRect(logicalLeftVisualOverflow, logicalTopVisualOverflow, logicalRightVisualOverflow - logicalLeftVisualOverflow, logicalBottomVisualOverflow - logicalTopVisualOverflow);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline void LegacyInlineFlowBox::addTextBoxVisualOverflow(InlineTextBox& textBox, GlyphOverflowAndFallbackFontsMap& textBoxDataMap, LayoutRect& logicalVisualOverflow)
</del><ins>+inline void LegacyInlineFlowBox::addTextBoxVisualOverflow(LegacyInlineTextBox& textBox, GlyphOverflowAndFallbackFontsMap& textBoxDataMap, LayoutRect& logicalVisualOverflow)
</ins><span class="cx"> {
</span><span class="cx">     if (textBox.knownToHaveNoOverflow())
</span><span class="cx">         return;
</span><span class="lines">@@ -1030,7 +1030,7 @@
</span><span class="cx">         if (is<RenderLineBreak>(child->renderer()))
</span><span class="cx">             continue;
</span><span class="cx">         if (is<RenderText>(child->renderer())) {
</span><del>-            auto& textBox = downcast<InlineTextBox>(*child);
</del><ins>+            auto& textBox = downcast<LegacyInlineTextBox>(*child);
</ins><span class="cx">             LayoutRect textBoxOverflow(enclosingLayoutRect(textBox.logicalFrameRect()));
</span><span class="cx">             addTextBoxVisualOverflow(textBox, textBoxDataMap, textBoxOverflow);
</span><span class="cx">             logicalVisualOverflow.unite(textBoxOverflow);
</span><span class="lines">@@ -1613,9 +1613,9 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (is<InlineTextBox>(*child)) {
</del><ins>+        if (is<LegacyInlineTextBox>(*child)) {
</ins><span class="cx">             const RenderStyle& childLineStyle = child->lineStyle();
</span><del>-            std::optional<bool> markExistsAndIsAbove = downcast<InlineTextBox>(*child).emphasisMarkExistsAndIsAbove(childLineStyle);
</del><ins>+            std::optional<bool> markExistsAndIsAbove = downcast<LegacyInlineTextBox>(*child).emphasisMarkExistsAndIsAbove(childLineStyle);
</ins><span class="cx">             if (markExistsAndIsAbove && *markExistsAndIsAbove) {
</span><span class="cx">                 if (!childLineStyle.isFlippedLinesWritingMode()) {
</span><span class="cx">                     int topOfEmphasisMark = child->logicalTop() - childLineStyle.fontCascade().emphasisMarkHeight(childLineStyle.textEmphasisMarkString());
</span><span class="lines">@@ -1661,9 +1661,9 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (is<InlineTextBox>(*child)) {
</del><ins>+        if (is<LegacyInlineTextBox>(*child)) {
</ins><span class="cx">             const RenderStyle& childLineStyle = child->lineStyle();
</span><del>-            std::optional<bool> markExistsAndIsAbove = downcast<InlineTextBox>(*child).emphasisMarkExistsAndIsAbove(childLineStyle);
</del><ins>+            std::optional<bool> markExistsAndIsAbove = downcast<LegacyInlineTextBox>(*child).emphasisMarkExistsAndIsAbove(childLineStyle);
</ins><span class="cx">             if (markExistsAndIsAbove && !*markExistsAndIsAbove) {
</span><span class="cx">                 if (!childLineStyle.isFlippedLinesWritingMode()) {
</span><span class="cx">                     LayoutUnit bottomOfEmphasisMark { child->logicalBottom() + childLineStyle.fontCascade().emphasisMarkHeight(childLineStyle.textEmphasisMarkString()) };
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingLegacyInlineFlowBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/LegacyInlineFlowBox.h (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/LegacyInlineFlowBox.h     2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/LegacyInlineFlowBox.h        2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> class HitTestRequest;
</span><span class="cx"> class HitTestResult;
</span><del>-class InlineTextBox;
</del><ins>+class LegacyInlineTextBox;
</ins><span class="cx"> class RenderLineBoxList;
</span><span class="cx"> class Font;
</span><span class="cx"> class VerticalPositionCache;
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx"> 
</span><span class="cx"> struct GlyphOverflow;
</span><span class="cx"> 
</span><del>-typedef HashMap<const InlineTextBox*, std::pair<Vector<const Font*>, GlyphOverflow>> GlyphOverflowAndFallbackFontsMap;
</del><ins>+typedef HashMap<const LegacyInlineTextBox*, std::pair<Vector<const Font*>, GlyphOverflow>> GlyphOverflowAndFallbackFontsMap;
</ins><span class="cx"> 
</span><span class="cx"> class LegacyInlineFlowBox : public LegacyInlineBox {
</span><span class="cx">     WTF_MAKE_ISO_ALLOCATED(LegacyInlineFlowBox);
</span><span class="lines">@@ -305,7 +305,7 @@
</span><span class="cx"> 
</span><span class="cx">     void addBoxShadowVisualOverflow(LayoutRect& logicalVisualOverflow);
</span><span class="cx">     void addBorderOutsetVisualOverflow(LayoutRect& logicalVisualOverflow);
</span><del>-    void addTextBoxVisualOverflow(InlineTextBox&, GlyphOverflowAndFallbackFontsMap&, LayoutRect& logicalVisualOverflow);
</del><ins>+    void addTextBoxVisualOverflow(LegacyInlineTextBox&, GlyphOverflowAndFallbackFontsMap&, LayoutRect& logicalVisualOverflow);
</ins><span class="cx">     void addOutlineVisualOverflow(LayoutRect& logicalVisualOverflow);
</span><span class="cx">     void addReplacedChildOverflow(const LegacyInlineBox*, LayoutRect& logicalLayoutOverflow, LayoutRect& logicalVisualOverflow);
</span><span class="cx">     void constrainToLineTopAndBottomIfNeeded(LayoutRect&) const;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingLegacyInlineTextBoxcppfromrev278524trunkSourceWebCorerenderingInlineTextBoxcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/rendering/LegacyInlineTextBox.cpp (from rev 278524, trunk/Source/WebCore/rendering/InlineTextBox.cpp) (0 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/LegacyInlineTextBox.cpp                           (rev 0)
+++ trunk/Source/WebCore/rendering/LegacyInlineTextBox.cpp      2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -0,0 +1,1353 @@
</span><ins>+/*
+ * (C) 1999 Lars Knoll (knoll@kde.org)
+ * (C) 2000 Dirk Mueller (mueller@kde.org)
+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "LegacyInlineTextBox.h"
+
+#include "BreakLines.h"
+#include "CompositionHighlight.h"
+#include "DashArray.h"
+#include "Document.h"
+#include "DocumentMarkerController.h"
+#include "Editor.h"
+#include "ElementRuleCollector.h"
+#include "EllipsisBox.h"
+#include "EventRegion.h"
+#include "FloatRoundedRect.h"
+#include "Frame.h"
+#include "GraphicsContext.h"
+#include "HighlightData.h"
+#include "HighlightRegister.h"
+#include "HitTestResult.h"
+#include "ImageBuffer.h"
+#include "InlineTextBoxStyle.h"
+#include "MarkedTextStyle.h"
+#include "Page.h"
+#include "PaintInfo.h"
+#include "RenderBlock.h"
+#include "RenderCombineText.h"
+#include "RenderLineBreak.h"
+#include "RenderRubyRun.h"
+#include "RenderRubyText.h"
+#include "RenderTheme.h"
+#include "RenderView.h"
+#include "RenderedDocumentMarker.h"
+#include "RuntimeEnabledFeatures.h"
+#include "Settings.h"
+#include "Text.h"
+#include "TextDecorationPainter.h"
+#include "TextPaintStyle.h"
+#include "TextPainter.h"
+#include <stdio.h>
+#include <wtf/IsoMallocInlines.h>
+#include <wtf/text/CString.h>
+#include <wtf/text/TextStream.h>
+
+namespace WebCore {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(LegacyInlineTextBox);
+
+struct SameSizeAsLegacyInlineTextBox : public LegacyInlineBox {
+    unsigned variables[1];
+    unsigned short variables2[2];
+    void* pointers[2];
+};
+
+COMPILE_ASSERT(sizeof(LegacyInlineTextBox) == sizeof(SameSizeAsLegacyInlineTextBox), LegacyInlineTextBox_should_stay_small);
+
+typedef WTF::HashMap<const LegacyInlineTextBox*, LayoutRect> LegacyInlineTextBoxOverflowMap;
+static LegacyInlineTextBoxOverflowMap* gTextBoxesWithOverflow;
+
+LegacyInlineTextBox::~LegacyInlineTextBox()
+{
+    if (!knownToHaveNoOverflow() && gTextBoxesWithOverflow)
+        gTextBoxesWithOverflow->remove(this);
+    TextPainter::removeGlyphDisplayList(*this);
+}
+
+bool LegacyInlineTextBox::hasTextContent() const
+{
+    if (m_len > 1)
+        return true;
+    if (auto* combinedText = this->combinedText()) {
+        ASSERT(m_len == 1);
+        return !combinedText->combinedStringForRendering().isEmpty();
+    }
+    return m_len;
+}
+
+void LegacyInlineTextBox::markDirty(bool dirty)
+{
+    if (dirty) {
+        m_len = 0;
+        m_start = 0;
+    }
+    LegacyInlineBox::markDirty(dirty);
+}
+
+LayoutRect LegacyInlineTextBox::logicalOverflowRect() const
+{
+    if (knownToHaveNoOverflow() || !gTextBoxesWithOverflow)
+        return enclosingIntRect(logicalFrameRect());
+    return gTextBoxesWithOverflow->get(this);
+}
+
+void LegacyInlineTextBox::setLogicalOverflowRect(const LayoutRect& rect)
+{
+    ASSERT(!knownToHaveNoOverflow());
+    if (!gTextBoxesWithOverflow)
+        gTextBoxesWithOverflow = new LegacyInlineTextBoxOverflowMap;
+    gTextBoxesWithOverflow->add(this, rect);
+}
+
+LayoutUnit LegacyInlineTextBox::baselinePosition(FontBaseline baselineType) const
+{
+    if (!parent())
+        return 0;
+    if (&parent()->renderer() == renderer().parent())
+        return parent()->baselinePosition(baselineType);
+    return downcast<RenderBoxModelObject>(*renderer().parent()).baselinePosition(baselineType, isFirstLine(), isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine);
+}
+
+LayoutUnit LegacyInlineTextBox::lineHeight() const
+{
+    if (!renderer().parent())
+        return 0;
+    if (&parent()->renderer() == renderer().parent())
+        return parent()->lineHeight();
+    return downcast<RenderBoxModelObject>(*renderer().parent()).lineHeight(isFirstLine(), isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine);
+}
+
+LayoutUnit LegacyInlineTextBox::selectionTop() const
+{
+    return root().selectionTop();
+}
+
+LayoutUnit LegacyInlineTextBox::selectionBottom() const
+{
+    return root().selectionBottom();
+}
+
+LayoutUnit LegacyInlineTextBox::selectionHeight() const
+{
+    return root().selectionHeight();
+}
+
+bool LegacyInlineTextBox::isSelected(unsigned startPosition, unsigned endPosition) const
+{
+    return clampedOffset(startPosition) < clampedOffset(endPosition);
+}
+
+RenderObject::HighlightState LegacyInlineTextBox::selectionState()
+{
+    auto state = verifySelectionState(renderer().selectionState(), renderer().view().selection());
+    
+    // FIXME: this code mutates selection state, but it's used at a simple getter elsewhere
+    // in this file. This code should likely live in HighlightData, or somewhere else.
+    // <rdar://problem/58125978>
+    // https://bugs.webkit.org/show_bug.cgi?id=205528
+    // If there are ellipsis following, make sure their selection is updated.
+    if (m_truncation != cNoTruncation && root().ellipsisBox()) {
+        EllipsisBox* ellipsis = root().ellipsisBox();
+        if (state != RenderObject::HighlightState::None) {
+            auto [selectionStart, selectionEnd] = selectionStartEnd();
+            // The ellipsis should be considered to be selected if the end of
+            // the selection is past the beginning of the truncation and the
+            // beginning of the selection is before or at the beginning of the
+            // truncation.
+            ellipsis->setSelectionState(selectionEnd >= m_truncation && selectionStart <= m_truncation ?
+                RenderObject::HighlightState::Inside : RenderObject::HighlightState::None);
+        } else
+            ellipsis->setSelectionState(RenderObject::HighlightState::None);
+    }
+    
+    return state;
+}
+
+RenderObject::HighlightState LegacyInlineTextBox::verifySelectionState(RenderObject::HighlightState state, HighlightData& selection) const
+{
+    if (state == RenderObject::HighlightState::Start || state == RenderObject::HighlightState::End || state == RenderObject::HighlightState::Both) {
+        auto startOffset = selection.startOffset();
+        auto endOffset = selection.endOffset();
+        // The position after a hard line break is considered to be past its end.
+        ASSERT(start() + len() >= (isLineBreak() ? 1 : 0));
+        unsigned lastSelectable = start() + len() - (isLineBreak() ? 1 : 0);
+
+        bool start = (state != RenderObject::HighlightState::End && startOffset >= m_start && startOffset < m_start + m_len);
+        bool end = (state != RenderObject::HighlightState::Start && endOffset > m_start && endOffset <= lastSelectable);
+        if (start && end)
+            state = RenderObject::HighlightState::Both;
+        else if (start)
+            state = RenderObject::HighlightState::Start;
+        else if (end)
+            state = RenderObject::HighlightState::End;
+        else if ((state == RenderObject::HighlightState::End || startOffset < m_start)
+            && (state == RenderObject::HighlightState::Start || endOffset > lastSelectable))
+            state = RenderObject::HighlightState::Inside;
+        else if (state == RenderObject::HighlightState::Both)
+            state = RenderObject::HighlightState::None;
+    }
+
+    return state;
+}
+
+inline const FontCascade& LegacyInlineTextBox::lineFont() const
+{
+    return combinedText() ? combinedText()->textCombineFont() : lineStyle().fontCascade();
+}
+
+LayoutRect snappedSelectionRect(const LayoutRect& selectionRect, float logicalRight, float selectionTop, float selectionHeight, bool isHorizontal)
+{
+    auto snappedSelectionRect = enclosingIntRect(selectionRect);
+    LayoutUnit logicalWidth = snappedSelectionRect.width();
+    if (snappedSelectionRect.x() > logicalRight)
+        logicalWidth = 0;
+    else if (snappedSelectionRect.maxX() > logicalRight)
+        logicalWidth = logicalRight - snappedSelectionRect.x();
+
+    LayoutPoint topPoint;
+    LayoutUnit width;
+    LayoutUnit height;
+    if (isHorizontal) {
+        topPoint = LayoutPoint { snappedSelectionRect.x(), selectionTop };
+        width = logicalWidth;
+        height = selectionHeight;
+    } else {
+        topPoint = LayoutPoint { selectionTop, snappedSelectionRect.x() };
+        width = selectionHeight;
+        height = logicalWidth;
+    }
+    return LayoutRect { topPoint, LayoutSize { width, height } };
+}
+
+// FIXME: Share more code with paintMarkedTextBackground().
+LayoutRect LegacyInlineTextBox::localSelectionRect(unsigned startPos, unsigned endPos) const
+{
+    unsigned sPos = clampedOffset(startPos);
+    unsigned ePos = clampedOffset(endPos);
+
+    if (sPos >= ePos && !(startPos == endPos && startPos >= start() && startPos <= (start() + len())))
+        return { };
+
+    LayoutUnit selectionTop = this->selectionTop();
+    LayoutUnit selectionHeight = this->selectionHeight();
+
+    TextRun textRun = createTextRun();
+
+    LayoutRect selectionRect { LayoutUnit(logicalLeft()), selectionTop, LayoutUnit(logicalWidth()), selectionHeight };
+    // Avoid measuring the text when the entire line box is selected as an optimization.
+    if (sPos || ePos != textRun.length())
+        lineFont().adjustSelectionRectForText(textRun, selectionRect, sPos, ePos);
+    // FIXME: The computation of the snapped selection rect differs from the computation of this rect
+    // in paintMarkedTextBackground(). See <https://bugs.webkit.org/show_bug.cgi?id=138913>.
+    return snappedSelectionRect(selectionRect, logicalRight(), selectionTop, selectionHeight, isHorizontal());
+}
+
+void LegacyInlineTextBox::deleteLine()
+{
+    renderer().removeTextBox(*this);
+    delete this;
+}
+
+void LegacyInlineTextBox::extractLine()
+{
+    if (extracted())
+        return;
+
+    renderer().extractTextBox(*this);
+}
+
+void LegacyInlineTextBox::attachLine()
+{
+    if (!extracted())
+        return;
+    
+    renderer().attachTextBox(*this);
+}
+
+float LegacyInlineTextBox::placeEllipsisBox(bool flowIsLTR, float visibleLeftEdge, float visibleRightEdge, float ellipsisWidth, float &truncatedWidth, bool& foundBox)
+{
+    if (foundBox) {
+        m_truncation = cFullTruncation;
+        return -1;
+    }
+
+    // For LTR this is the left edge of the box, for RTL, the right edge in parent coordinates.
+    float ellipsisX = flowIsLTR ? visibleRightEdge - ellipsisWidth : visibleLeftEdge + ellipsisWidth;
+    
+    // Criteria for full truncation:
+    // LTR: the left edge of the ellipsis is to the left of our text run.
+    // RTL: the right edge of the ellipsis is to the right of our text run.
+    bool ltrFullTruncation = flowIsLTR && ellipsisX <= left();
+    bool rtlFullTruncation = !flowIsLTR && ellipsisX >= left() + logicalWidth();
+    if (ltrFullTruncation || rtlFullTruncation) {
+        // Too far. Just set full truncation, but return -1 and let the ellipsis just be placed at the edge of the box.
+        m_truncation = cFullTruncation;
+        foundBox = true;
+        return -1;
+    }
+
+    bool ltrEllipsisWithinBox = flowIsLTR && (ellipsisX < right());
+    bool rtlEllipsisWithinBox = !flowIsLTR && (ellipsisX > left());
+    if (ltrEllipsisWithinBox || rtlEllipsisWithinBox) {
+        foundBox = true;
+
+        // The inline box may have different directionality than it's parent. Since truncation
+        // behavior depends both on both the parent and the inline block's directionality, we
+        // must keep track of these separately.
+        bool ltr = isLeftToRightDirection();
+        if (ltr != flowIsLTR) {
+            // Width in pixels of the visible portion of the box, excluding the ellipsis.
+            int visibleBoxWidth = visibleRightEdge - visibleLeftEdge  - ellipsisWidth;
+            ellipsisX = ltr ? left() + visibleBoxWidth : right() - visibleBoxWidth;
+        }
+
+        int offset = offsetForPosition(ellipsisX, false);
+        if (!offset) {
+            // No characters should be rendered. Set ourselves to full truncation and place the ellipsis at the min of our start
+            // and the ellipsis edge.
+            m_truncation = cFullTruncation;
+            truncatedWidth += ellipsisWidth;
+            return flowIsLTR ? std::min(ellipsisX, x()) : std::max(ellipsisX, right() - ellipsisWidth);
+        }
+
+        // Set the truncation index on the text run.
+        m_truncation = offset;
+
+        // If we got here that means that we were only partially truncated and we need to return the pixel offset at which
+        // to place the ellipsis.
+        float widthOfVisibleText = renderer().width(m_start, offset, textPos(), isFirstLine());
+
+        // The ellipsis needs to be placed just after the last visible character.
+        // Where "after" is defined by the flow directionality, not the inline
+        // box directionality.
+        // e.g. In the case of an LTR inline box truncated in an RTL flow then we can
+        // have a situation such as |Hello| -> |...He|
+        truncatedWidth += widthOfVisibleText + ellipsisWidth;
+        if (flowIsLTR)
+            return left() + widthOfVisibleText;
+
+        return right() - widthOfVisibleText - ellipsisWidth;
+    }
+    truncatedWidth += logicalWidth();
+    return -1;
+}
+
+bool LegacyInlineTextBox::isLineBreak() const
+{
+    return renderer().style().preserveNewline() && len() == 1 && renderer().text()[start()] == '\n';
+}
+
+bool LegacyInlineTextBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit /* lineTop */, LayoutUnit /*lineBottom*/,
+    HitTestAction /*hitTestAction*/)
+{
+    if (!visibleToHitTesting(request))
+        return false;
+
+    if (isLineBreak())
+        return false;
+
+    if (m_truncation == cFullTruncation)
+        return false;
+
+    FloatRect rect(locationIncludingFlipping(), size());
+    // Make sure truncated text is ignored while hittesting.
+    if (m_truncation != cNoTruncation) {
+        LayoutUnit widthOfVisibleText { renderer().width(m_start, m_truncation, textPos(), isFirstLine()) };
+
+        if (isHorizontal())
+            renderer().style().isLeftToRightDirection() ? rect.setWidth(widthOfVisibleText) : rect.shiftXEdgeTo(right() - widthOfVisibleText);
+        else
+            rect.setHeight(widthOfVisibleText);
+    }
+
+    rect.moveBy(accumulatedOffset);
+
+    if (locationInContainer.intersects(rect)) {
+        renderer().updateHitTestResult(result, flipForWritingMode(locationInContainer.point() - toLayoutSize(accumulatedOffset)));
+        if (result.addNodeToListBasedTestResult(renderer().nodeForHitTest(), request, locationInContainer, rect) == HitTestProgress::Stop)
+            return true;
+    }
+    return false;
+}
+
+std::optional<bool> LegacyInlineTextBox::emphasisMarkExistsAndIsAbove(const RenderStyle& style) const
+{
+    // This function returns true if there are text emphasis marks and they are suppressed by ruby text.
+    if (style.textEmphasisMark() == TextEmphasisMark::None)
+        return std::nullopt;
+
+    const OptionSet<TextEmphasisPosition> horizontalMask { TextEmphasisPosition::Left, TextEmphasisPosition::Right };
+
+    auto emphasisPosition = style.textEmphasisPosition();
+    auto emphasisPositionHorizontalValue = emphasisPosition & horizontalMask;
+    ASSERT(!((emphasisPosition & TextEmphasisPosition::Over) && (emphasisPosition & TextEmphasisPosition::Under)));
+    ASSERT(emphasisPositionHorizontalValue != horizontalMask);
+
+    bool isAbove = false;
+    if (!emphasisPositionHorizontalValue)
+        isAbove = emphasisPosition.contains(TextEmphasisPosition::Over);
+    else if (style.isHorizontalWritingMode())
+        isAbove = emphasisPosition.contains(TextEmphasisPosition::Over);
+    else
+        isAbove = emphasisPositionHorizontalValue == TextEmphasisPosition::Right;
+
+    if ((style.isHorizontalWritingMode() && (emphasisPosition & TextEmphasisPosition::Under))
+        || (!style.isHorizontalWritingMode() && (emphasisPosition & TextEmphasisPosition::Left)))
+        return isAbove; // Ruby text is always over, so it cannot suppress emphasis marks under.
+
+    RenderBlock* containingBlock = renderer().containingBlock();
+    if (!containingBlock || !containingBlock->isRubyBase())
+        return isAbove; // This text is not inside a ruby base, so it does not have ruby text over it.
+
+    if (!is<RenderRubyRun>(*containingBlock->parent()))
+        return isAbove; // Cannot get the ruby text.
+
+    RenderRubyText* rubyText = downcast<RenderRubyRun>(*containingBlock->parent()).rubyText();
+
+    // The emphasis marks over are suppressed only if there is a ruby text box and it not empty.
+    if (rubyText && rubyText->hasLines())
+        return std::nullopt;
+
+    return isAbove;
+}
+
+static MarkedText createMarkedTextFromSelectionInBox(const LegacyInlineTextBox& box)
+{
+    auto [selectionStart, selectionEnd] = box.selectionStartEnd();
+    if (selectionStart < selectionEnd)
+        return { selectionStart, selectionEnd, MarkedText::Selection };
+    return { };
+}
+
+void LegacyInlineTextBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit /*lineTop*/, LayoutUnit /*lineBottom*/)
+{
+    if (isLineBreak() || !paintInfo.shouldPaintWithinRoot(renderer()) || renderer().style().visibility() != Visibility::Visible
+        || m_truncation == cFullTruncation || paintInfo.phase == PaintPhase::Outline || !hasTextContent())
+        return;
+
+    ASSERT(paintInfo.phase != PaintPhase::SelfOutline && paintInfo.phase != PaintPhase::ChildOutlines);
+
+    LayoutUnit logicalLeftSide = logicalLeftVisualOverflow();
+    LayoutUnit logicalRightSide = logicalRightVisualOverflow();
+    LayoutUnit logicalStart = logicalLeftSide + (isHorizontal() ? paintOffset.x() : paintOffset.y());
+    LayoutUnit logicalExtent = logicalRightSide - logicalLeftSide;
+    
+    LayoutUnit paintEnd = isHorizontal() ? paintInfo.rect.maxX() : paintInfo.rect.maxY();
+    LayoutUnit paintStart = isHorizontal() ? paintInfo.rect.x() : paintInfo.rect.y();
+    
+    FloatPoint localPaintOffset(paintOffset);
+    
+    if (logicalStart >= paintEnd || logicalStart + logicalExtent <= paintStart)
+        return;
+
+    bool isPrinting = renderer().document().printing();
+    
+    // Determine whether or not we're selected.
+    bool haveSelection = !isPrinting && paintInfo.phase != PaintPhase::TextClip && selectionState() != RenderObject::HighlightState::None;
+    if (!haveSelection && paintInfo.phase == PaintPhase::Selection) {
+        // When only painting the selection, don't bother to paint if there is none.
+        return;
+    }
+
+    if (m_truncation != cNoTruncation) {
+        if (renderer().containingBlock()->style().isLeftToRightDirection() != isLeftToRightDirection()) {
+            // Make the visible fragment of text hug the edge closest to the rest of the run by moving the origin
+            // at which we start drawing text.
+            // e.g. In the case of LTR text truncated in an RTL Context, the correct behavior is:
+            // |Hello|CBA| -> |...He|CBA|
+            // In order to draw the fragment "He" aligned to the right edge of it's box, we need to start drawing
+            // farther to the right.
+            // NOTE: WebKit's behavior differs from that of IE which appears to just overlay the ellipsis on top of the
+            // truncated string i.e.  |Hello|CBA| -> |...lo|CBA|
+            LayoutUnit widthOfVisibleText { renderer().width(m_start, m_truncation, textPos(), isFirstLine()) };
+            LayoutUnit widthOfHiddenText { logicalWidth() - widthOfVisibleText };
+            LayoutSize truncationOffset(isLeftToRightDirection() ? widthOfHiddenText : -widthOfHiddenText, 0_lu);
+            localPaintOffset.move(isHorizontal() ? truncationOffset : truncationOffset.transposedSize());
+        }
+    }
+
+    GraphicsContext& context = paintInfo.context();
+
+    const RenderStyle& lineStyle = this->lineStyle();
+    
+    localPaintOffset.move(0, lineStyle.isHorizontalWritingMode() ? 0 : -logicalHeight());
+
+    FloatPoint boxOrigin = locationIncludingFlipping();
+    boxOrigin.moveBy(localPaintOffset);
+    FloatRect boxRect(boxOrigin, FloatSize(logicalWidth(), logicalHeight()));
+
+    if (paintInfo.phase == PaintPhase::EventRegion) {
+        if (visibleToHitTesting())
+            paintInfo.eventRegionContext->unite(enclosingIntRect(boxRect), renderer().style());
+        return;
+    }
+
+    auto* combinedText = this->combinedText();
+
+    bool shouldRotate = !isHorizontal() && !combinedText;
+    if (shouldRotate)
+        context.concatCTM(rotation(boxRect, Clockwise));
+
+    // Determine whether or not we have composition underlines to draw.
+    bool containsComposition = renderer().textNode() && renderer().frame().editor().compositionNode() == renderer().textNode();
+    bool useCustomUnderlines = containsComposition && renderer().frame().editor().compositionUsesCustomUnderlines();
+
+    // 1. Paint backgrounds behind text if needed. Examples of such backgrounds include selection
+    // and composition underlines.
+    if (paintInfo.phase != PaintPhase::Selection && paintInfo.phase != PaintPhase::TextClip && !isPrinting) {
+        if (containsComposition && !useCustomUnderlines)
+            paintCompositionBackground(paintInfo, boxOrigin);
+
+        Vector<MarkedText> markedTexts = collectMarkedTextsForDocumentMarkers(TextPaintPhase::Background);
+        auto highlightMarkedTexts = collectMarkedTextsForHighlights(TextPaintPhase::Background);
+        if (!highlightMarkedTexts.isEmpty())
+            markedTexts.appendVector(WTFMove(highlightMarkedTexts));
+#if ENABLE(TEXT_SELECTION)
+        if (haveSelection && !useCustomUnderlines && !context.paintingDisabled()) {
+            auto selectionMarkedText = createMarkedTextFromSelectionInBox(*this);
+            if (!selectionMarkedText.isEmpty())
+                markedTexts.append(WTFMove(selectionMarkedText));
+        }
+#endif
+        auto styledMarkedTexts = subdivideAndResolveStyle(markedTexts, renderer(), isFirstLine(), paintInfo);
+
+        // Coalesce styles of adjacent marked texts to minimize the number of drawing commands.
+        auto coalescedStyledMarkedTexts = coalesceAdjacentMarkedTexts(styledMarkedTexts, &MarkedTextStyle::areBackgroundMarkedTextStylesEqual);
+
+        paintMarkedTexts(paintInfo, TextPaintPhase::Background, boxRect, coalescedStyledMarkedTexts);
+    }
+
+    // FIXME: Right now, LegacyInlineTextBoxes never call addRelevantUnpaintedObject() even though they might
+    // legitimately be unpainted if they are waiting on a slow-loading web font. We should fix that, and
+    // when we do, we will have to account for the fact the LegacyInlineTextBoxes do not always have unique
+    // renderers and Page currently relies on each unpainted object having a unique renderer.
+    if (paintInfo.phase == PaintPhase::Foreground)
+        renderer().page().addRelevantRepaintedObject(&renderer(), IntRect(boxOrigin.x(), boxOrigin.y(), logicalWidth(), logicalHeight()));
+
+    if (paintInfo.phase == PaintPhase::Foreground)
+        paintPlatformDocumentMarkers(context, boxOrigin);
+
+    // 2. Now paint the foreground, including text and decorations like underline/overline (in quirks mode only).
+    bool shouldPaintSelectionForeground = haveSelection && !useCustomUnderlines;
+    Vector<MarkedText> markedTexts;
+    if (paintInfo.phase != PaintPhase::Selection) {
+        // The marked texts for the gaps between document markers and selection are implicitly created by subdividing the entire line.
+        markedTexts.append({ clampedOffset(m_start), clampedOffset(end()), MarkedText::Unmarked });
+        if (!isPrinting) {
+            markedTexts.appendVector(collectMarkedTextsForDocumentMarkers(TextPaintPhase::Foreground));
+            auto highlightMarkedTexts = collectMarkedTextsForHighlights(TextPaintPhase::Foreground);
+            if (!highlightMarkedTexts.isEmpty())
+                markedTexts.appendVector(WTFMove(highlightMarkedTexts));
+
+            bool shouldPaintDraggedContent = !(paintInfo.paintBehavior.contains(PaintBehavior::ExcludeSelection));
+            if (shouldPaintDraggedContent) {
+                auto markedTextsForDraggedContent = collectMarkedTextsForDraggedContent();
+                if (!markedTextsForDraggedContent.isEmpty()) {
+                    shouldPaintSelectionForeground = false;
+                    markedTexts.appendVector(markedTextsForDraggedContent);
+                }
+            }
+        }
+    }
+    // The selection marked text acts as a placeholder when computing the marked texts for the gaps...
+    if (shouldPaintSelectionForeground) {
+        ASSERT(!isPrinting);
+        auto selectionMarkedText = createMarkedTextFromSelectionInBox(*this);
+        if (!selectionMarkedText.isEmpty())
+            markedTexts.append(WTFMove(selectionMarkedText));
+    }
+
+    auto styledMarkedTexts = subdivideAndResolveStyle(markedTexts, renderer(), isFirstLine(), paintInfo);
+
+    // ... now remove the selection marked text if we are excluding selection.
+    if (!isPrinting && paintInfo.paintBehavior.contains(PaintBehavior::ExcludeSelection)) {
+        styledMarkedTexts.removeAllMatching([] (const StyledMarkedText& markedText) {
+            return markedText.type == MarkedText::Selection;
+        });
+    }
+
+    // Coalesce styles of adjacent marked texts to minimize the number of drawing commands.
+    auto coalescedStyledMarkedTexts = coalesceAdjacentMarkedTexts(styledMarkedTexts, &MarkedTextStyle::areForegroundMarkedTextStylesEqual);
+
+    paintMarkedTexts(paintInfo, TextPaintPhase::Foreground, boxRect, coalescedStyledMarkedTexts);
+
+    // Paint decorations
+    auto textDecorations = lineStyle.textDecorationsInEffect();
+    bool highlightDecorations = !collectMarkedTextsForHighlights(TextPaintPhase::Decoration).isEmpty();
+    bool lineDecorations = !textDecorations.isEmpty();
+    if ((lineDecorations || highlightDecorations) && paintInfo.phase != PaintPhase::Selection) {
+        TextRun textRun = createTextRun();
+        unsigned length = textRun.length();
+        if (m_truncation != cNoTruncation)
+            length = m_truncation;
+        unsigned selectionStart = 0;
+        unsigned selectionEnd = 0;
+        if (haveSelection)
+            std::tie(selectionStart, selectionEnd) = selectionStartEnd();
+
+        FloatRect textDecorationSelectionClipOutRect;
+        if ((paintInfo.paintBehavior.contains(PaintBehavior::ExcludeSelection)) && selectionStart < selectionEnd && selectionEnd <= length) {
+            textDecorationSelectionClipOutRect = logicalOverflowRect();
+            textDecorationSelectionClipOutRect.moveBy(localPaintOffset);
+            float logicalWidthBeforeRange;
+            float logicalWidthAfterRange;
+            float logicalSelectionWidth = lineFont().widthOfTextRange(textRun, selectionStart, selectionEnd, nullptr, &logicalWidthBeforeRange, &logicalWidthAfterRange);
+            // FIXME: Do we need to handle vertical bottom to top text?
+            if (!isHorizontal()) {
+                textDecorationSelectionClipOutRect.move(0, logicalWidthBeforeRange);
+                textDecorationSelectionClipOutRect.setHeight(logicalSelectionWidth);
+            } else if (direction() == TextDirection::RTL) {
+                textDecorationSelectionClipOutRect.move(logicalWidthAfterRange, 0);
+                textDecorationSelectionClipOutRect.setWidth(logicalSelectionWidth);
+            } else {
+                textDecorationSelectionClipOutRect.move(logicalWidthBeforeRange, 0);
+                textDecorationSelectionClipOutRect.setWidth(logicalSelectionWidth);
+            }
+        }
+
+        // Coalesce styles of adjacent marked texts to minimize the number of drawing commands.
+        auto coalescedStyledMarkedTexts = coalesceAdjacentMarkedTexts(styledMarkedTexts, &MarkedTextStyle::areDecorationMarkedTextStylesEqual);
+
+        paintMarkedTexts(paintInfo, TextPaintPhase::Decoration, boxRect, coalescedStyledMarkedTexts, textDecorationSelectionClipOutRect);
+    }
+
+    // 3. Paint fancy decorations, including composition underlines and platform-specific underlines for spelling errors, grammar errors, et cetera.
+    if (paintInfo.phase == PaintPhase::Foreground && useCustomUnderlines)
+        paintCompositionUnderlines(paintInfo, boxOrigin);
+    
+    if (shouldRotate)
+        context.concatCTM(rotation(boxRect, Counterclockwise));
+}
+
+unsigned LegacyInlineTextBox::clampedOffset(unsigned x) const
+{
+    unsigned offset = std::max(std::min(x, m_start + m_len), m_start) - m_start;
+    if (m_truncation == cFullTruncation)
+        return offset;
+    if (m_truncation != cNoTruncation)
+        offset = std::min<unsigned>(offset, m_truncation);
+    else if (offset == m_len) {
+        // Fix up the offset if we are combined text or have a hyphen because we manage these embellishments.
+        // That is, they are not reflected in renderer().text(). We treat combined text as a single unit.
+        // We also treat the last codepoint in this box and the hyphen as a single unit.
+        if (auto* combinedText = this->combinedText())
+            offset = combinedText->combinedStringForRendering().length();
+        else if (hasHyphen())
+            offset += lineStyle().hyphenString().length();
+    }
+    return offset;
+}
+
+std::pair<unsigned, unsigned> LegacyInlineTextBox::clampedStartEndForState(unsigned start, unsigned end, RenderObject::HighlightState selectionState) const
+{
+    if (selectionState == RenderObject::HighlightState::Inside)
+        return { 0, clampedOffset(m_start + m_len) };
+    
+    if (selectionState == RenderObject::HighlightState::Start)
+        end = renderer().text().length();
+    else if (selectionState == RenderObject::HighlightState::End)
+        start = 0;
+    return { clampedOffset(start), clampedOffset(end) };
+}
+
+std::pair<unsigned, unsigned> LegacyInlineTextBox::selectionStartEnd() const
+{
+    auto selectionState = renderer().selectionState();
+    
+    return clampedStartEndForState(renderer().view().selection().startOffset(), renderer().view().selection().endOffset(), selectionState);
+}
+
+std::pair<unsigned, unsigned> LegacyInlineTextBox::highlightStartEnd(HighlightData &rangeData) const
+{
+    auto state = rangeData.highlightStateForRenderer(renderer());
+    state = verifySelectionState(state, rangeData);
+    
+    if (state == RenderObject::HighlightState::None)
+        return {0, 0};
+    
+    return clampedStartEndForState(rangeData.startOffset(), rangeData.endOffset(), state);
+}
+
+bool LegacyInlineTextBox::hasMarkers() const
+{
+    return collectMarkedTextsForDocumentMarkers(TextPaintPhase::Decoration).size();
+}
+
+void LegacyInlineTextBox::paintPlatformDocumentMarkers(GraphicsContext& context, const FloatPoint& boxOrigin)
+{
+    // This must match calculateUnionOfAllDocumentMarkerBounds().
+    for (auto& markedText : subdivide(collectMarkedTextsForDocumentMarkers(TextPaintPhase::Decoration), OverlapStrategy::Frontmost))
+        paintPlatformDocumentMarker(context, boxOrigin, markedText);
+}
+
+FloatRect LegacyInlineTextBox::calculateUnionOfAllDocumentMarkerBounds() const
+{
+    // This must match paintPlatformDocumentMarkers().
+    FloatRect result;
+    for (auto& markedText : subdivide(collectMarkedTextsForDocumentMarkers(TextPaintPhase::Decoration), OverlapStrategy::Frontmost))
+        result = unionRect(result, calculateDocumentMarkerBounds(markedText));
+    return result;
+}
+
+FloatRect LegacyInlineTextBox::calculateDocumentMarkerBounds(const MarkedText& markedText) const
+{
+    auto& font = lineFont();
+    auto ascent = font.fontMetrics().ascent();
+    auto fontSize = std::min(std::max(font.size(), 10.0f), 40.0f);
+    auto y = ascent + 0.11035 * fontSize;
+    auto height = 0.13247 * fontSize;
+
+    // Avoid measuring the text when the entire line box is selected as an optimization.
+    if (markedText.startOffset || markedText.endOffset != clampedOffset(end())) {
+        TextRun run = createTextRun();
+        LayoutRect selectionRect = LayoutRect(0, y, 0, height);
+        lineFont().adjustSelectionRectForText(run, selectionRect, markedText.startOffset, markedText.endOffset);
+        return selectionRect;
+    }
+
+    return FloatRect(0, y, logicalWidth(), height);
+}
+
+void LegacyInlineTextBox::paintPlatformDocumentMarker(GraphicsContext& context, const FloatPoint& boxOrigin, const MarkedText& markedText)
+{
+    // Never print spelling/grammar markers (5327887)
+    if (renderer().document().printing())
+        return;
+
+    if (m_truncation == cFullTruncation)
+        return;
+
+    auto bounds = calculateDocumentMarkerBounds(markedText);
+
+    auto lineStyleForMarkedTextType = [&]() -> DocumentMarkerLineStyle {
+        bool shouldUseDarkAppearance = renderer().useDarkAppearance();
+        switch (markedText.type) {
+        case MarkedText::SpellingError:
+            return { DocumentMarkerLineStyle::Mode::Spelling, shouldUseDarkAppearance };
+        case MarkedText::GrammarError:
+            return { DocumentMarkerLineStyle::Mode::Grammar, shouldUseDarkAppearance };
+        case MarkedText::Correction:
+            return { DocumentMarkerLineStyle::Mode::AutocorrectionReplacement, shouldUseDarkAppearance };
+        case MarkedText::DictationAlternatives:
+            return { DocumentMarkerLineStyle::Mode::DictationAlternatives, shouldUseDarkAppearance };
+#if PLATFORM(IOS_FAMILY)
+        case MarkedText::DictationPhraseWithAlternatives:
+            // FIXME: Rename DocumentMarkerLineStyle::TextCheckingDictationPhraseWithAlternatives and remove the PLATFORM(IOS_FAMILY)-guard.
+            return { DocumentMarkerLineStyle::Mode::TextCheckingDictationPhraseWithAlternatives, shouldUseDarkAppearance };
+#endif
+        default:
+            ASSERT_NOT_REACHED();
+            return { DocumentMarkerLineStyle::Mode::Spelling, shouldUseDarkAppearance };
+        }
+    };
+
+    bounds.moveBy(boxOrigin);
+    context.drawDotsForDocumentMarker(bounds, lineStyleForMarkedTextType());
+}
+
+Vector<MarkedText> LegacyInlineTextBox::collectMarkedTextsForDraggedContent()
+{
+    using DraggendContentRange = std::pair<unsigned, unsigned>;
+    auto draggedContentRanges = renderer().draggedContentRangesBetweenOffsets(m_start, m_start + m_len);
+    Vector<MarkedText> result = draggedContentRanges.map([this] (const DraggendContentRange& range) -> MarkedText {
+        return { clampedOffset(range.first), clampedOffset(range.second), MarkedText::DraggedContent };
+    });
+    return result;
+}
+
+Vector<MarkedText> LegacyInlineTextBox::collectMarkedTextsForDocumentMarkers(TextPaintPhase phase) const
+{
+    ASSERT_ARG(phase, phase == TextPaintPhase::Background || phase == TextPaintPhase::Foreground || phase == TextPaintPhase::Decoration);
+
+    if (!renderer().textNode())
+        return { };
+
+    Vector<RenderedDocumentMarker*> markers = renderer().document().markers().markersFor(*renderer().textNode());
+
+    auto markedTextTypeForMarkerType = [] (DocumentMarker::MarkerType type) {
+        switch (type) {
+        case DocumentMarker::Spelling:
+            return MarkedText::SpellingError;
+        case DocumentMarker::Grammar:
+            return MarkedText::GrammarError;
+        case DocumentMarker::CorrectionIndicator:
+            return MarkedText::Correction;
+        case DocumentMarker::TextMatch:
+            return MarkedText::TextMatch;
+        case DocumentMarker::DictationAlternatives:
+            return MarkedText::DictationAlternatives;
+#if PLATFORM(IOS_FAMILY)
+        case DocumentMarker::DictationPhraseWithAlternatives:
+            return MarkedText::DictationPhraseWithAlternatives;
+#endif
+        default:
+            return MarkedText::Unmarked;
+        }
+    };
+
+    Vector<MarkedText> markedTexts;
+    markedTexts.reserveInitialCapacity(markers.size());
+
+    // Give any document markers that touch this run a chance to draw before the text has been drawn.
+    // Note end() points at the last char, not one past it like endOffset and ranges do.
+    for (auto* marker : markers) {
+        // Collect either the background markers or the foreground markers, but not both
+        switch (marker->type()) {
+        case DocumentMarker::Grammar:
+        case DocumentMarker::Spelling:
+        case DocumentMarker::CorrectionIndicator:
+        case DocumentMarker::Replacement:
+        case DocumentMarker::DictationAlternatives:
+#if PLATFORM(IOS_FAMILY)
+        // FIXME: Remove the PLATFORM(IOS_FAMILY)-guard.
+        case DocumentMarker::DictationPhraseWithAlternatives:
+#endif
+            if (phase != TextPaintPhase::Decoration)
+                continue;
+            break;
+        case DocumentMarker::TextMatch:
+            if (!renderer().frame().editor().markedTextMatchesAreHighlighted())
+                continue;
+            if (phase == TextPaintPhase::Decoration)
+                continue;
+            break;
+#if ENABLE(TELEPHONE_NUMBER_DETECTION)
+        case DocumentMarker::TelephoneNumber:
+            if (!renderer().frame().editor().markedTextMatchesAreHighlighted())
+                continue;
+            if (phase != TextPaintPhase::Background)
+                continue;
+            break;
+#endif
+        default:
+            continue;
+        }
+
+        if (marker->endOffset() <= start()) {
+            // Marker is completely before this run. This might be a marker that sits before the
+            // first run we draw, or markers that were within runs we skipped due to truncation.
+            continue;
+        }
+
+        if (marker->startOffset() >= end()) {
+            // Marker is completely after this run, bail. A later run will paint it.
+            break;
+        }
+
+        // Marker intersects this run. Collect it.
+        switch (marker->type()) {
+        case DocumentMarker::Spelling:
+        case DocumentMarker::CorrectionIndicator:
+        case DocumentMarker::DictationAlternatives:
+        case DocumentMarker::Grammar:
+#if PLATFORM(IOS_FAMILY)
+        // FIXME: See <rdar://problem/8933352>. Also, remove the PLATFORM(IOS_FAMILY)-guard.
+        case DocumentMarker::DictationPhraseWithAlternatives:
+#endif
+        case DocumentMarker::TextMatch:
+            markedTexts.uncheckedAppend({ clampedOffset(marker->startOffset()), clampedOffset(marker->endOffset()), markedTextTypeForMarkerType(marker->type()), marker });
+            break;
+        case DocumentMarker::Replacement:
+            break;
+#if ENABLE(TELEPHONE_NUMBER_DETECTION)
+        case DocumentMarker::TelephoneNumber:
+            break;
+#endif
+        default:
+            ASSERT_NOT_REACHED();
+        }
+    }
+    return markedTexts;
+}
+
+Vector<MarkedText> LegacyInlineTextBox::collectMarkedTextsForHighlights(TextPaintPhase phase) const
+{
+    ASSERT_ARG(phase, phase == TextPaintPhase::Background || phase == TextPaintPhase::Foreground || phase == TextPaintPhase::Decoration);
+    UNUSED_PARAM(phase);
+    if (!renderer().textNode())
+        return { };
+
+    Vector<MarkedText> markedTexts;
+    HighlightData highlightData;
+    if (RuntimeEnabledFeatures::sharedFeatures().highlightAPIEnabled()) {
+        auto& parentRenderer = parent()->renderer();
+        auto& parentStyle = parentRenderer.style();
+        if (auto highlightRegister = renderer().document().highlightRegisterIfExists()) {
+            for (auto& highlight : highlightRegister->map()) {
+                auto renderStyle = parentRenderer.getUncachedPseudoStyle({ PseudoId::Highlight, highlight.key }, &parentStyle);
+                if (!renderStyle)
+                    continue;
+                if (renderStyle->textDecorationsInEffect().isEmpty() && phase == TextPaintPhase::Decoration)
+                    continue;
+                for (auto& rangeData : highlight.value->rangesData()) {
+                    if (!highlightData.setRenderRange(rangeData))
+                        continue;
+
+                    auto [highlightStart, highlightEnd] = highlightStartEnd(highlightData);
+                    if (highlightStart < highlightEnd)
+                        markedTexts.append({ highlightStart, highlightEnd, MarkedText::Highlight, nullptr, highlight.key });
+                }
+            }
+        }
+    }
+#if ENABLE(APP_HIGHLIGHTS)
+    if (auto appHighlightRegister = renderer().document().appHighlightRegisterIfExists()) {
+        if (appHighlightRegister->highlightsVisibility() == HighlightVisibility::Visible) {
+            for (auto& highlight : appHighlightRegister->map()) {
+                for (auto& rangeData : highlight.value->rangesData()) {
+                    if (!highlightData.setRenderRange(rangeData))
+                        continue;
+
+                    auto [highlightStart, highlightEnd] = highlightStartEnd(highlightData);
+                    if (highlightStart < highlightEnd)
+                        markedTexts.append({ highlightStart, highlightEnd, MarkedText::AppHighlight });
+                }
+            }
+        }
+    }
+#endif
+    return markedTexts;
+}
+
+FloatPoint LegacyInlineTextBox::textOriginFromBoxRect(const FloatRect& boxRect) const
+{
+    FloatPoint textOrigin { boxRect.x(), boxRect.y() + lineFont().fontMetrics().ascent() };
+    if (auto* combinedText = this->combinedText()) {
+        if (auto newOrigin = combinedText->computeTextOrigin(boxRect))
+            textOrigin = newOrigin.value();
+    }
+    if (isHorizontal())
+        textOrigin.setY(roundToDevicePixel(LayoutUnit { textOrigin.y() }, renderer().document().deviceScaleFactor()));
+    else
+        textOrigin.setX(roundToDevicePixel(LayoutUnit { textOrigin.x() }, renderer().document().deviceScaleFactor()));
+    return textOrigin;
+}
+
+void LegacyInlineTextBox::paintMarkedTexts(PaintInfo& paintInfo, TextPaintPhase phase, const FloatRect& boxRect, const Vector<StyledMarkedText>& markedTexts, const FloatRect& decorationClipOutRect)
+{
+    switch (phase) {
+    case TextPaintPhase::Background:
+        for (auto& markedText : markedTexts)
+            paintMarkedTextBackground(paintInfo, boxRect.location(), markedText.style.backgroundColor, markedText.startOffset, markedText.endOffset);
+        return;
+    case TextPaintPhase::Foreground:
+        for (auto& markedText : markedTexts)
+            paintMarkedTextForeground(paintInfo, boxRect, markedText);
+        return;
+    case TextPaintPhase::Decoration:
+        for (auto& markedText : markedTexts)
+            paintMarkedTextDecoration(paintInfo, boxRect, decorationClipOutRect, markedText);
+        return;
+    }
+}
+
+void LegacyInlineTextBox::paintMarkedTextBackground(PaintInfo& paintInfo, const FloatPoint& boxOrigin, const Color& color, unsigned clampedStartOffset, unsigned clampedEndOffset, MarkedTextBackgroundStyle style)
+{
+    if (clampedStartOffset >= clampedEndOffset)
+        return;
+
+    GraphicsContext& context = paintInfo.context();
+    GraphicsContextStateSaver stateSaver { context };
+    updateGraphicsContext(context, TextPaintStyle { color }); // Don't draw text at all!
+
+    // Note that if the text is truncated, we let the thing being painted in the truncation
+    // draw its own highlight.
+    TextRun textRun = createTextRun();
+
+    const LegacyRootInlineBox& rootBox = root();
+    LayoutUnit selectionBottom = rootBox.selectionBottom();
+    LayoutUnit selectionTop = rootBox.selectionTopAdjustedForPrecedingBlock();
+
+    // Use same y positioning and height as for selection, so that when the selection and this subrange are on
+    // the same word there are no pieces sticking out.
+    LayoutUnit deltaY { renderer().style().isFlippedLinesWritingMode() ? selectionBottom - logicalBottom() : logicalTop() - selectionTop };
+    LayoutUnit selectionHeight = std::max<LayoutUnit>(0, selectionBottom - selectionTop);
+
+    LayoutRect selectionRect { LayoutUnit(boxOrigin.x()), LayoutUnit(boxOrigin.y() - deltaY), LayoutUnit(logicalWidth()), selectionHeight };
+    lineFont().adjustSelectionRectForText(textRun, selectionRect, clampedStartOffset, clampedEndOffset);
+
+    // FIXME: Support painting combined text. See <https://bugs.webkit.org/show_bug.cgi?id=180993>.
+    auto backgroundRect = snapRectToDevicePixelsWithWritingDirection(selectionRect, renderer().document().deviceScaleFactor(), textRun.ltr());
+    if (style == MarkedTextBackgroundStyle::Rounded) {
+        backgroundRect.expand(-1, -1);
+        backgroundRect.move(0.5, 0.5);
+        context.fillRoundedRect(FloatRoundedRect { backgroundRect, FloatRoundedRect::Radii { 2 } }, color);
+        return;
+    }
+
+    context.fillRect(backgroundRect, color);
+}
+
+void LegacyInlineTextBox::paintMarkedTextForeground(PaintInfo& paintInfo, const FloatRect& boxRect, const StyledMarkedText& markedText)
+{
+    if (markedText.startOffset >= markedText.endOffset)
+        return;
+
+    GraphicsContext& context = paintInfo.context();
+    const FontCascade& font = lineFont();
+    const RenderStyle& lineStyle = this->lineStyle();
+
+    float emphasisMarkOffset = 0;
+    std::optional<bool> markExistsAndIsAbove = emphasisMarkExistsAndIsAbove(lineStyle);
+    const AtomString& emphasisMark = markExistsAndIsAbove ? lineStyle.textEmphasisMarkString() : nullAtom();
+    if (!emphasisMark.isEmpty())
+        emphasisMarkOffset = *markExistsAndIsAbove ? -font.fontMetrics().ascent() - font.emphasisMarkDescent(emphasisMark) : font.fontMetrics().descent() + font.emphasisMarkAscent(emphasisMark);
+
+    TextPainter textPainter { context };
+    textPainter.setFont(font);
+    textPainter.setStyle(markedText.style.textStyles);
+    textPainter.setIsHorizontal(isHorizontal());
+    if (markedText.style.textShadow) {
+        textPainter.setShadow(&markedText.style.textShadow.value());
+        if (lineStyle.hasAppleColorFilter())
+            textPainter.setShadowColorFilter(&lineStyle.appleColorFilter());
+    }
+    textPainter.setEmphasisMark(emphasisMark, emphasisMarkOffset, combinedText());
+    if (auto* debugShadow = debugTextShadow())
+        textPainter.setShadow(debugShadow);
+
+    TextRun textRun = createTextRun();
+    textPainter.setGlyphDisplayListIfNeeded(*this, paintInfo, font, context, textRun);
+
+    GraphicsContextStateSaver stateSaver { context, false };
+    if (markedText.type == MarkedText::DraggedContent) {
+        stateSaver.save();
+        context.setAlpha(markedText.style.alpha);
+    }
+    // TextPainter wants the box rectangle and text origin of the entire line box.
+    textPainter.paintRange(textRun, boxRect, textOriginFromBoxRect(boxRect), markedText.startOffset, markedText.endOffset);
+}
+
+void LegacyInlineTextBox::paintMarkedTextDecoration(PaintInfo& paintInfo, const FloatRect& boxRect, const FloatRect& clipOutRect, const StyledMarkedText& markedText)
+{
+    if (m_truncation == cFullTruncation)
+        return;
+
+    GraphicsContext& context = paintInfo.context();
+    updateGraphicsContext(context, markedText.style.textStyles);
+
+    bool isCombinedText = combinedText();
+    if (isCombinedText)
+        context.concatCTM(rotation(boxRect, Clockwise));
+
+    // 1. Compute text selection
+    unsigned startOffset = markedText.startOffset;
+    unsigned endOffset = markedText.endOffset;
+    if (startOffset >= endOffset)
+        return;
+
+    // Note that if the text is truncated, we let the thing being painted in the truncation
+    // draw its own decoration.
+    TextRun textRun = createTextRun();
+
+    // Avoid measuring the text when the entire line box is selected as an optimization.
+    FloatRect snappedSelectionRect = boxRect;
+    if (startOffset || endOffset != textRun.length()) {
+        LayoutRect selectionRect = { boxRect.x(), boxRect.y(), boxRect.width(), boxRect.height() };
+        lineFont().adjustSelectionRectForText(textRun, selectionRect, startOffset, endOffset);
+        snappedSelectionRect = snapRectToDevicePixelsWithWritingDirection(selectionRect, renderer().document().deviceScaleFactor(), textRun.ltr());
+    }
+
+    // 2. Paint
+    auto textDecorations = lineStyle().textDecorationsInEffect();
+    textDecorations.add(TextDecorationPainter::textDecorationsInEffectForStyle(markedText.style.textDecorationStyles));
+    TextDecorationPainter decorationPainter { context, textDecorations, renderer(), isFirstLine(), lineFont(), markedText.style.textDecorationStyles };
+    decorationPainter.setInlineTextBox(this);
+    decorationPainter.setWidth(snappedSelectionRect.width());
+    decorationPainter.setIsHorizontal(isHorizontal());
+    if (markedText.style.textShadow) {
+        decorationPainter.setTextShadow(&markedText.style.textShadow.value());
+        if (lineStyle().hasAppleColorFilter())
+            decorationPainter.setShadowColorFilter(&lineStyle().appleColorFilter());
+    }
+
+    {
+        GraphicsContextStateSaver stateSaver { context, false };
+        bool isDraggedContent = markedText.type == MarkedText::DraggedContent;
+        if (isDraggedContent || !clipOutRect.isEmpty()) {
+            stateSaver.save();
+            if (isDraggedContent)
+                context.setAlpha(markedText.style.alpha);
+            if (!clipOutRect.isEmpty())
+                context.clipOut(clipOutRect);
+        }
+        decorationPainter.paintTextDecoration(textRun.subRun(startOffset, endOffset - startOffset), textOriginFromBoxRect(snappedSelectionRect), snappedSelectionRect.location());
+    }
+
+    if (isCombinedText)
+        context.concatCTM(rotation(boxRect, Counterclockwise));
+}
+
+void LegacyInlineTextBox::paintCompositionBackground(PaintInfo& paintInfo, const FloatPoint& boxOrigin)
+{
+    if (!renderer().frame().editor().compositionUsesCustomHighlights()) {
+        paintMarkedTextBackground(paintInfo, boxOrigin, CompositionHighlight::defaultCompositionFillColor, clampedOffset(renderer().frame().editor().compositionStart()), clampedOffset(renderer().frame().editor().compositionEnd()));
+        return;
+    }
+
+    for (auto& highlight : renderer().frame().editor().customCompositionHighlights()) {
+        if (highlight.endOffset <= m_start)
+            continue;
+
+        if (highlight.startOffset >= end())
+            break;
+
+        paintMarkedTextBackground(paintInfo, boxOrigin, highlight.color, clampedOffset(highlight.startOffset), clampedOffset(highlight.endOffset), MarkedTextBackgroundStyle::Rounded);
+
+        if (highlight.endOffset > end())
+            break;
+    }
+}
+
+void LegacyInlineTextBox::paintCompositionUnderlines(PaintInfo& paintInfo, const FloatPoint& boxOrigin) const
+{
+    if (m_truncation == cFullTruncation)
+        return;
+
+    for (auto& underline : renderer().frame().editor().customCompositionUnderlines()) {
+        if (underline.endOffset <= m_start) {
+            // Underline is completely before this run. This might be an underline that sits
+            // before the first run we draw, or underlines that were within runs we skipped
+            // due to truncation.
+            continue;
+        }
+
+        if (underline.startOffset >= end())
+            break; // Underline is completely after this run, bail. A later run will paint it.
+
+        // Underline intersects this run. Paint it.
+        paintCompositionUnderline(paintInfo, boxOrigin, underline);
+
+        if (underline.endOffset > end())
+            break; // Underline also runs into the next run. Bail now, no more marker advancement.
+    }
+}
+
+static inline void mirrorRTLSegment(float logicalWidth, TextDirection direction, float& start, float width)
+{
+    if (direction == TextDirection::LTR)
+        return;
+    start = logicalWidth - width - start;
+}
+
+void LegacyInlineTextBox::paintCompositionUnderline(PaintInfo& paintInfo, const FloatPoint& boxOrigin, const CompositionUnderline& underline) const
+{
+    if (m_truncation == cFullTruncation)
+        return;
+    
+    float start = 0; // start of line to draw, relative to tx
+    float width = logicalWidth(); // how much line to draw
+    bool useWholeWidth = true;
+    unsigned paintStart = m_start;
+    unsigned paintEnd = end();
+    if (paintStart <= underline.startOffset) {
+        paintStart = underline.startOffset;
+        useWholeWidth = false;
+        start = renderer().width(m_start, paintStart - m_start, textPos(), isFirstLine());
+    }
+    if (paintEnd != underline.endOffset) {
+        paintEnd = std::min(paintEnd, (unsigned)underline.endOffset);
+        useWholeWidth = false;
+    }
+    if (m_truncation != cNoTruncation) {
+        paintEnd = std::min(paintEnd, (unsigned)m_start + m_truncation);
+        useWholeWidth = false;
+    }
+    if (!useWholeWidth) {
+        width = renderer().width(paintStart, paintEnd - paintStart, textPos() + start, isFirstLine());
+        mirrorRTLSegment(logicalWidth(), direction(), start, width);
+    }
+
+    // Thick marked text underlines are 2px thick as long as there is room for the 2px line under the baseline.
+    // All other marked text underlines are 1px thick.
+    // If there's not enough space the underline will touch or overlap characters.
+    int lineThickness = 1;
+    int baseline = lineStyle().fontMetrics().ascent();
+    if (underline.thick && logicalHeight() - baseline >= 2)
+        lineThickness = 2;
+
+    // We need to have some space between underlines of subsequent clauses, because some input methods do not use different underline styles for those.
+    // We make each line shorter, which has a harmless side effect of shortening the first and last clauses, too.
+    start += 1;
+    width -= 2;
+
+    GraphicsContext& context = paintInfo.context();
+    Color underlineColor = underline.compositionUnderlineColor == CompositionUnderlineColor::TextColor ? renderer().style().visitedDependentColorWithColorFilter(CSSPropertyWebkitTextFillColor) : renderer().style().colorByApplyingColorFilter(underline.color);
+    context.setStrokeColor(underlineColor);
+    context.setStrokeThickness(lineThickness);
+    context.drawLineForText(FloatRect(boxOrigin.x() + start, boxOrigin.y() + logicalHeight() - lineThickness, width, lineThickness), renderer().document().printing());
+}
+
+int LegacyInlineTextBox::caretMinOffset() const
+{
+    return m_start;
+}
+
+int LegacyInlineTextBox::caretMaxOffset() const
+{
+    return m_start + m_len;
+}
+
+float LegacyInlineTextBox::textPos() const
+{
+    // When computing the width of a text run, RenderBlock::computeInlineDirectionPositionsForLine() doesn't include the actual offset
+    // from the containing block edge in its measurement. textPos() should be consistent so the text are rendered in the same width.
+    if (!logicalLeft())
+        return 0;
+    return logicalLeft() - root().logicalLeft();
+}
+
+int LegacyInlineTextBox::offsetForPosition(float lineOffset, bool includePartialGlyphs) const
+{
+    if (isLineBreak())
+        return 0;
+    if (lineOffset - logicalLeft() > logicalWidth())
+        return isLeftToRightDirection() ? len() : 0;
+    if (lineOffset - logicalLeft() < 0)
+        return isLeftToRightDirection() ? 0 : len();
+    bool ignoreCombinedText = true;
+    bool ignoreHyphen = true;
+    return lineFont().offsetForPosition(createTextRun(ignoreCombinedText, ignoreHyphen), lineOffset - logicalLeft(), includePartialGlyphs);
+}
+
+float LegacyInlineTextBox::positionForOffset(unsigned offset) const
+{
+    ASSERT(offset >= m_start);
+    ASSERT(offset <= m_start + len());
+
+    if (isLineBreak())
+        return logicalLeft();
+
+    unsigned startOffset;
+    unsigned endOffset;
+    if (isLeftToRightDirection()) {
+        startOffset = 0;
+        endOffset = clampedOffset(offset);
+    } else {
+        startOffset = clampedOffset(offset);
+        endOffset = m_len;
+    }
+
+    // FIXME: Do we need to add rightBearing here?
+    LayoutRect selectionRect = LayoutRect(logicalLeft(), 0, 0, 0);
+    bool ignoreCombinedText = true;
+    bool ignoreHyphen = true;
+    TextRun textRun = createTextRun(ignoreCombinedText, ignoreHyphen);
+    lineFont().adjustSelectionRectForText(textRun, selectionRect, startOffset, endOffset);
+    return snapRectToDevicePixelsWithWritingDirection(selectionRect, renderer().document().deviceScaleFactor(), textRun.ltr()).maxX();
+}
+
+TextRun LegacyInlineTextBox::createTextRun(bool ignoreCombinedText, bool ignoreHyphen) const
+{
+    const auto& style = lineStyle();
+    TextRun textRun { text(ignoreCombinedText, ignoreHyphen), textPos(), expansion(), expansionBehavior(), direction(), dirOverride() || style.rtlOrdering() == Order::Visual, !renderer().canUseSimpleFontCodePath() };
+    textRun.setTabSize(!style.collapseWhiteSpace(), style.tabSize());
+    return textRun;
+}
+
+String LegacyInlineTextBox::text(bool ignoreCombinedText, bool ignoreHyphen) const
+{
+    String result;
+    if (auto* combinedText = this->combinedText()) {
+        if (ignoreCombinedText)
+            result = renderer().text().substring(m_start, m_len);
+        else
+            result = combinedText->combinedStringForRendering();
+    } else if (hasHyphen()) {
+        if (ignoreHyphen)
+            result = renderer().text().substring(m_start, m_len);
+        else
+            result = makeString(StringView(renderer().text()).substring(m_start, m_len), lineStyle().hyphenString());
+    } else
+        result = renderer().text().substring(m_start, m_len);
+
+    // This works because this replacement doesn't affect string indices. We're replacing a single Unicode code unit with another Unicode code unit.
+    // How convenient.
+    return RenderBlock::updateSecurityDiscCharacters(lineStyle(), WTFMove(result));
+}
+
+inline const RenderCombineText* LegacyInlineTextBox::combinedText() const
+{
+    return lineStyle().hasTextCombine() && is<RenderCombineText>(renderer()) && downcast<RenderCombineText>(renderer()).isCombined() ? &downcast<RenderCombineText>(renderer()) : nullptr;
+}
+
+ShadowData* LegacyInlineTextBox::debugTextShadow()
+{
+    if (!renderer().settings().legacyLineLayoutVisualCoverageEnabled())
+        return nullptr;
+
+    static NeverDestroyed<ShadowData> debugTextShadow(IntPoint(0, 0), 10, 20, ShadowStyle::Normal, true, SRGBA<uint8_t> { 150, 0, 0, 190 });
+    return &debugTextShadow.get();
+}
+
+ExpansionBehavior LegacyInlineTextBox::expansionBehavior() const
+{
+    ExpansionBehavior leftBehavior;
+    if (forceLeftExpansion())
+        leftBehavior = ForceLeftExpansion;
+    else if (canHaveLeftExpansion())
+        leftBehavior = AllowLeftExpansion;
+    else
+        leftBehavior = ForbidLeftExpansion;
+
+    ExpansionBehavior rightBehavior;
+    if (forceRightExpansion())
+        rightBehavior = ForceRightExpansion;
+    else if (expansion() && nextLeafOnLine() && !nextLeafOnLine()->isLineBreak())
+        rightBehavior = AllowRightExpansion;
+    else
+        rightBehavior = ForbidRightExpansion;
+
+    return leftBehavior | rightBehavior;
+}
+
+#if ENABLE(TREE_DEBUGGING)
+
+const char* LegacyInlineTextBox::boxName() const
+{
+    return "InlineTextBox";
+}
+
+void LegacyInlineTextBox::outputLineBox(TextStream& stream, bool mark, int depth) const
+{
+    stream << "-------- " << (isDirty() ? "D" : "-") << "-";
+
+    int printedCharacters = 0;
+    if (mark) {
+        stream << "*";
+        ++printedCharacters;
+    }
+    while (++printedCharacters <= depth * 2)
+        stream << " ";
+
+    String value = renderer().text();
+    value = value.substring(start(), len());
+    value.replaceWithLiteral('\\', "\\\\");
+    value.replaceWithLiteral('\n', "\\n");
+    stream << boxName() << " " << FloatRect(x(), y(), width(), height()) << " (" << this << ") renderer->(" << &renderer() << ") run(" << start() << ", " << start() + len() << ") \"" << value.utf8().data() << "\"";
+    stream.nextLine();
+}
+
+#endif
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderingLegacyInlineTextBoxhfromrev278524trunkSourceWebCorerenderingInlineTextBoxh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/rendering/LegacyInlineTextBox.h (from rev 278524, trunk/Source/WebCore/rendering/InlineTextBox.h) (0 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/LegacyInlineTextBox.h                             (rev 0)
+++ trunk/Source/WebCore/rendering/LegacyInlineTextBox.h        2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -0,0 +1,217 @@
</span><ins>+/*
+ * (C) 1999 Lars Knoll (knoll@kde.org)
+ * (C) 2000 Dirk Mueller (mueller@kde.org)
+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#pragma once
+
+#include "LegacyInlineBox.h"
+#include "RenderText.h"
+#include "TextRun.h"
+
+namespace WebCore {
+
+class RenderCombineText;
+class RenderedDocumentMarker;
+class TextPainter;
+struct CompositionUnderline;
+struct MarkedText;
+struct StyledMarkedText;
+struct TextPaintStyle;
+
+const unsigned short cNoTruncation = USHRT_MAX;
+const unsigned short cFullTruncation = USHRT_MAX - 1;
+
+class LegacyInlineTextBox : public LegacyInlineBox {
+    WTF_MAKE_ISO_ALLOCATED(LegacyInlineTextBox);
+public:
+    explicit LegacyInlineTextBox(RenderText& renderer)
+        : LegacyInlineBox(renderer)
+    {
+        setBehavesLikeText(true);
+    }
+
+    virtual ~LegacyInlineTextBox();
+
+    RenderText& renderer() const { return downcast<RenderText>(LegacyInlineBox::renderer()); }
+    const RenderStyle& lineStyle() const { return isFirstLine() ? renderer().firstLineStyle() : renderer().style(); }
+
+    LegacyInlineTextBox* prevTextBox() const { return m_prevTextBox; }
+    LegacyInlineTextBox* nextTextBox() const { return m_nextTextBox; }
+    void setNextTextBox(LegacyInlineTextBox* n) { m_nextTextBox = n; }
+    void setPreviousTextBox(LegacyInlineTextBox* p) { m_prevTextBox = p; }
+
+    bool hasTextContent() const;
+
+    // These functions do not account for combined text. For combined text this box will always have len() == 1
+    // regardless of whether the resulting composition is the empty string. Use hasTextContent() if you want to
+    // know whether this box has text content.
+    //
+    // FIXME: These accessors should ASSERT(!isDirty()). See https://bugs.webkit.org/show_bug.cgi?id=97264
+    // Note len() == 1 for combined text regardless of whether the composition is empty. Use hasTextContent() to
+    unsigned start() const { return m_start; }
+    unsigned end() const { return m_start + m_len; }
+    unsigned len() const { return m_len; }
+
+    void setStart(unsigned start) { m_start = start; }
+    void setLen(unsigned len) { m_len = len; }
+
+    void offsetRun(int d) { ASSERT(!isDirty()); ASSERT(d > 0 || m_start >= static_cast<unsigned>(-d)); m_start += d; }
+
+    unsigned short truncation() const { return m_truncation; }
+
+    void markDirty(bool dirty = true) final;
+
+    using LegacyInlineBox::hasHyphen;
+    using LegacyInlineBox::setHasHyphen;
+    using LegacyInlineBox::canHaveLeftExpansion;
+    using LegacyInlineBox::setCanHaveLeftExpansion;
+    using LegacyInlineBox::canHaveRightExpansion;
+    using LegacyInlineBox::setCanHaveRightExpansion;
+    using LegacyInlineBox::forceRightExpansion;
+    using LegacyInlineBox::setForceRightExpansion;
+    using LegacyInlineBox::forceLeftExpansion;
+    using LegacyInlineBox::setForceLeftExpansion;
+
+    static inline bool compareByStart(const LegacyInlineTextBox* first, const LegacyInlineTextBox* second) { return first->start() < second->start(); }
+
+    LayoutUnit baselinePosition(FontBaseline) const final;
+    LayoutUnit lineHeight() const final;
+
+    std::optional<bool> emphasisMarkExistsAndIsAbove(const RenderStyle&) const;
+
+    LayoutRect logicalOverflowRect() const;
+    void setLogicalOverflowRect(const LayoutRect&);
+    LayoutUnit logicalTopVisualOverflow() const { return logicalOverflowRect().y(); }
+    LayoutUnit logicalBottomVisualOverflow() const { return logicalOverflowRect().maxY(); }
+    LayoutUnit logicalLeftVisualOverflow() const { return logicalOverflowRect().x(); }
+    LayoutUnit logicalRightVisualOverflow() const { return logicalOverflowRect().maxX(); }
+
+    virtual void dirtyOwnLineBoxes() { dirtyLineBoxes(); }
+
+#if ENABLE(TREE_DEBUGGING)
+    void outputLineBox(WTF::TextStream&, bool mark, int depth) const final;
+    const char* boxName() const final;
+#endif
+
+private:
+    LayoutUnit selectionTop() const;
+    LayoutUnit selectionBottom() const;
+    LayoutUnit selectionHeight() const;
+
+public:
+    virtual LayoutRect localSelectionRect(unsigned startPos, unsigned endPos) const;
+    bool isSelected(unsigned startPosition, unsigned endPosition) const;
+    std::pair<unsigned, unsigned> selectionStartEnd() const;
+    std::pair<unsigned, unsigned> highlightStartEnd(HighlightData&) const;
+
+protected:
+    void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom) override;
+    bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom, HitTestAction) override;
+
+    unsigned clampedOffset(unsigned) const;
+
+private:
+    void deleteLine() final;
+    void extractLine() final;
+    void attachLine() final;
+    
+    RenderObject::HighlightState verifySelectionState(RenderObject::HighlightState, HighlightData&) const;
+    std::pair<unsigned, unsigned> clampedStartEndForState(unsigned, unsigned, RenderObject::HighlightState) const;
+
+public:
+    RenderObject::HighlightState selectionState() final;
+
+private:
+    void clearTruncation() final { m_truncation = cNoTruncation; }
+    float placeEllipsisBox(bool flowIsLTR, float visibleLeftEdge, float visibleRightEdge, float ellipsisWidth, float &truncatedWidth, bool& foundBox) final;
+
+public:
+    bool isLineBreak() const final;
+
+private:
+    bool isInlineTextBox() const final { return true; }
+
+public:
+    int caretMinOffset() const final;
+    int caretMaxOffset() const final;
+
+private:
+    float textPos() const; // returns the x position relative to the left start of the text line.
+
+public:
+    virtual int offsetForPosition(float x, bool includePartialGlyphs = true) const;
+    virtual float positionForOffset(unsigned offset) const;
+
+    bool hasMarkers() const;
+    FloatRect calculateUnionOfAllDocumentMarkerBounds() const;
+    FloatRect calculateDocumentMarkerBounds(const MarkedText&) const;
+
+private:
+    enum class TextPaintPhase { Background, Foreground, Decoration };
+
+    Vector<MarkedText> collectMarkedTextsForDraggedContent();
+    Vector<MarkedText> collectMarkedTextsForDocumentMarkers(TextPaintPhase) const;
+    Vector<MarkedText> collectMarkedTextsForHighlights(TextPaintPhase) const;
+
+    FloatPoint textOriginFromBoxRect(const FloatRect&) const;
+
+    void paintMarkedTexts(PaintInfo&, TextPaintPhase, const FloatRect& boxRect, const Vector<StyledMarkedText>&, const FloatRect& decorationClipOutRect = { });
+
+    void paintPlatformDocumentMarker(GraphicsContext&, const FloatPoint& boxOrigin, const MarkedText&);
+    void paintPlatformDocumentMarkers(GraphicsContext&, const FloatPoint& boxOrigin);
+
+    void paintCompositionBackground(PaintInfo&, const FloatPoint& boxOrigin);
+    void paintCompositionUnderlines(PaintInfo&, const FloatPoint& boxOrigin) const;
+    void paintCompositionUnderline(PaintInfo&, const FloatPoint& boxOrigin, const CompositionUnderline&) const;
+
+    enum class MarkedTextBackgroundStyle : bool { Default, Rounded };
+    void paintMarkedTextBackground(PaintInfo&, const FloatPoint& boxOrigin, const Color&, unsigned clampedStartOffset, unsigned clampedEndOffset, MarkedTextBackgroundStyle = MarkedTextBackgroundStyle::Default);
+    void paintMarkedTextForeground(PaintInfo&, const FloatRect& boxRect, const StyledMarkedText&);
+    void paintMarkedTextDecoration(PaintInfo&, const FloatRect& boxRect, const FloatRect& clipOutRect, const StyledMarkedText&);
+
+    const RenderCombineText* combinedText() const;
+    const FontCascade& lineFont() const;
+
+    ShadowData* debugTextShadow();
+
+    String text(bool ignoreCombinedText = false, bool ignoreHyphen = false) const; // The effective text for the run.
+    TextRun createTextRun(bool ignoreCombinedText = false, bool ignoreHyphen = false) const;
+
+    ExpansionBehavior expansionBehavior() const;
+
+    void behavesLikeText() const = delete;
+
+    LegacyInlineTextBox* m_prevTextBox { nullptr }; // The previous box that also uses our RenderObject
+    LegacyInlineTextBox* m_nextTextBox { nullptr }; // The next box that also uses our RenderObject
+
+    unsigned m_start { 0 };
+    unsigned short m_len { 0 };
+
+    // Where to truncate when text overflow is applied. We use special constants to
+    // denote no truncation (the whole run paints) and full truncation (nothing paints at all).
+    unsigned short m_truncation { cNoTruncation };
+};
+
+LayoutRect snappedSelectionRect(const LayoutRect&, float logicalRight, float selectionTop, float selectionHeight, bool isHorizontal);
+
+} // namespace WebCore
+
+SPECIALIZE_TYPE_TRAITS_INLINE_BOX(LegacyInlineTextBox, isInlineTextBox())
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderingLegacyLineLayoutcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/LegacyLineLayout.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/LegacyLineLayout.cpp      2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/LegacyLineLayout.cpp 2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -32,8 +32,8 @@
</span><span class="cx"> #include "HTMLParserIdioms.h"
</span><span class="cx"> #include "InlineElementBox.h"
</span><span class="cx"> #include "InlineIterator.h"
</span><del>-#include "InlineTextBox.h"
</del><span class="cx"> #include "InlineTextBoxStyle.h"
</span><ins>+#include "LegacyInlineTextBox.h"
</ins><span class="cx"> #include "LineLayoutState.h"
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "RenderBlockFlow.h"
</span><span class="lines">@@ -324,8 +324,8 @@
</span><span class="cx">         bool visuallyOrdered = r->renderer().style().rtlOrdering() == Order::Visual;
</span><span class="cx">         box->setBidiLevel(r->level());
</span><span class="cx"> 
</span><del>-        if (is<InlineTextBox>(*box)) {
-            auto& textBox = downcast<InlineTextBox>(*box);
</del><ins>+        if (is<LegacyInlineTextBox>(*box)) {
+            auto& textBox = downcast<LegacyInlineTextBox>(*box);
</ins><span class="cx">             textBox.setStart(r->m_start);
</span><span class="cx">             textBox.setLen(r->m_stop - r->m_start);
</span><span class="cx">             textBox.setDirOverride(r->dirOverride(visuallyOrdered));
</span><span class="lines">@@ -485,7 +485,7 @@
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     LayoutUnit hyphenWidth;
</span><del>-    if (downcast<InlineTextBox>(*run->box()).hasHyphen())
</del><ins>+    if (downcast<LegacyInlineTextBox>(*run->box()).hasHyphen())
</ins><span class="cx">         hyphenWidth = measureHyphenWidth(renderer, font, &fallbackFonts);
</span><span class="cx"> 
</span><span class="cx">     float measuredWidth = 0;
</span><span class="lines">@@ -538,7 +538,7 @@
</span><span class="cx">     run->box()->setLogicalWidth(measuredWidth + hyphenWidth);
</span><span class="cx">     if (!fallbackFonts.isEmpty()) {
</span><span class="cx">         ASSERT(run->box()->behavesLikeText());
</span><del>-        GlyphOverflowAndFallbackFontsMap::iterator it = textBoxDataMap.add(downcast<InlineTextBox>(run->box()), std::make_pair(Vector<const Font*>(), GlyphOverflow())).iterator;
</del><ins>+        GlyphOverflowAndFallbackFontsMap::iterator it = textBoxDataMap.add(downcast<LegacyInlineTextBox>(run->box()), std::make_pair(Vector<const Font*>(), GlyphOverflow())).iterator;
</ins><span class="cx">         ASSERT(it->value.first.isEmpty());
</span><span class="cx">         it->value.first = copyToVector(fallbackFonts);
</span><span class="cx">         run->box()->parent()->clearDescendantsHaveSameLineHeightAndBaseline();
</span><span class="lines">@@ -546,11 +546,11 @@
</span><span class="cx"> 
</span><span class="cx">     // Include text decoration visual overflow as part of the glyph overflow.
</span><span class="cx">     if (!renderer.style().textDecorationsInEffect().isEmpty())
</span><del>-        glyphOverflow.extendTo(visualOverflowForDecorations(run->box()->lineStyle(), downcast<InlineTextBox>(run->box())));
</del><ins>+        glyphOverflow.extendTo(visualOverflowForDecorations(run->box()->lineStyle(), downcast<LegacyInlineTextBox>(run->box())));
</ins><span class="cx"> 
</span><span class="cx">     if (!glyphOverflow.isEmpty()) {
</span><span class="cx">         ASSERT(run->box()->behavesLikeText());
</span><del>-        GlyphOverflowAndFallbackFontsMap::iterator it = textBoxDataMap.add(downcast<InlineTextBox>(run->box()), std::make_pair(Vector<const Font*>(), GlyphOverflow())).iterator;
</del><ins>+        GlyphOverflowAndFallbackFontsMap::iterator it = textBoxDataMap.add(downcast<LegacyInlineTextBox>(run->box()), std::make_pair(Vector<const Font*>(), GlyphOverflow())).iterator;
</ins><span class="cx">         it->value.second = glyphOverflow;
</span><span class="cx">         run->box()->clearKnownToHaveNoOverflow();
</span><span class="cx">     }
</span><span class="lines">@@ -613,7 +613,7 @@
</span><span class="cx">             
</span><span class="cx">             // Only justify text if whitespace is collapsed.
</span><span class="cx">             if (run->renderer().style().collapseWhiteSpace()) {
</span><del>-                InlineTextBox& textBox = downcast<InlineTextBox>(*run->box());
</del><ins>+                LegacyInlineTextBox& textBox = downcast<LegacyInlineTextBox>(*run->box());
</ins><span class="cx">                 float expansion = (availableLogicalWidth - totalLogicalWidth) * opportunitiesInRun / expansionOpportunityCount;
</span><span class="cx">                 textBox.setExpansion(expansion);
</span><span class="cx">                 totalLogicalWidth += expansion;
</span><span class="lines">@@ -717,7 +717,7 @@
</span><span class="cx">     lineBox->placeBoxesInInlineDirection(lineLogicalLeft, needsWordSpacing);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline ExpansionBehavior expansionBehaviorForInlineTextBox(RenderBlockFlow& block, InlineTextBox& textBox, BidiRun* previousRun, BidiRun* nextRun, TextAlignMode textAlign, bool isAfterExpansion)
</del><ins>+static inline ExpansionBehavior expansionBehaviorForInlineTextBox(RenderBlockFlow& block, LegacyInlineTextBox& textBox, BidiRun* previousRun, BidiRun* nextRun, TextAlignMode textAlign, bool isAfterExpansion)
</ins><span class="cx"> {
</span><span class="cx">     // Tatechuyoko is modeled as the Object Replacement Character (U+FFFC), which can never have expansion opportunities inside nor intrinsically adjacent to it.
</span><span class="cx">     if (textBox.renderer().style().textCombine() == TextCombine::Horizontal)
</span><span class="lines">@@ -732,7 +732,7 @@
</span><span class="cx">             auto& rubyBase = *downcast<RenderRubyRun>(nextRun->renderer()).rubyBase();
</span><span class="cx">             if (rubyBase.firstRootBox() && !rubyBase.firstRootBox()->nextRootBox()) {
</span><span class="cx">                 if (auto* leafChild = rubyBase.firstRootBox()->firstLeafDescendant()) {
</span><del>-                    if (is<InlineTextBox>(*leafChild)) {
</del><ins>+                    if (is<LegacyInlineTextBox>(*leafChild)) {
</ins><span class="cx">                         // FIXME: This leftExpansionOpportunity doesn't actually work because it doesn't perform the UBA
</span><span class="cx">                         if (FontCascade::leftExpansionOpportunity(downcast<RenderText>(leafChild->renderer()).stringView(), leafChild->direction())) {
</span><span class="cx">                             setRightExpansion = true;
</span><span class="lines">@@ -747,7 +747,7 @@
</span><span class="cx">             auto& rubyBase = *downcast<RenderRubyRun>(previousRun->renderer()).rubyBase();
</span><span class="cx">             if (rubyBase.firstRootBox() && !rubyBase.firstRootBox()->nextRootBox()) {
</span><span class="cx">                 if (auto* leafChild = rubyBase.firstRootBox()->lastLeafDescendant()) {
</span><del>-                    if (is<InlineTextBox>(*leafChild)) {
</del><ins>+                    if (is<LegacyInlineTextBox>(*leafChild)) {
</ins><span class="cx">                         // FIXME: This leftExpansionOpportunity doesn't actually work because it doesn't perform the UBA
</span><span class="cx">                         if (FontCascade::rightExpansionOpportunity(downcast<RenderText>(leafChild->renderer()).stringView(), leafChild->direction())) {
</span><span class="cx">                             setLeftExpansion = true;
</span><span class="lines">@@ -776,7 +776,7 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline void applyExpansionBehavior(InlineTextBox& textBox, ExpansionBehavior expansionBehavior)
</del><ins>+static inline void applyExpansionBehavior(LegacyInlineTextBox& textBox, ExpansionBehavior expansionBehavior)
</ins><span class="cx"> {
</span><span class="cx">     switch (expansionBehavior & LeftExpansionMask) {
</span><span class="cx">     case ForceLeftExpansion:
</span><span class="lines">@@ -853,7 +853,7 @@
</span><span class="cx">     bool isAfterExpansion = is<RenderRubyBase>(m_flow) ? downcast<RenderRubyBase>(m_flow).isAfterExpansion() : true;
</span><span class="cx">     Vector<unsigned, 16> expansionOpportunities;
</span><span class="cx"> 
</span><del>-    HashMap<InlineTextBox*, LayoutUnit> logicalSpacingForInlineTextBoxes;
</del><ins>+    HashMap<LegacyInlineTextBox*, LayoutUnit> logicalSpacingForInlineTextBoxes;
</ins><span class="cx">     auto collectSpacingLogicalWidths = [&] () {
</span><span class="cx">         auto totalSpacingWidth = LayoutUnit { };
</span><span class="cx">         // Collect the spacing positions (margin, border padding) for the textboxes by traversing the inline tree of the current line.
</span><span class="lines">@@ -861,7 +861,7 @@
</span><span class="cx">         queue.append(lineBox);
</span><span class="cx">         // 1. Visit each inline box in a preorder fashion
</span><span class="cx">         // 2. Accumulate the spacing when we find an LegacyInlineFlowBox (inline container e.g. span)
</span><del>-        // 3. Add the InlineTextBoxes to the hashmap
</del><ins>+        // 3. Add the LegacyInlineTextBoxes to the hashmap
</ins><span class="cx">         while (!queue.isEmpty()) {
</span><span class="cx">             while (true) {
</span><span class="cx">                 auto* inlineBox = queue.last();
</span><span class="lines">@@ -874,8 +874,8 @@
</span><span class="cx">                     }
</span><span class="cx">                     break;
</span><span class="cx">                 }
</span><del>-                if (is<InlineTextBox>(inlineBox))
-                    logicalSpacingForInlineTextBoxes.add(downcast<InlineTextBox>(inlineBox), totalSpacingWidth);
</del><ins>+                if (is<LegacyInlineTextBox>(inlineBox))
+                    logicalSpacingForInlineTextBoxes.add(downcast<LegacyInlineTextBox>(inlineBox), totalSpacingWidth);
</ins><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="cx">             while (!queue.isEmpty()) {
</span><span class="lines">@@ -895,7 +895,7 @@
</span><span class="cx">     BidiRun* previousRun = nullptr;
</span><span class="cx">     for (; run; run = run->next()) {
</span><span class="cx">         auto computeExpansionOpportunities = [&expansionOpportunities, &expansionOpportunityCount, textAlign, &isAfterExpansion] (RenderBlockFlow& block,
</span><del>-            InlineTextBox& textBox, BidiRun* previousRun, BidiRun* nextRun, const StringView& stringView, TextDirection direction)
</del><ins>+            LegacyInlineTextBox& textBox, BidiRun* previousRun, BidiRun* nextRun, const StringView& stringView, TextDirection direction)
</ins><span class="cx">         {
</span><span class="cx">             if (stringView.isEmpty()) {
</span><span class="cx">                 // Empty runs should still produce an entry in expansionOpportunities list so that the number of items matches the number of runs.
</span><span class="lines">@@ -916,7 +916,7 @@
</span><span class="cx">         }
</span><span class="cx">         if (is<RenderText>(run->renderer())) {
</span><span class="cx">             auto& renderText = downcast<RenderText>(run->renderer());
</span><del>-            auto& textBox = downcast<InlineTextBox>(*run->box());
</del><ins>+            auto& textBox = downcast<LegacyInlineTextBox>(*run->box());
</ins><span class="cx">             if (canHangPunctuationAtStart && lineInfo.isFirstLine() && (isLTR || isLastInFlowRun(*run))
</span><span class="cx">                 && !inlineAncestorHasStartBorderPaddingOrMargin(m_flow, *run->box())) {
</span><span class="cx">                 float hangStartWidth = renderText.hangablePunctuationStartWidth(run->m_start);
</span><span class="lines">@@ -955,10 +955,10 @@
</span><span class="cx">                 if (rubyBase->firstRootBox() && !rubyBase->firstRootBox()->nextRootBox() && run->renderer().style().collapseWhiteSpace()) {
</span><span class="cx">                     rubyBase->setIsAfterExpansion(isAfterExpansion);
</span><span class="cx">                     for (auto* leafChild = rubyBase->firstRootBox()->firstLeafDescendant(); leafChild; leafChild = leafChild->nextLeafOnLine()) {
</span><del>-                        if (!is<InlineTextBox>(*leafChild))
</del><ins>+                        if (!is<LegacyInlineTextBox>(*leafChild))
</ins><span class="cx">                             continue;
</span><span class="cx">                         encounteredJustifiedRuby = true;
</span><del>-                        computeExpansionOpportunities(*rubyBase, downcast<InlineTextBox>(*leafChild), nullptr, nullptr,
</del><ins>+                        computeExpansionOpportunities(*rubyBase, downcast<LegacyInlineTextBox>(*leafChild), nullptr, nullptr,
</ins><span class="cx">                             downcast<RenderText>(leafChild->renderer()).stringView(), leafChild->direction());
</span><span class="cx">                     }
</span><span class="cx">                 }
</span><span class="lines">@@ -1017,7 +1017,7 @@
</span><span class="cx"> 
</span><span class="cx">     auto& renderer = run.renderer();
</span><span class="cx">     if (is<RenderText>(renderer))
</span><del>-        downcast<RenderText>(renderer).removeTextBox(downcast<InlineTextBox>(*inlineBox));
</del><ins>+        downcast<RenderText>(renderer).removeTextBox(downcast<LegacyInlineTextBox>(*inlineBox));
</ins><span class="cx">     delete inlineBox;
</span><span class="cx">     run.setBox(nullptr);
</span><span class="cx">     // removeFromParent() unnecessarily dirties the ancestor subtree.
</span><span class="lines">@@ -1050,7 +1050,7 @@
</span><span class="cx">         // to update the static normal flow x/y of positioned elements.
</span><span class="cx">         bool inlineBoxIsRedundant = false;
</span><span class="cx">         if (is<RenderText>(renderer)) {
</span><del>-            auto& inlineTextBox = downcast<InlineTextBox>(*run->box());
</del><ins>+            auto& inlineTextBox = downcast<LegacyInlineTextBox>(*run->box());
</ins><span class="cx">             downcast<RenderText>(renderer).positionLineBox(inlineTextBox);
</span><span class="cx">             inlineBoxIsRedundant = !inlineTextBox.hasTextContent();
</span><span class="cx">         } else if (is<RenderBox>(renderer)) {
</span><span class="lines">@@ -1263,7 +1263,7 @@
</span><span class="cx">     
</span><span class="cx">     // SVG text layout code computes vertical & horizontal positions on its own.
</span><span class="cx">     // Note that we still need to execute computeVerticalPositionsForLine() as
</span><del>-    // it calls InlineTextBox::positionLineBox(), which tracks whether the box
</del><ins>+    // it calls LegacyInlineTextBox::positionLineBox(), which tracks whether the box
</ins><span class="cx">     // contains reversed text or not. If we wouldn't do that editing and thus
</span><span class="cx">     // text selection in RTL boxes would not work as expected.
</span><span class="cx">     if (isSVGRootInlineBox) {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingLegacyRootInlineBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/LegacyRootInlineBox.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/LegacyRootInlineBox.cpp   2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/LegacyRootInlineBox.cpp      2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> #include "Frame.h"
</span><span class="cx"> #include "GraphicsContext.h"
</span><span class="cx"> #include "HitTestResult.h"
</span><del>-#include "InlineTextBox.h"
</del><ins>+#include "LegacyInlineTextBox.h"
</ins><span class="cx"> #include "LogicalSelectionOffsetCaches.h"
</span><span class="cx"> #include "PaintInfo.h"
</span><span class="cx"> #include "RenderFragmentedFlow.h"
</span><span class="lines">@@ -99,7 +99,7 @@
</span><span class="cx"> bool LegacyRootInlineBox::isHyphenated() const
</span><span class="cx"> {
</span><span class="cx">     for (auto* box = firstLeafDescendant(); box; box = box->nextLeafOnLine()) {
</span><del>-        if (is<InlineTextBox>(*box) && downcast<InlineTextBox>(*box).hasHyphen())
</del><ins>+        if (is<LegacyInlineTextBox>(*box) && downcast<LegacyInlineTextBox>(*box).hasHyphen())
</ins><span class="cx">             return true;
</span><span class="cx">     }
</span><span class="cx">     return false;
</span><span class="lines">@@ -803,8 +803,8 @@
</span><span class="cx"> 
</span><span class="cx">     Vector<const Font*>* usedFonts = nullptr;
</span><span class="cx">     GlyphOverflow* glyphOverflow = nullptr;
</span><del>-    if (is<InlineTextBox>(box)) {
-        GlyphOverflowAndFallbackFontsMap::iterator it = textBoxDataMap.find(&downcast<InlineTextBox>(box));
</del><ins>+    if (is<LegacyInlineTextBox>(box)) {
+        GlyphOverflowAndFallbackFontsMap::iterator it = textBoxDataMap.find(&downcast<LegacyInlineTextBox>(box));
</ins><span class="cx">         usedFonts = it == textBoxDataMap.end() ? nullptr : &it->value.first;
</span><span class="cx">         glyphOverflow = it == textBoxDataMap.end() ? nullptr : &it->value.second;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlock.cpp   2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp      2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -41,8 +41,8 @@
</span><span class="cx"> #include "ImageBuffer.h"
</span><span class="cx"> #include "InlineElementBox.h"
</span><span class="cx"> #include "InlineIterator.h"
</span><del>-#include "InlineTextBox.h"
</del><span class="cx"> #include "LayoutRepainter.h"
</span><ins>+#include "LegacyInlineTextBox.h"
</ins><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "LogicalSelectionOffsetCaches.h"
</span><span class="cx"> #include "OverflowEvent.h"
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockFlowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp       2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp  2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -34,11 +34,11 @@
</span><span class="cx"> #include "HTMLTextAreaElement.h"
</span><span class="cx"> #include "HitTestLocation.h"
</span><span class="cx"> #include "InlineIterator.h"
</span><del>-#include "InlineTextBox.h"
</del><span class="cx"> #include "LayoutIntegrationLineIterator.h"
</span><span class="cx"> #include "LayoutIntegrationLineLayout.h"
</span><span class="cx"> #include "LayoutIntegrationRunIterator.h"
</span><span class="cx"> #include "LayoutRepainter.h"
</span><ins>+#include "LegacyInlineTextBox.h"
</ins><span class="cx"> #include "LegacyLineLayout.h"
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "RenderCombineText.h"
</span><span class="lines">@@ -3232,7 +3232,7 @@
</span><span class="cx"> 
</span><span class="cx">     auto hasSelectedChildren = [&](const LegacyRootInlineBox& root) {
</span><span class="cx">         for (auto* box = root.firstLeafDescendant(); box; box = box->nextLeafOnLine()) {
</span><del>-            if (!is<InlineTextBox>(*box)) {
</del><ins>+            if (!is<LegacyInlineTextBox>(*box)) {
</ins><span class="cx">                 if (box->selectionState() != HighlightState::None)
</span><span class="cx">                     return true;
</span><span class="cx">                 continue;
</span><span class="lines">@@ -3241,7 +3241,7 @@
</span><span class="cx">             auto start = view().selection().startOffset();
</span><span class="cx">             auto end = view().selection().endOffset();
</span><span class="cx"> 
</span><del>-            auto& textBox = downcast<InlineTextBox>(*box);
</del><ins>+            auto& textBox = downcast<LegacyInlineTextBox>(*box);
</ins><span class="cx">             switch (textBox.renderer().selectionState()) {
</span><span class="cx">             case RenderObject::HighlightState::None:
</span><span class="cx">                 continue;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxModelObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp  2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp     2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -704,7 +704,7 @@
</span><span class="cx">     maskImageContext.translate(-maskRect.location());
</span><span class="cx"> 
</span><span class="cx">     // Now add the text to the clip. We do this by painting using a special paint phase that signals to
</span><del>-    // InlineTextBoxes that they should just add their contents to the clip.
</del><ins>+    // LegacyInlineTextBoxes that they should just add their contents to the clip.
</ins><span class="cx">     PaintInfo info(maskImageContext, LayoutRect { maskRect }, PaintPhase::TextClip, PaintBehavior::ForceBlackText);
</span><span class="cx">     if (box) {
</span><span class="cx">         const LegacyRootInlineBox& rootBox = box->root();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderInlinecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderInline.cpp  2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp     2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -29,8 +29,8 @@
</span><span class="cx"> #include "GraphicsContext.h"
</span><span class="cx"> #include "HitTestResult.h"
</span><span class="cx"> #include "InlineElementBox.h"
</span><del>-#include "InlineTextBox.h"
</del><span class="cx"> #include "LayoutIntegrationLineLayout.h"
</span><ins>+#include "LegacyInlineTextBox.h"
</ins><span class="cx"> #include "RenderBlock.h"
</span><span class="cx"> #include "RenderChildIterator.h"
</span><span class="cx"> #include "RenderFragmentedFlow.h"
</span><span class="lines">@@ -318,7 +318,7 @@
</span><span class="cx">             }
</span><span class="cx">         } else if (is<RenderText>(current)) {
</span><span class="cx">             auto& currText = downcast<RenderText>(current);
</span><del>-            for (InlineTextBox* childText = currText.firstTextBox(); childText; childText = childText->nextTextBox()) {
</del><ins>+            for (auto* childText = currText.firstTextBox(); childText; childText = childText->nextTextBox()) {
</ins><span class="cx">                 const LegacyRootInlineBox& rootBox = childText->root();
</span><span class="cx">                 const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->style();
</span><span class="cx">                 int logicalTop = rootBox.logicalTop() + (rootBox.lineStyle().fontCascade().fontMetrics().ascent() - containerStyle.fontCascade().fontMetrics().ascent());
</span><span class="lines">@@ -763,7 +763,7 @@
</span><span class="cx">                 result.uniteIfNonZero(renderInline.linesVisualOverflowBoundingBox());
</span><span class="cx">         } else if (is<RenderText>(current)) {
</span><span class="cx">             // FIXME; Overflow from text boxes is lost. We will need to cache this information in
</span><del>-            // InlineTextBoxes.
</del><ins>+            // LegacyInlineTextBoxes.
</ins><span class="cx">             auto& renderText = downcast<RenderText>(current);
</span><span class="cx">             result.uniteIfNonZero(renderText.linesVisualOverflowBoundingBox());
</span><span class="cx">         }
</span><span class="lines">@@ -1119,7 +1119,7 @@
</span><span class="cx">                         childLine->root().markDirty();
</span><span class="cx">                 } else if (is<RenderText>(current)) {
</span><span class="cx">                     auto& renderText = downcast<RenderText>(current);
</span><del>-                    for (InlineTextBox* childText = renderText.firstTextBox(); childText; childText = childText->nextTextBox())
</del><ins>+                    for (auto* childText = renderText.firstTextBox(); childText; childText = childText->nextTextBox())
</ins><span class="cx">                         childText->root().markDirty();
</span><span class="cx">                 } else if (is<RenderLineBreak>(current)) {
</span><span class="cx">                     auto& renderBR = downcast<RenderLineBreak>(current);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLineBoxListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLineBoxList.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLineBoxList.cpp     2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/RenderLineBoxList.cpp        2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include "HitTestResult.h"
</span><span class="cx"> #include "InlineElementBox.h"
</span><del>-#include "InlineTextBox.h"
</del><ins>+#include "LegacyInlineTextBox.h"
</ins><span class="cx"> #include "LegacyRootInlineBox.h"
</span><span class="cx"> #include "PaintInfo.h"
</span><span class="cx"> #include "RenderBlockFlow.h"
</span><span class="lines">@@ -339,7 +339,7 @@
</span><span class="cx">             if (auto wrapper = downcast<RenderLineBreak>(*current).inlineBoxWrapper())
</span><span class="cx">                 box = &wrapper->root();
</span><span class="cx">         } else if (is<RenderText>(*current)) {
</span><del>-            if (InlineTextBox* textBox = downcast<RenderText>(*current).lastTextBox())
</del><ins>+            if (LegacyInlineTextBox* textBox = downcast<RenderText>(*current).lastTextBox())
</ins><span class="cx">                 box = &textBox->root();
</span><span class="cx">         } else if (is<RenderInline>(*current)) {
</span><span class="cx">             LegacyInlineBox* lastSiblingBox = downcast<RenderInline>(*current).lastLineBoxIncludingCulling();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderText.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderText.cpp    2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/RenderText.cpp       2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -37,7 +37,6 @@
</span><span class="cx"> #include "HTMLParserIdioms.h"
</span><span class="cx"> #include "Hyphenation.h"
</span><span class="cx"> #include "InlineRunAndOffset.h"
</span><del>-#include "InlineTextBox.h"
</del><span class="cx"> #include "LayoutIntegrationLineIterator.h"
</span><span class="cx"> #include "LayoutIntegrationLineLayout.h"
</span><span class="cx"> #include "LayoutIntegrationRunIterator.h"
</span><span class="lines">@@ -480,7 +479,7 @@
</span><span class="cx"> Vector<FloatQuad> RenderText::absoluteQuadsForRange(unsigned start, unsigned end, bool useSelectionHeight, bool ignoreEmptyTextSelections, bool* wasFixed) const
</span><span class="cx"> {
</span><span class="cx">     // Work around signed/unsigned issues. This function takes unsigneds, and is often passed UINT_MAX
</span><del>-    // to mean "all the way to the end". InlineTextBox coordinates are unsigneds, so changing this
</del><ins>+    // to mean "all the way to the end". LegacyInlineTextBox coordinates are unsigneds, so changing this
</ins><span class="cx">     // function to take ints causes various internal mismatches. But selectionRect takes ints, and
</span><span class="cx">     // passing UINT_MAX to it causes trouble. Ideally we'd change selectionRect to take unsigneds, but
</span><span class="cx">     // that would cause many ripple effects, so for now we'll just clamp our unsigned parameters to INT_MAX.
</span><span class="lines">@@ -1492,12 +1491,12 @@
</span><span class="cx">     m_lineBoxes.deleteAll();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::unique_ptr<InlineTextBox> RenderText::createTextBox()
</del><ins>+std::unique_ptr<LegacyInlineTextBox> RenderText::createTextBox()
</ins><span class="cx"> {
</span><del>-    return makeUnique<InlineTextBox>(*this);
</del><ins>+    return makeUnique<LegacyInlineTextBox>(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderText::positionLineBox(InlineTextBox& textBox)
</del><ins>+void RenderText::positionLineBox(LegacyInlineTextBox& textBox)
</ins><span class="cx"> {
</span><span class="cx">     if (!textBox.hasTextContent())
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderText.h (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderText.h      2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/RenderText.h 2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class Font;
</span><del>-class InlineTextBox;
</del><ins>+class LegacyInlineTextBox;
</ins><span class="cx"> struct GlyphOverflow;
</span><span class="cx"> 
</span><span class="cx"> namespace LayoutIntegration {
</span><span class="lines">@@ -61,14 +61,14 @@
</span><span class="cx"> 
</span><span class="cx">     virtual String originalText() const;
</span><span class="cx"> 
</span><del>-    void extractTextBox(InlineTextBox& box) { m_lineBoxes.extract(box); }
-    void attachTextBox(InlineTextBox& box) { m_lineBoxes.attach(box); }
-    void removeTextBox(InlineTextBox& box) { m_lineBoxes.remove(box); }
</del><ins>+    void extractTextBox(LegacyInlineTextBox& box) { m_lineBoxes.extract(box); }
+    void attachTextBox(LegacyInlineTextBox& box) { m_lineBoxes.attach(box); }
+    void removeTextBox(LegacyInlineTextBox& box) { m_lineBoxes.remove(box); }
</ins><span class="cx"> 
</span><span class="cx">     StringImpl& text() const { return *m_text.impl(); } // Since m_text can never be null, returning this type means callers won't null check.
</span><span class="cx">     String textWithoutConvertingBackslashToYenSymbol() const;
</span><span class="cx"> 
</span><del>-    InlineTextBox* createInlineTextBox() { return m_lineBoxes.createAndAppendLineBox(*this); }
</del><ins>+    LegacyInlineTextBox* createInlineTextBox() { return m_lineBoxes.createAndAppendLineBox(*this); }
</ins><span class="cx">     void dirtyLineBoxes(bool fullLayout);
</span><span class="cx">     void deleteLineBoxes();
</span><span class="cx"> 
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx">     UChar characterAt(unsigned) const;
</span><span class="cx">     unsigned length() const final { return text().length(); }
</span><span class="cx"> 
</span><del>-    void positionLineBox(InlineTextBox&);
</del><ins>+    void positionLineBox(LegacyInlineTextBox&);
</ins><span class="cx"> 
</span><span class="cx">     virtual float width(unsigned from, unsigned length, const FontCascade&, float xPos, HashSet<const Font*>* fallbackFonts = nullptr, GlyphOverflow* = nullptr) const;
</span><span class="cx">     virtual float width(unsigned from, unsigned length, float xPos, bool firstLine = false, HashSet<const Font*>* fallbackFonts = nullptr, GlyphOverflow* = nullptr) const;
</span><span class="lines">@@ -131,8 +131,8 @@
</span><span class="cx">     LayoutUnit marginLeft() const { return minimumValueForLength(style().marginLeft(), 0); }
</span><span class="cx">     LayoutUnit marginRight() const { return minimumValueForLength(style().marginRight(), 0); }
</span><span class="cx"> 
</span><del>-    InlineTextBox* firstTextBox() const { return m_lineBoxes.first(); }
-    InlineTextBox* lastTextBox() const { return m_lineBoxes.last(); }
</del><ins>+    LegacyInlineTextBox* firstTextBox() const { return m_lineBoxes.first(); }
+    LegacyInlineTextBox* lastTextBox() const { return m_lineBoxes.last(); }
</ins><span class="cx"> 
</span><span class="cx">     int caretMinOffset() const final;
</span><span class="cx">     int caretMaxOffset() const final;
</span><span class="lines">@@ -150,7 +150,7 @@
</span><span class="cx"> 
</span><span class="cx">     void momentarilyRevealLastTypedCharacter(unsigned offsetAfterLastTypedCharacter);
</span><span class="cx"> 
</span><del>-    InlineTextBox* findNextInlineTextBox(int offset, int& pos) const { return m_lineBoxes.findNext(offset, pos); }
</del><ins>+    LegacyInlineTextBox* findNextInlineTextBox(int offset, int& pos) const { return m_lineBoxes.findNext(offset, pos); }
</ins><span class="cx"> 
</span><span class="cx">     bool isAllCollapsibleWhitespace() const;
</span><span class="cx"> 
</span><span class="lines">@@ -160,7 +160,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
</span><span class="cx"> 
</span><del>-    virtual std::unique_ptr<InlineTextBox> createTextBox();
</del><ins>+    virtual std::unique_ptr<LegacyInlineTextBox> createTextBox();
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(TEXT_AUTOSIZING)
</span><span class="cx">     float candidateComputedTextSize() const { return m_candidateComputedTextSize; }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTextLineBoxescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTextLineBoxes.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTextLineBoxes.cpp   2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/RenderTextLineBoxes.cpp      2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx"> #include "RenderTextLineBoxes.h"
</span><span class="cx"> 
</span><span class="cx"> #include "EllipsisBox.h"
</span><del>-#include "InlineTextBox.h"
</del><ins>+#include "LegacyInlineTextBox.h"
</ins><span class="cx"> #include "LegacyRootInlineBox.h"
</span><span class="cx"> #include "RenderBlock.h"
</span><span class="cx"> #include "RenderStyle.h"
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-InlineTextBox* RenderTextLineBoxes::createAndAppendLineBox(RenderText& renderText)
</del><ins>+LegacyInlineTextBox* RenderTextLineBoxes::createAndAppendLineBox(RenderText& renderText)
</ins><span class="cx"> {
</span><span class="cx">     auto textBox = renderText.createTextBox();
</span><span class="cx">     if (!m_first) {
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx">     return textBox.release();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderTextLineBoxes::extract(InlineTextBox& box)
</del><ins>+void RenderTextLineBoxes::extract(LegacyInlineTextBox& box)
</ins><span class="cx"> {
</span><span class="cx">     checkConsistency();
</span><span class="cx"> 
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx">     checkConsistency();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderTextLineBoxes::attach(InlineTextBox& box)
</del><ins>+void RenderTextLineBoxes::attach(LegacyInlineTextBox& box)
</ins><span class="cx"> {
</span><span class="cx">     checkConsistency();
</span><span class="cx"> 
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx">         box.setPreviousTextBox(m_last);
</span><span class="cx">     } else
</span><span class="cx">         m_first = &box;
</span><del>-    InlineTextBox* last = nullptr;
</del><ins>+    LegacyInlineTextBox* last = nullptr;
</ins><span class="cx">     for (auto* current = &box; current; current = current->nextTextBox()) {
</span><span class="cx">         current->setExtracted(false);
</span><span class="cx">         last = current;
</span><span class="lines">@@ -91,7 +91,7 @@
</span><span class="cx">     checkConsistency();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderTextLineBoxes::remove(InlineTextBox& box)
</del><ins>+void RenderTextLineBoxes::remove(LegacyInlineTextBox& box)
</ins><span class="cx"> {
</span><span class="cx">     checkConsistency();
</span><span class="cx"> 
</span><span class="lines">@@ -122,7 +122,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (!m_first)
</span><span class="cx">         return;
</span><del>-    InlineTextBox* next;
</del><ins>+    LegacyInlineTextBox* next;
</ins><span class="cx">     for (auto* current = m_first; current; current = next) {
</span><span class="cx">         next = current->nextTextBox();
</span><span class="cx">         delete current;
</span><span class="lines">@@ -131,7 +131,7 @@
</span><span class="cx">     m_last = nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-InlineTextBox* RenderTextLineBoxes::findNext(int offset, int& position) const
</del><ins>+LegacyInlineTextBox* RenderTextLineBoxes::findNext(int offset, int& position) const
</ins><span class="cx"> {
</span><span class="cx">     if (!m_first)
</span><span class="cx">         return nullptr;
</span><span class="lines">@@ -256,7 +256,7 @@
</span><span class="cx"> {
</span><span class="cx"> #if ASSERT_ENABLED
</span><span class="cx"> #ifdef CHECK_CONSISTENCY
</span><del>-    const InlineTextBox* prev = nullptr;
</del><ins>+    const LegacyInlineTextBox* prev = nullptr;
</ins><span class="cx">     for (auto* child = m_first; child; child = child->nextTextBox()) {
</span><span class="cx">         ASSERT(child->renderer() == this);
</span><span class="cx">         ASSERT(child->prevTextBox() == prev);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTextLineBoxesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTextLineBoxes.h (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTextLineBoxes.h     2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/RenderTextLineBoxes.h        2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class InlineTextBox;
</del><ins>+class LegacyInlineTextBox;
</ins><span class="cx"> class RenderStyle;
</span><span class="cx"> class RenderText;
</span><span class="cx"> class VisiblePosition;
</span><span class="lines">@@ -39,14 +39,14 @@
</span><span class="cx"> public:
</span><span class="cx">     RenderTextLineBoxes();
</span><span class="cx"> 
</span><del>-    InlineTextBox* first() const { return m_first; }
-    InlineTextBox* last() const { return m_last; }
</del><ins>+    LegacyInlineTextBox* first() const { return m_first; }
+    LegacyInlineTextBox* last() const { return m_last; }
</ins><span class="cx"> 
</span><del>-    InlineTextBox* createAndAppendLineBox(RenderText&);
</del><ins>+    LegacyInlineTextBox* createAndAppendLineBox(RenderText&);
</ins><span class="cx"> 
</span><del>-    void extract(InlineTextBox&);
-    void attach(InlineTextBox&);
-    void remove(InlineTextBox&);
</del><ins>+    void extract(LegacyInlineTextBox&);
+    void attach(LegacyInlineTextBox&);
+    void remove(LegacyInlineTextBox&);
</ins><span class="cx"> 
</span><span class="cx">     void removeAllFromParent(RenderText&);
</span><span class="cx">     void deleteAll();
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">     void dirtyAll();
</span><span class="cx">     bool dirtyRange(RenderText&, unsigned start, unsigned end, int lengthDelta);
</span><span class="cx"> 
</span><del>-    InlineTextBox* findNext(int offset, int& position) const;
</del><ins>+    LegacyInlineTextBox* findNext(int offset, int& position) const;
</ins><span class="cx"> 
</span><span class="cx">     LayoutRect visualOverflowBoundingBox(const RenderText&) const;
</span><span class="cx"> 
</span><span class="lines">@@ -69,8 +69,8 @@
</span><span class="cx"> private:
</span><span class="cx">     void checkConsistency() const;
</span><span class="cx"> 
</span><del>-    InlineTextBox* m_first;
-    InlineTextBox* m_last;
</del><ins>+    LegacyInlineTextBox* m_first;
+    LegacyInlineTextBox* m_last;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTreeAsTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTreeAsText.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTreeAsText.cpp      2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/RenderTreeAsText.cpp 2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -36,8 +36,8 @@
</span><span class="cx"> #include "HTMLNames.h"
</span><span class="cx"> #include "HTMLSpanElement.h"
</span><span class="cx"> #include "InlineIterator.h"
</span><del>-#include "InlineTextBox.h"
</del><span class="cx"> #include "LayoutIntegrationRunIterator.h"
</span><ins>+#include "LegacyInlineTextBox.h"
</ins><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "PrintContext.h"
</span><span class="cx"> #include "PseudoElement.h"
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingTextDecorationPainterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/TextDecorationPainter.h (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/TextDecorationPainter.h   2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/TextDecorationPainter.h      2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> class FontCascade;
</span><span class="cx"> class FloatRect;
</span><span class="cx"> class GraphicsContext;
</span><del>-class InlineTextBox;
</del><ins>+class LegacyInlineTextBox;
</ins><span class="cx"> class RenderObject;
</span><span class="cx"> class RenderStyle;
</span><span class="cx"> class RenderText;
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx">     struct Styles;
</span><span class="cx">     TextDecorationPainter(GraphicsContext&, OptionSet<TextDecoration> decorations, const RenderText&, bool isFirstLine, const FontCascade&, std::optional<Styles> = std::nullopt);
</span><span class="cx">     
</span><del>-    void setInlineTextBox(const InlineTextBox* inlineTextBox) { m_inlineTextBox = inlineTextBox; }
</del><ins>+    void setInlineTextBox(const LegacyInlineTextBox* inlineTextBox) { m_inlineTextBox = inlineTextBox; }
</ins><span class="cx">     void setIsHorizontal(bool isHorizontal) { m_isHorizontal = isHorizontal; }
</span><span class="cx">     void setWidth(float width) { m_width = width; }
</span><span class="cx">     void setTextShadow(const ShadowData* textShadow) { m_shadow = textShadow; }
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx">     bool m_isHorizontal { true };
</span><span class="cx">     const ShadowData* m_shadow { nullptr };
</span><span class="cx">     const FilterOperations* m_shadowColorFilter { nullptr };
</span><del>-    const InlineTextBox* m_inlineTextBox { nullptr };
</del><ins>+    const LegacyInlineTextBox* m_inlineTextBox { nullptr };
</ins><span class="cx">     const FontCascade& m_font;
</span><span class="cx"> 
</span><span class="cx">     Styles m_styles;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingTextPaintercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/TextPainter.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/TextPainter.cpp   2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/TextPainter.cpp      2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -27,8 +27,8 @@
</span><span class="cx"> #include "FilterOperations.h"
</span><span class="cx"> #include "GraphicsContext.h"
</span><span class="cx"> #include "HTMLParserIdioms.h"
</span><del>-#include "InlineTextBox.h"
</del><span class="cx"> #include "LayoutIntegrationRun.h"
</span><ins>+#include "LegacyInlineTextBox.h"
</ins><span class="cx"> #include "RenderCombineText.h"
</span><span class="cx"> #include "RenderLayer.h"
</span><span class="cx"> #include "RuntimeEnabledFeatures.h"
</span><span class="lines">@@ -227,7 +227,7 @@
</span><span class="cx"> 
</span><span class="cx"> void TextPainter::clearGlyphDisplayLists()
</span><span class="cx"> {
</span><del>-    GlyphDisplayListCache<InlineTextBox>::singleton().clear();
</del><ins>+    GlyphDisplayListCache<LegacyInlineTextBox>::singleton().clear();
</ins><span class="cx"> #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
</span><span class="cx">     if (RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextIntegrationEnabled())
</span><span class="cx">         GlyphDisplayListCache<LayoutIntegration::Run>::singleton().clear();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGInlineTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp       2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp  2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -112,7 +112,7 @@
</span><span class="cx">         textAncestor->subtreeStyleDidChange(this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::unique_ptr<InlineTextBox> RenderSVGInlineText::createTextBox()
</del><ins>+std::unique_ptr<LegacyInlineTextBox> RenderSVGInlineText::createTextBox()
</ins><span class="cx"> {
</span><span class="cx">     auto box = makeUnique<SVGInlineTextBox>(*this);
</span><span class="cx">     box->setHasVirtualLogicalHeight();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGInlineTexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.h (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.h 2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.h    2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx"> 
</span><span class="cx">     VisiblePosition positionForPoint(const LayoutPoint&, const RenderFragmentContainer*) override;
</span><span class="cx">     IntRect linesBoundingBox() const override;
</span><del>-    std::unique_ptr<InlineTextBox> createTextBox() override;
</del><ins>+    std::unique_ptr<LegacyInlineTextBox> createTextBox() override;
</ins><span class="cx"> 
</span><span class="cx">     float m_scalingFactor;
</span><span class="cx">     FontCascade m_scaledFont;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGInlineTextBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp  2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp     2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx"> 
</span><span class="cx"> WTF_MAKE_ISO_ALLOCATED_IMPL(SVGInlineTextBox);
</span><span class="cx"> 
</span><del>-struct ExpectedSVGInlineTextBoxSize : public InlineTextBox {
</del><ins>+struct ExpectedSVGInlineTextBoxSize : public LegacyInlineTextBox {
</ins><span class="cx">     float float1;
</span><span class="cx">     uint32_t bitfields : 5;
</span><span class="cx">     void* pointer;
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx"> COMPILE_ASSERT(sizeof(SVGInlineTextBox) == sizeof(ExpectedSVGInlineTextBoxSize), SVGInlineTextBox_is_not_of_expected_size);
</span><span class="cx"> 
</span><span class="cx"> SVGInlineTextBox::SVGInlineTextBox(RenderSVGInlineText& renderer)
</span><del>-    : InlineTextBox(renderer)
</del><ins>+    : LegacyInlineTextBox(renderer)
</ins><span class="cx">     , m_paintingResourceMode(OptionSet<RenderSVGResourceMode>().toRaw())
</span><span class="cx">     , m_startsNewTextChunk(false)
</span><span class="cx"> {
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx"> 
</span><span class="cx"> void SVGInlineTextBox::dirtyOwnLineBoxes()
</span><span class="cx"> {
</span><del>-    InlineTextBox::dirtyLineBoxes();
</del><ins>+    LegacyInlineTextBox::dirtyLineBoxes();
</ins><span class="cx"> 
</span><span class="cx">     // Clear the now stale text fragments
</span><span class="cx">     clearTextFragments();
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx"> 
</span><span class="cx">     // And clear any following text fragments as the text on which they
</span><span class="cx">     // depend may now no longer exist, or glyph positions may be wrong
</span><del>-    for (InlineTextBox* nextBox = nextTextBox(); nextBox; nextBox = nextBox->nextTextBox())
</del><ins>+    for (auto* nextBox = nextTextBox(); nextBox; nextBox = nextBox->nextTextBox())
</ins><span class="cx">         nextBox->dirtyOwnLineBoxes();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -86,7 +86,7 @@
</span><span class="cx"> 
</span><span class="cx"> int SVGInlineTextBox::offsetForPositionInFragment(const SVGTextFragment& fragment, float position, bool includePartialGlyphs) const
</span><span class="cx"> {
</span><del>-   float scalingFactor = renderer().scalingFactor();
</del><ins>+    float scalingFactor = renderer().scalingFactor();
</ins><span class="cx">     ASSERT(scalingFactor);
</span><span class="cx"> 
</span><span class="cx">     TextRun textRun = constructTextRun(renderer().style(), fragment);
</span><span class="lines">@@ -240,7 +240,7 @@
</span><span class="cx">     if (renderer().style().visibility() != Visibility::Visible)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    // Note: We're explicitly not supporting composition & custom underlines and custom highlighters - unlike InlineTextBox.
</del><ins>+    // Note: We're explicitly not supporting composition & custom underlines and custom highlighters - unlike LegacyInlineTextBox.
</ins><span class="cx">     // If we ever need that for SVG, it's very easy to refactor and reuse the code.
</span><span class="cx"> 
</span><span class="cx">     auto& parentRenderer = parent()->renderer();
</span><span class="lines">@@ -638,7 +638,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool SVGInlineTextBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit, LayoutUnit, HitTestAction)
</span><span class="cx"> {
</span><del>-    // FIXME: integrate with InlineTextBox::nodeAtPoint better.
</del><ins>+    // FIXME: integrate with LegacyInlineTextBox::nodeAtPoint better.
</ins><span class="cx">     ASSERT(!isLineBreak());
</span><span class="cx"> 
</span><span class="cx">     PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_TEXT_HITTESTING, request, renderer().style().pointerEvents());
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGInlineTextBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.h (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.h    2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.h       2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -21,7 +21,7 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><del>-#include "InlineTextBox.h"
</del><ins>+#include "LegacyInlineTextBox.h"
</ins><span class="cx"> #include "RenderSVGInlineText.h"
</span><span class="cx"> #include "RenderSVGResource.h"
</span><span class="cx"> #include "SVGTextFragment.h"
</span><span class="lines">@@ -31,12 +31,12 @@
</span><span class="cx"> class RenderSVGResource;
</span><span class="cx"> class SVGRootInlineBox;
</span><span class="cx"> 
</span><del>-class SVGInlineTextBox final : public InlineTextBox {
</del><ins>+class SVGInlineTextBox final : public LegacyInlineTextBox {
</ins><span class="cx">     WTF_MAKE_ISO_ALLOCATED(SVGInlineTextBox);
</span><span class="cx"> public:
</span><span class="cx">     explicit SVGInlineTextBox(RenderSVGInlineText&);
</span><span class="cx"> 
</span><del>-    RenderSVGInlineText& renderer() const { return downcast<RenderSVGInlineText>(InlineTextBox::renderer()); }
</del><ins>+    RenderSVGInlineText& renderer() const { return downcast<RenderSVGInlineText>(LegacyInlineTextBox::renderer()); }
</ins><span class="cx"> 
</span><span class="cx">     float virtualLogicalHeight() const override { return m_logicalHeight; }
</span><span class="cx">     void setLogicalHeight(float height) { m_logicalHeight = height; }
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx">     OptionSet<RenderSVGResourceMode> paintingResourceMode() const { return OptionSet<RenderSVGResourceMode>::fromRaw(m_paintingResourceMode); }
</span><span class="cx">     void setPaintingResourceMode(OptionSet<RenderSVGResourceMode> mode) { m_paintingResourceMode = mode.toRaw(); }
</span><span class="cx"> 
</span><del>-    SVGInlineTextBox* nextTextBox() const { return downcast<SVGInlineTextBox>(InlineTextBox::nextTextBox()); }
</del><ins>+    SVGInlineTextBox* nextTextBox() const { return downcast<SVGInlineTextBox>(LegacyInlineTextBox::nextTextBox()); }
</ins><span class="cx">     
</span><span class="cx"> private:
</span><span class="cx">     bool isSVGInlineTextBox() const override { return true; }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGRenderTreeAsTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp       2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp  2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -362,7 +362,7 @@
</span><span class="cx"> 
</span><span class="cx"> static inline void writeSVGInlineTextBoxes(TextStream& ts, const RenderText& text)
</span><span class="cx"> {
</span><del>-    for (InlineTextBox* box = text.firstTextBox(); box; box = box->nextTextBox()) {
</del><ins>+    for (auto* box = text.firstTextBox(); box; box = box->nextTextBox()) {
</ins><span class="cx">         if (!is<SVGInlineTextBox>(*box))
</span><span class="cx">             continue;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorestyleInlineTextBoxStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/InlineTextBoxStyle.cpp (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/InlineTextBoxStyle.cpp        2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/style/InlineTextBoxStyle.cpp   2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -27,13 +27,13 @@
</span><span class="cx"> #include "InlineTextBoxStyle.h"
</span><span class="cx"> 
</span><span class="cx"> #include "FontCascade.h"
</span><del>-#include "InlineTextBox.h"
</del><ins>+#include "LegacyInlineTextBox.h"
</ins><span class="cx"> #include "LegacyRootInlineBox.h"
</span><span class="cx"> #include "TextUnderlineOffset.h"
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx">     
</span><del>-float computeUnderlineOffset(TextUnderlinePosition underlinePosition, TextUnderlineOffset underlineOffset, const FontMetrics& fontMetrics, const InlineTextBox* inlineTextBox, float defaultGap)
</del><ins>+float computeUnderlineOffset(TextUnderlinePosition underlinePosition, TextUnderlineOffset underlineOffset, const FontMetrics& fontMetrics, const LegacyInlineTextBox* inlineTextBox, float defaultGap)
</ins><span class="cx"> {
</span><span class="cx">     // This represents the gap between the baseline and the closest edge of the underline.
</span><span class="cx">     float gap = std::max<int>(1, std::ceil(defaultGap / 2.0f));
</span><span class="lines">@@ -102,7 +102,7 @@
</span><span class="cx">     extendMe = std::max(extendMe, static_cast<int>(ceilf(extendTo)));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-GlyphOverflow visualOverflowForDecorations(const RenderStyle& lineStyle, const InlineTextBox* inlineTextBox)
</del><ins>+GlyphOverflow visualOverflowForDecorations(const RenderStyle& lineStyle, const LegacyInlineTextBox* inlineTextBox)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!inlineTextBox || inlineTextBox->lineStyle() == lineStyle);
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCorestyleInlineTextBoxStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/InlineTextBoxStyle.h (278524 => 278525)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/InlineTextBoxStyle.h  2021-06-05 07:28:13 UTC (rev 278524)
+++ trunk/Source/WebCore/style/InlineTextBoxStyle.h     2021-06-05 12:19:10 UTC (rev 278525)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx">     
</span><del>-class InlineTextBox;
</del><ins>+class LegacyInlineTextBox;
</ins><span class="cx"> class RenderStyle;
</span><span class="cx"> class TextUnderlineOffset;
</span><span class="cx"> 
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx">     float step { 0 };
</span><span class="cx"> };
</span><span class="cx"> WavyStrokeParameters getWavyStrokeParameters(float fontSize);
</span><del>-GlyphOverflow visualOverflowForDecorations(const RenderStyle& lineStyle, const InlineTextBox*);
-float computeUnderlineOffset(TextUnderlinePosition, TextUnderlineOffset, const FontMetrics&, const InlineTextBox*, float textDecorationThickness);
</del><ins>+GlyphOverflow visualOverflowForDecorations(const RenderStyle& lineStyle, const LegacyInlineTextBox*);
+float computeUnderlineOffset(TextUnderlinePosition, TextUnderlineOffset, const FontMetrics&, const LegacyInlineTextBox*, float textDecorationThickness);
</ins><span class="cx">     
</span><span class="cx"> } // namespace WebCore
</span></span></pre>
</div>
</div>

</body>
</html>