<!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>[282086] trunk</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/282086">282086</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2021-09-07 08:30:28 -0700 (Tue, 07 Sep 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove -webkit-line-clamp behaviour where last link is placed after ellipsis box
https://bugs.webkit.org/show_bug.cgi?id=229985

Reviewed by Alan Bujtas.

Source/WebCore:

-webkit-line-clamp has a bizarre and random behavior where the last link in a paragraph gets
rendered after the ellipsis box. It was exists to support some long-dead UI. No other engine does this.
The implementation is buggy and only works at all under a narrow set of cicrumstances.

This patch removes the behavior.

* rendering/LegacyEllipsisBox.cpp:
(WebCore::LegacyEllipsisBox::LegacyEllipsisBox):
(WebCore::LegacyEllipsisBox::paint):
(WebCore::LegacyEllipsisBox::nodeAtPoint):
(WebCore::LegacyEllipsisBox::markupBox const): Deleted.
(WebCore::LegacyEllipsisBox::paintMarkupBox): Deleted.
* rendering/LegacyEllipsisBox.h:
* rendering/LegacyRootInlineBox.cpp:
(WebCore::LegacyRootInlineBox::placeEllipsis):
* rendering/LegacyRootInlineBox.h:
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):

LayoutTests:

* fast/flexbox/line-clamp-link-after-ellipsis-expected.txt: Removed.
* fast/flexbox/line-clamp-link-after-ellipsis.html: Removed.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformiosTestExpectations">trunk/LayoutTests/platform/ios/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingLegacyEllipsisBoxcpp">trunk/Source/WebCore/rendering/LegacyEllipsisBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingLegacyEllipsisBoxh">trunk/Source/WebCore/rendering/LegacyEllipsisBox.h</a></li>
<li><a href="#trunkSourceWebCorerenderingLegacyRootInlineBoxcpp">trunk/Source/WebCore/rendering/LegacyRootInlineBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingLegacyRootInlineBoxh">trunk/Source/WebCore/rendering/LegacyRootInlineBox.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderDeprecatedFlexibleBoxcpp">trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastflexboxlineclamplinkafterellipsisexpectedtxt">trunk/LayoutTests/fast/flexbox/line-clamp-link-after-ellipsis-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastflexboxlineclamplinkafterellipsishtml">trunk/LayoutTests/fast/flexbox/line-clamp-link-after-ellipsis.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (282085 => 282086)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2021-09-07 15:00:21 UTC (rev 282085)
+++ trunk/LayoutTests/ChangeLog 2021-09-07 15:30:28 UTC (rev 282086)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2021-09-07  Antti Koivisto  <antti@apple.com>
+
+        Remove -webkit-line-clamp behaviour where last link is placed after ellipsis box
+        https://bugs.webkit.org/show_bug.cgi?id=229985
+
+        Reviewed by Alan Bujtas.
+
+        * fast/flexbox/line-clamp-link-after-ellipsis-expected.txt: Removed.
+        * fast/flexbox/line-clamp-link-after-ellipsis.html: Removed.
+
</ins><span class="cx"> 2021-08-26  Sergio Villar Senin  <svillar@igalia.com>
</span><span class="cx"> 
</span><span class="cx">         Interoperability issue in margin collapsing with overflow:hidden elements
</span></span></pre></div>
<a id="trunkLayoutTestsfastflexboxlineclamplinkafterellipsisexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/flexbox/line-clamp-link-after-ellipsis-expected.txt (282085 => 282086)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/flexbox/line-clamp-link-after-ellipsis-expected.txt       2021-09-07 15:00:21 UTC (rev 282085)
+++ trunk/LayoutTests/fast/flexbox/line-clamp-link-after-ellipsis-expected.txt  2021-09-07 15:30:28 UTC (rev 282086)
</span><span class="lines">@@ -1,12 +0,0 @@
</span><del>-Test that links painted after the ellipsis of a flexbox using -webkit-line-clamp is hit-testable.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS document.getElementsByTagName('a')[0].textContent is "clicked"
-PASS successfullyParsed is true
-
-TEST COMPLETE
-line one
-line twoclicked
-
</del></span></pre></div>
<a id="trunkLayoutTestsfastflexboxlineclamplinkafterellipsishtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/flexbox/line-clamp-link-after-ellipsis.html (282085 => 282086)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/flexbox/line-clamp-link-after-ellipsis.html       2021-09-07 15:00:21 UTC (rev 282085)
+++ trunk/LayoutTests/fast/flexbox/line-clamp-link-after-ellipsis.html  2021-09-07 15:30:28 UTC (rev 282086)
</span><span class="lines">@@ -1,40 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<style>
-span#container {
-    display: inline-block; /* clamp the width of the enclosing P to its contents */
-}
-
-div#flexbox {
-    -webkit-box-orient: vertical;
-    -webkit-line-clamp: 1;
-    display: -webkit-box;
-    overflow-y: hidden;
-}
-</style>
-</head>
-<body>
-<span id="container">
-    <div id="flexbox">line one<br>line two<a id="link" href="#" onclick="this.textContent='clicked'">not clicked</a></div>
-</span>
-<script>
-description('Test that links painted after the ellipsis of a flexbox using -webkit-line-clamp is hit-testable.');
-
-var divRect = document.getElementById("flexbox").getBoundingClientRect();
-var aRect = document.getElementById("link").getBoundingClientRect();
-var clickX = divRect.left + divRect.width - (aRect.width / 2);
-var clickY = divRect.top + divRect.height  - (aRect.height / 2);
-
-if (window.eventSender) {
-    eventSender.mouseMoveTo(clickX, clickY);
-    eventSender.mouseDown();
-    eventSender.mouseUp();
-}
-
-shouldBeEqualToString("document.getElementsByTagName('a')[0].textContent", "clicked");
-</script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiosTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios/TestExpectations (282085 => 282086)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios/TestExpectations  2021-09-07 15:00:21 UTC (rev 282085)
+++ trunk/LayoutTests/platform/ios/TestExpectations     2021-09-07 15:30:28 UTC (rev 282086)
</span><span class="lines">@@ -564,7 +564,6 @@
</span><span class="cx"> fast/files/filereader-zip-bundle.html [ Skip ]
</span><span class="cx"> fast/files/null-origin-string.html [ Skip ]
</span><span class="cx"> fast/files/workers/worker-apply-blob-url-to-xhr.html [ Skip ]
</span><del>-fast/flexbox/line-clamp-link-after-ellipsis.html [ Skip ]
</del><span class="cx"> fast/forms/25153.html [ Skip ]
</span><span class="cx"> fast/forms/disabled-mousedown-event.html [ Skip ]
</span><span class="cx"> fast/forms/disabled-search-input.html [ Skip ]
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (282085 => 282086)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-09-07 15:00:21 UTC (rev 282085)
+++ trunk/Source/WebCore/ChangeLog      2021-09-07 15:30:28 UTC (rev 282086)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2021-09-07  Antti Koivisto  <antti@apple.com>
+
+        Remove -webkit-line-clamp behaviour where last link is placed after ellipsis box
+        https://bugs.webkit.org/show_bug.cgi?id=229985
+
+        Reviewed by Alan Bujtas.
+
+        -webkit-line-clamp has a bizarre and random behavior where the last link in a paragraph gets
+        rendered after the ellipsis box. It was exists to support some long-dead UI. No other engine does this.
+        The implementation is buggy and only works at all under a narrow set of cicrumstances.
+
+        This patch removes the behavior.
+
+        * rendering/LegacyEllipsisBox.cpp:
+        (WebCore::LegacyEllipsisBox::LegacyEllipsisBox):
+        (WebCore::LegacyEllipsisBox::paint):
+        (WebCore::LegacyEllipsisBox::nodeAtPoint):
+        (WebCore::LegacyEllipsisBox::markupBox const): Deleted.
+        (WebCore::LegacyEllipsisBox::paintMarkupBox): Deleted.
+        * rendering/LegacyEllipsisBox.h:
+        * rendering/LegacyRootInlineBox.cpp:
+        (WebCore::LegacyRootInlineBox::placeEllipsis):
+        * rendering/LegacyRootInlineBox.h:
+        * rendering/RenderDeprecatedFlexibleBox.cpp:
+        (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
+
</ins><span class="cx"> 2021-08-26  Sergio Villar Senin  <svillar@igalia.com>
</span><span class="cx"> 
</span><span class="cx">         Interoperability issue in margin collapsing with overflow:hidden elements
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingLegacyEllipsisBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/LegacyEllipsisBox.cpp (282085 => 282086)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/LegacyEllipsisBox.cpp     2021-09-07 15:00:21 UTC (rev 282085)
+++ trunk/Source/WebCore/rendering/LegacyEllipsisBox.cpp        2021-09-07 15:30:28 UTC (rev 282086)
</span><span class="lines">@@ -34,9 +34,8 @@
</span><span class="cx"> 
</span><span class="cx"> WTF_MAKE_ISO_ALLOCATED_IMPL(LegacyEllipsisBox);
</span><span class="cx"> 
</span><del>-LegacyEllipsisBox::LegacyEllipsisBox(RenderBlockFlow& renderer, const AtomString& ellipsisStr, LegacyInlineFlowBox* parent, int width, int height, int y, bool firstLine, bool isHorizontal, LegacyInlineBox* markupBox)
</del><ins>+LegacyEllipsisBox::LegacyEllipsisBox(RenderBlockFlow& renderer, const AtomString& ellipsisStr, LegacyInlineFlowBox* parent, int width, int height, int y, bool firstLine, bool isHorizontal)
</ins><span class="cx">     : LegacyInlineElementBox(renderer, FloatPoint(0, y), width, firstLine, true, false, false, isHorizontal, 0, 0, parent)
</span><del>-    , m_shouldPaintMarkupBox(markupBox)
</del><span class="cx">     , m_height(height)
</span><span class="cx">     , m_str(ellipsisStr)
</span><span class="cx"> {
</span><span class="lines">@@ -45,7 +44,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void LegacyEllipsisBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit lineTop, LayoutUnit lineBottom)
</del><ins>+void LegacyEllipsisBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit, LayoutUnit)
</ins><span class="cx"> {
</span><span class="cx">     GraphicsContext& context = paintInfo.context();
</span><span class="cx">     const RenderStyle& lineStyle = this->lineStyle();
</span><span class="lines">@@ -78,40 +77,8 @@
</span><span class="cx"> 
</span><span class="cx">     if (setShadow)
</span><span class="cx">         context.clearShadow();
</span><del>-
-    paintMarkupBox(paintInfo, paintOffset, lineTop, lineBottom, lineStyle);
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-LegacyInlineBox* LegacyEllipsisBox::markupBox() const
-{
-    if (!m_shouldPaintMarkupBox)
-        return 0;
-
-    LegacyRootInlineBox* lastLine = blockFlow().lastRootBox();
-    if (!lastLine)
-        return 0;
-
-    // If the last line-box on the last line of a block is a link, -webkit-line-clamp paints that box after the ellipsis.
-    // It does not actually move the link.
-    LegacyInlineBox* anchorBox = lastLine->lastChild();
-    if (!anchorBox || !anchorBox->renderer().style().isLink())
-        return 0;
-
-    return anchorBox;
-}
-
-void LegacyEllipsisBox::paintMarkupBox(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit lineTop, LayoutUnit lineBottom, const RenderStyle& style)
-{
-    LegacyInlineBox* markupBox = this->markupBox();
-    if (!markupBox)
-        return;
-
-    LayoutPoint adjustedPaintOffset = paintOffset;
-    adjustedPaintOffset.move(x() + logicalWidth() - markupBox->x(),
-        y() + style.fontMetrics().ascent() - (markupBox->y() + markupBox->lineStyle().fontMetrics().ascent()));
-    markupBox->paint(paintInfo, adjustedPaintOffset, lineTop, lineBottom);
-}
-
</del><span class="cx"> IntRect LegacyEllipsisBox::selectionRect()
</span><span class="cx"> {
</span><span class="cx">     const RenderStyle& lineStyle = this->lineStyle();
</span><span class="lines">@@ -145,21 +112,10 @@
</span><span class="cx">     context.fillRect(snapRectToDevicePixelsWithWritingDirection(selectionRect, renderer().document().deviceScaleFactor(), run.ltr()), c);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool LegacyEllipsisBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom, HitTestAction hitTestAction)
</del><ins>+bool LegacyEllipsisBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit, LayoutUnit, HitTestAction)
</ins><span class="cx"> {
</span><span class="cx">     LayoutPoint adjustedLocation = accumulatedOffset + LayoutPoint(topLeft());
</span><span class="cx"> 
</span><del>-    // Hit test the markup box.
-    if (LegacyInlineBox* markupBox = this->markupBox()) {
-        const RenderStyle& lineStyle = this->lineStyle();
-        LayoutUnit mtx { adjustedLocation.x() + logicalWidth() - markupBox->x() };
-        LayoutUnit mty { adjustedLocation.y() + lineStyle.fontMetrics().ascent() - (markupBox->y() + markupBox->lineStyle().fontMetrics().ascent()) };
-        if (markupBox->nodeAtPoint(request, result, locationInContainer, LayoutPoint(mtx, mty), lineTop, lineBottom, hitTestAction)) {
-            blockFlow().updateHitTestResult(result, locationInContainer.point() - LayoutSize(mtx, mty));
-            return true;
-        }
-    }
-
</del><span class="cx">     auto boundsRect = LayoutRect { adjustedLocation, LayoutSize(LayoutUnit(logicalWidth()), m_height) };
</span><span class="cx">     if (visibleToHitTesting(request) && locationInContainer.intersects(boundsRect)) {
</span><span class="cx">         blockFlow().updateHitTestResult(result, locationInContainer.point() - toLayoutSize(adjustedLocation));
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingLegacyEllipsisBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/LegacyEllipsisBox.h (282085 => 282086)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/LegacyEllipsisBox.h       2021-09-07 15:00:21 UTC (rev 282085)
+++ trunk/Source/WebCore/rendering/LegacyEllipsisBox.h  2021-09-07 15:30:28 UTC (rev 282086)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> class LegacyEllipsisBox final : public LegacyInlineElementBox {
</span><span class="cx">     WTF_MAKE_ISO_ALLOCATED(LegacyEllipsisBox);
</span><span class="cx"> public:
</span><del>-    LegacyEllipsisBox(RenderBlockFlow&, const AtomString& ellipsisStr, LegacyInlineFlowBox* parent, int width, int height, int y, bool firstLine, bool isHorizontal, LegacyInlineBox* markupBox);
</del><ins>+    LegacyEllipsisBox(RenderBlockFlow&, const AtomString& ellipsisStr, LegacyInlineFlowBox* parent, int width, int height, int y, bool firstLine, bool isHorizontal);
</ins><span class="cx">     void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom) override;
</span><span class="cx">     bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom, HitTestAction) final;
</span><span class="cx">     void setSelectionState(RenderObject::HighlightState s) { m_selectionState = s; }
</span><span class="lines">@@ -39,13 +39,10 @@
</span><span class="cx">     RenderBlockFlow& blockFlow() const { return downcast<RenderBlockFlow>(LegacyInlineBox::renderer()); }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    void paintMarkupBox(PaintInfo&, const LayoutPoint& paintOffset, LayoutUnit lineTop, LayoutUnit lineBottom, const RenderStyle&);
</del><span class="cx">     int height() const { return m_height; }
</span><span class="cx">     RenderObject::HighlightState selectionState() override { return m_selectionState; }
</span><span class="cx">     void paintSelection(GraphicsContext&, const LayoutPoint&, const RenderStyle&, const FontCascade&);
</span><del>-    LegacyInlineBox* markupBox() const;
</del><span class="cx"> 
</span><del>-    bool m_shouldPaintMarkupBox;
</del><span class="cx">     RenderObject::HighlightState m_selectionState { RenderObject::HighlightState::None };
</span><span class="cx">     int m_height;
</span><span class="cx">     AtomString m_str;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingLegacyRootInlineBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/LegacyRootInlineBox.cpp (282085 => 282086)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/LegacyRootInlineBox.cpp   2021-09-07 15:00:21 UTC (rev 282085)
+++ trunk/Source/WebCore/rendering/LegacyRootInlineBox.cpp      2021-09-07 15:30:28 UTC (rev 282086)
</span><span class="lines">@@ -127,13 +127,13 @@
</span><span class="cx">     return LegacyInlineFlowBox::canAccommodateEllipsis(ltr, blockEdge, ellipsisWidth);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-float LegacyRootInlineBox::placeEllipsis(const AtomString& ellipsisStr,  bool ltr, float blockLeftEdge, float blockRightEdge, float ellipsisWidth, LegacyInlineBox* markupBox)
</del><ins>+float LegacyRootInlineBox::placeEllipsis(const AtomString& ellipsisStr, bool ltr, float blockLeftEdge, float blockRightEdge, float ellipsisWidth)
</ins><span class="cx"> {
</span><span class="cx">     if (!gEllipsisBoxMap)
</span><span class="cx">         gEllipsisBoxMap = new EllipsisBoxMap();
</span><span class="cx"> 
</span><span class="cx">     ASSERT(!hasEllipsisBox());
</span><del>-    auto* ellipsisBox = gEllipsisBoxMap->set(this, makeUnique<LegacyEllipsisBox>(blockFlow(), ellipsisStr, this, ellipsisWidth - (markupBox ? markupBox->logicalWidth() : 0), logicalHeight(), y(), !prevRootBox(), isHorizontal(), markupBox)).iterator->value.get();
</del><ins>+    auto* ellipsisBox = gEllipsisBoxMap->set(this, makeUnique<LegacyEllipsisBox>(blockFlow(), ellipsisStr, this, ellipsisWidth, logicalHeight(), y(), !prevRootBox(), isHorizontal())).iterator->value.get();
</ins><span class="cx">     setHasEllipsisBox(true);
</span><span class="cx">     // FIXME: Do we need an RTL version of this?
</span><span class="cx">     if (ltr && (x() + logicalWidth() + ellipsisWidth) <= blockRightEdge) {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingLegacyRootInlineBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/LegacyRootInlineBox.h (282085 => 282086)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/LegacyRootInlineBox.h     2021-09-07 15:00:21 UTC (rev 282085)
+++ trunk/Source/WebCore/rendering/LegacyRootInlineBox.h        2021-09-07 15:30:28 UTC (rev 282086)
</span><span class="lines">@@ -107,7 +107,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool lineCanAccommodateEllipsis(bool ltr, int blockEdge, int lineBoxEdge, int ellipsisWidth);
</span><span class="cx">     // Return the truncatedWidth, the width of the truncated text + ellipsis.
</span><del>-    float placeEllipsis(const AtomString& ellipsisStr, bool ltr, float blockLeftEdge, float blockRightEdge, float ellipsisWidth, LegacyInlineBox* markupBox = nullptr);
</del><ins>+    float placeEllipsis(const AtomString& ellipsisStr, bool ltr, float blockLeftEdge, float blockRightEdge, float ellipsisWidth);
</ins><span class="cx">     // Return the position of the LegacyEllipsisBox or -1.
</span><span class="cx">     float placeEllipsisBox(bool ltr, float blockLeftEdge, float blockRightEdge, float ellipsisWidth, float &truncatedWidth, bool& foundBox) final;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderDeprecatedFlexibleBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp (282085 => 282086)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp   2021-09-07 15:00:21 UTC (rev 282085)
+++ trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp      2021-09-07 15:30:28 UTC (rev 282086)
</span><span class="lines">@@ -1055,22 +1055,11 @@
</span><span class="cx">         if (!lastVisibleLine || !lastVisibleLine->firstChild())
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        const UChar ellipsisAndSpace[2] = { horizontalEllipsis, ' ' };
-        static MainThreadNeverDestroyed<const AtomString> ellipsisAndSpaceStr(ellipsisAndSpace, 2);
</del><span class="cx">         static MainThreadNeverDestroyed<const AtomString> ellipsisStr(&horizontalEllipsis, 1);
</span><span class="cx">         const RenderStyle& lineStyle = numVisibleLines == 1 ? firstLineStyle() : style();
</span><span class="cx">         const FontCascade& font = lineStyle.fontCascade();
</span><span class="cx"> 
</span><del>-        // Get ellipsis width, and if the last child is an anchor, it will go after the ellipsis, so add in a space and the anchor width too
-        LayoutUnit totalWidth;
-        LegacyInlineBox* anchorBox = lastLine->lastChild();
-        auto& lastVisibleRenderer = lastVisibleLine->firstChild()->renderer();
-        if (anchorBox && anchorBox->renderer().style().isLink() && &lastVisibleRenderer != &anchorBox->renderer())
-            totalWidth = anchorBox->logicalWidth() + font.width(constructTextRun(ellipsisAndSpace, 2, style()));
-        else {
-            anchorBox = nullptr;
-            totalWidth = font.width(constructTextRun(&horizontalEllipsis, 1, style()));
-        }
</del><ins>+        auto totalWidth = font.width(constructTextRun(&horizontalEllipsis, 1, style()));
</ins><span class="cx"> 
</span><span class="cx">         // See if this width can be accommodated on the last visible line
</span><span class="cx">         RenderBlockFlow& destBlock = lastVisibleLine->blockFlow();
</span><span class="lines">@@ -1091,7 +1080,7 @@
</span><span class="cx">         // Let the truncation code kick in.
</span><span class="cx">         // FIXME: the text alignment should be recomputed after the width changes due to truncation.
</span><span class="cx">         LayoutUnit blockLeftEdge = destBlock.logicalLeftOffsetForLine(LayoutUnit(lastVisibleLine->y()), DoNotIndentText);
</span><del>-        lastVisibleLine->placeEllipsis(anchorBox ? ellipsisAndSpaceStr : ellipsisStr, leftToRight, blockLeftEdge, blockRightEdge, totalWidth, anchorBox);
</del><ins>+        lastVisibleLine->placeEllipsis(ellipsisStr, leftToRight, blockLeftEdge, blockRightEdge, totalWidth);
</ins><span class="cx">         destBlock.setHasMarkupTruncation(true);
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>