<!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>[287476] 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/287476">287476</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2021-12-28 13:43:43 -0800 (Tue, 28 Dec 2021)</dd>
</dl>
<h3>Log Message</h3>
<pre>[LFC][IFC] Do not let Layout geometry types leak into InlineDisplay::Line
https://bugs.webkit.org/show_bug.cgi?id=234729
Reviewed by Antti Koivisto.
InlineLayoutUnit -> float
InlineRect -> FloatRect
(This is also where we will eventually do some pixel snapping)
* layout/formattingContexts/block/BlockFormattingGeometry.cpp:
(WebCore::Layout::BlockFormattingGeometry::inFlowNonReplacedContentHeightAndMargin const):
* layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::usedContentHeight const):
(WebCore::Layout::InlineFormattingContext::computeStaticPositionForOutOfFlowContent):
* layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
(WebCore::Layout::LineBoxBuilder::constructAndAlignInlineLevelBoxes):
* layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
(WebCore::Layout::InlineDisplayContentBuilder::build):
(WebCore::Layout::InlineDisplayContentBuilder::processNonBidiContent):
(WebCore::Layout::InlineDisplayContentBuilder::processBidiContent):
* layout/formattingContexts/inline/display/InlineDisplayLine.h:
(WebCore::InlineDisplay::Line::left const):
(WebCore::InlineDisplay::Line::right const):
(WebCore::InlineDisplay::Line::top const):
(WebCore::InlineDisplay::Line::bottom const):
(WebCore::InlineDisplay::Line::topLeft const):
(WebCore::InlineDisplay::Line::lineBoxRect const):
(WebCore::InlineDisplay::Line::scrollableOverflow const):
(WebCore::InlineDisplay::Line::baseline const):
(WebCore::InlineDisplay::Line::contentLeft const):
(WebCore::InlineDisplay::Line::contentWidth const):
(WebCore::InlineDisplay::Line::moveVertically):
(WebCore::InlineDisplay::Line::Line):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::showInlineTreeAndRuns):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorelayoutformattingContextsblockBlockFormattingGeometrycpp">trunk/Source/WebCore/layout/formattingContexts/block/BlockFormattingGeometry.cpp</a></li>
<li><a href="#trunkSourceWebCorelayoutformattingContextsinlineInlineFormattingContextcpp">trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp</a></li>
<li><a href="#trunkSourceWebCorelayoutformattingContextsinlineInlineLineBoxBuildercpp">trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorelayoutformattingContextsinlinedisplayInlineDisplayContentBuildercpp">trunk/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorelayoutformattingContextsinlinedisplayInlineDisplayLineh">trunk/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayLine.h</a></li>
<li><a href="#trunkSourceWebCorelayoutlayouttreeLayoutTreeBuildercpp">trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (287475 => 287476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog 2021-12-28 21:16:11 UTC (rev 287475)
+++ trunk/Source/WebCore/ChangeLog 2021-12-28 21:43:43 UTC (rev 287476)
</span><span class="lines">@@ -1,5 +1,43 @@
</span><span class="cx"> 2021-12-28 Alan Bujtas <zalan@apple.com>
</span><span class="cx">
</span><ins>+ [LFC][IFC] Do not let Layout geometry types leak into InlineDisplay::Line
+ https://bugs.webkit.org/show_bug.cgi?id=234729
+
+ Reviewed by Antti Koivisto.
+
+ InlineLayoutUnit -> float
+ InlineRect -> FloatRect
+ (This is also where we will eventually do some pixel snapping)
+
+ * layout/formattingContexts/block/BlockFormattingGeometry.cpp:
+ (WebCore::Layout::BlockFormattingGeometry::inFlowNonReplacedContentHeightAndMargin const):
+ * layout/formattingContexts/inline/InlineFormattingContext.cpp:
+ (WebCore::Layout::InlineFormattingContext::usedContentHeight const):
+ (WebCore::Layout::InlineFormattingContext::computeStaticPositionForOutOfFlowContent):
+ * layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
+ (WebCore::Layout::LineBoxBuilder::constructAndAlignInlineLevelBoxes):
+ * layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
+ (WebCore::Layout::InlineDisplayContentBuilder::build):
+ (WebCore::Layout::InlineDisplayContentBuilder::processNonBidiContent):
+ (WebCore::Layout::InlineDisplayContentBuilder::processBidiContent):
+ * layout/formattingContexts/inline/display/InlineDisplayLine.h:
+ (WebCore::InlineDisplay::Line::left const):
+ (WebCore::InlineDisplay::Line::right const):
+ (WebCore::InlineDisplay::Line::top const):
+ (WebCore::InlineDisplay::Line::bottom const):
+ (WebCore::InlineDisplay::Line::topLeft const):
+ (WebCore::InlineDisplay::Line::lineBoxRect const):
+ (WebCore::InlineDisplay::Line::scrollableOverflow const):
+ (WebCore::InlineDisplay::Line::baseline const):
+ (WebCore::InlineDisplay::Line::contentLeft const):
+ (WebCore::InlineDisplay::Line::contentWidth const):
+ (WebCore::InlineDisplay::Line::moveVertically):
+ (WebCore::InlineDisplay::Line::Line):
+ * layout/layouttree/LayoutTreeBuilder.cpp:
+ (WebCore::Layout::showInlineTreeAndRuns):
+
+2021-12-28 Alan Bujtas <zalan@apple.com>
+
</ins><span class="cx"> [LFC][IFC] Do not let Layout geometry types leak into InlineDisplay::Box
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=234728
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutformattingContextsblockBlockFormattingGeometrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/formattingContexts/block/BlockFormattingGeometry.cpp (287475 => 287476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/formattingContexts/block/BlockFormattingGeometry.cpp 2021-12-28 21:16:11 UTC (rev 287475)
+++ trunk/Source/WebCore/layout/formattingContexts/block/BlockFormattingGeometry.cpp 2021-12-28 21:43:43 UTC (rev 287476)
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx"> auto& lines = inlineFormattingState.lines();
</span><span class="cx"> // Even empty containers generate one line.
</span><span class="cx"> ASSERT(!lines.isEmpty());
</span><del>- return { toLayoutUnit(lines.last().lineBoxRect().bottom() + inlineFormattingState.clearGapAfterLastLine()) - borderAndPaddingTop, nonCollapsedMargin };
</del><ins>+ return { toLayoutUnit(lines.last().bottom() + inlineFormattingState.clearGapAfterLastLine()) - borderAndPaddingTop, nonCollapsedMargin };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // 2. the bottom edge of the bottom (possibly collapsed) margin of its last in-flow child, if the child's bottom margin...
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutformattingContextsinlineInlineFormattingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp (287475 => 287476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp 2021-12-28 21:16:11 UTC (rev 287475)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp 2021-12-28 21:43:43 UTC (rev 287476)
</span><span class="lines">@@ -186,8 +186,8 @@
</span><span class="cx"> auto& lines = formattingState().lines();
</span><span class="cx"> // Even empty content generates a line.
</span><span class="cx"> ASSERT(!lines.isEmpty());
</span><del>- auto top = LayoutUnit { lines.first().lineBoxRect().top() };
- auto bottom = LayoutUnit { lines.last().lineBoxRect().bottom() + formattingState().clearGapAfterLastLine() };
</del><ins>+ auto top = LayoutUnit { lines.first().top() };
+ auto bottom = LayoutUnit { lines.last().bottom() + formattingState().clearGapAfterLastLine() };
</ins><span class="cx">
</span><span class="cx"> auto floatingContext = FloatingContext { *this, formattingState().floatingState() };
</span><span class="cx"> if (auto floatBottom = floatingContext.bottom()) {
</span><span class="lines">@@ -306,7 +306,7 @@
</span><span class="cx"> // This is the first (non-float)child. Let's place it to the left of the first box.
</span><span class="cx"> // <div><img style="position: absolute">text content</div>
</span><span class="cx"> ASSERT(boxes.size());
</span><del>- outOfFlowGeometry.setLogicalTopLeft({ boxes[0].left(), lines[0].lineBoxRect().top() });
</del><ins>+ outOfFlowGeometry.setLogicalTopLeft({ boxes[0].left(), lines[0].top() });
</ins><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -347,7 +347,7 @@
</span><span class="cx"> ? BoxGeometry::borderBoxLeft(inlineBoxBoxGeometry) + inlineBoxBoxGeometry.contentBoxLeft()
</span><span class="cx"> : BoxGeometry::borderBoxRect(inlineBoxBoxGeometry).right();
</span><span class="cx"> }
</span><del>- outOfFlowGeometry.setLogicalTopLeft({ left, lines[previousBox.lineIndex()].lineBoxRect().top() });
</del><ins>+ outOfFlowGeometry.setLogicalTopLeft({ left, lines[previousBox.lineIndex()].top() });
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -354,20 +354,20 @@
</span><span class="cx"> if (nextBox) {
</span><span class="cx"> // The out of flow box is placed at the beginning of the next line (where the first box on the line is).
</span><span class="cx"> // <div>text<br><img style="position: absolute"><img style="position: absolute">content</div>
</span><del>- outOfFlowGeometry.setLogicalTopLeft({ nextBox->left(), lines[nextBox->lineIndex()].lineBoxRect().top() });
</del><ins>+ outOfFlowGeometry.setLogicalTopLeft({ nextBox->left(), lines[nextBox->lineIndex()].top() });
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- auto& lastLineLogicalRect = lines[previousBox.lineIndex()].lineBoxRect();
</del><ins>+ auto& lastLine = lines[previousBox.lineIndex()];
</ins><span class="cx"> // This out-of-flow box is the last box.
</span><span class="cx"> // FIXME: Use isLineBreak instead to cover preserved new lines too.
</span><span class="cx"> if (previousBox.layoutBox().isLineBreakBox()) {
</span><span class="cx"> // <div>text<br><img style="position: absolute"><img style="position: absolute"></div>
</span><del>- outOfFlowGeometry.setLogicalTopLeft({ lastLineLogicalRect.left(), lastLineLogicalRect.bottom() });
</del><ins>+ outOfFlowGeometry.setLogicalTopLeft({ lastLine.left(), lastLine.bottom() });
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> // FIXME: We may need to check if this box actually fits the last line and move it over to the "next" line.
</span><del>- outOfFlowGeometry.setLogicalTopLeft({ previousBox.right(), lastLineLogicalRect.top() });
</del><ins>+ outOfFlowGeometry.setLogicalTopLeft({ previousBox.right(), lastLine.top() });
</ins><span class="cx"> };
</span><span class="cx"> placeOutOfFlowBoxAfterPreviousInFlowBox();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutformattingContextsinlineInlineLineBoxBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp (287475 => 287476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp 2021-12-28 21:16:11 UTC (rev 287475)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp 2021-12-28 21:43:43 UTC (rev 287476)
</span><span class="lines">@@ -262,7 +262,7 @@
</span><span class="cx"> else {
</span><span class="cx"> auto& formattingState = layoutState().formattingStateForInlineFormattingContext(downcast<ContainerBox>(layoutBox));
</span><span class="cx"> auto& lastLine = formattingState.lines().last();
</span><del>- auto inlineBlockBaseline = lastLine.lineBoxRect().top() + lastLine.baseline();
</del><ins>+ auto inlineBlockBaseline = lastLine.top() + lastLine.baseline();
</ins><span class="cx"> ascent = inlineLevelBoxGeometry.marginBefore() + inlineLevelBoxGeometry.borderBefore() + inlineLevelBoxGeometry.paddingBefore().value_or(0) + inlineBlockBaseline;
</span><span class="cx"> }
</span><span class="cx"> } else if (layoutBox.isReplacedBox())
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutformattingContextsinlinedisplayInlineDisplayContentBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp (287475 => 287476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp 2021-12-28 21:16:11 UTC (rev 287475)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp 2021-12-28 21:43:43 UTC (rev 287476)
</span><span class="lines">@@ -93,10 +93,9 @@
</span><span class="cx"> boxes.reserveInitialCapacity(lineContent.runs.size() + lineBox.nonRootInlineLevelBoxes().size() + 1);
</span><span class="cx">
</span><span class="cx"> m_lineIndex = lineIndex;
</span><del>- auto lineBoxRect = displayLine.lineBoxRect();
</del><span class="cx"> // Every line starts with a root box, even the empty ones.
</span><span class="cx"> auto rootInlineBoxRect = lineBox.logicalRectForRootInlineBox();
</span><del>- rootInlineBoxRect.moveBy(lineBoxRect.topLeft());
</del><ins>+ rootInlineBoxRect.moveBy(displayLine.topLeft());
</ins><span class="cx"> boxes.append({ m_lineIndex, InlineDisplay::Box::Type::RootInlineBox, root(), UBIDI_DEFAULT_LTR, rootInlineBoxRect, rootInlineBoxRect, { }, { }, lineBox.rootInlineBox().hasContent() });
</span><span class="cx">
</span><span class="cx"> auto contentNeedsBidiReordering = !lineContent.visualOrderList.isEmpty();
</span><span class="lines">@@ -104,7 +103,7 @@
</span><span class="cx"> processBidiContent(lineContent, lineBox, displayLine, boxes);
</span><span class="cx"> else
</span><span class="cx"> processNonBidiContent(lineContent, lineBox, displayLine, boxes);
</span><del>- processOverflownRunsForEllipsis(boxes, lineBoxRect.right());
</del><ins>+ processOverflownRunsForEllipsis(boxes, displayLine.right());
</ins><span class="cx"> collectInkOverflowForInlineBoxes(boxes);
</span><span class="cx"> return boxes;
</span><span class="cx"> }
</span><span class="lines">@@ -325,14 +324,13 @@
</span><span class="cx"> hasContent = hasContent || lineRun.isText() || lineRun.isBox();
</span><span class="cx"> ASSERT(root().style().isLeftToRightDirection() || !hasContent);
</span><span class="cx"> #endif
</span><del>- auto lineBoxRect = displayLine.lineBoxRect();
- auto contentStartInVisualOrder = lineBoxRect.left() + displayLine.contentLeft();
</del><ins>+ auto contentStartInVisualOrder = displayLine.left() + displayLine.contentLeft();
</ins><span class="cx">
</span><span class="cx"> for (auto& lineRun : lineContent.runs) {
</span><span class="cx"> auto& layoutBox = lineRun.layoutBox();
</span><span class="cx">
</span><span class="cx"> auto visualRectRelativeToRoot = [&](auto logicalRect) {
</span><del>- logicalRect.moveBy({ contentStartInVisualOrder, lineBoxRect.top() });
</del><ins>+ logicalRect.moveBy({ contentStartInVisualOrder, displayLine.top() });
</ins><span class="cx"> return logicalRect;
</span><span class="cx"> };
</span><span class="cx">
</span><span class="lines">@@ -542,8 +540,7 @@
</span><span class="cx"> auto displayBoxTree = DisplayBoxTree { };
</span><span class="cx"> ancestorStack.push({ }, root());
</span><span class="cx">
</span><del>- auto lineBoxRect = displayLine.lineBoxRect();
- auto contentStartInVisualOrder = lineBoxRect.left() + displayLine.contentLeft();
</del><ins>+ auto contentStartInVisualOrder = displayLine.left() + displayLine.contentLeft();
</ins><span class="cx"> auto createDisplayBoxesInVisualOrder = [&] {
</span><span class="cx">
</span><span class="cx"> auto contentRightInVisualOrder = contentStartInVisualOrder;
</span><span class="lines">@@ -560,7 +557,7 @@
</span><span class="cx">
</span><span class="cx"> auto visualRectRelativeToRoot = [&](auto logicalRect) {
</span><span class="cx"> logicalRect.setLeft(contentRightInVisualOrder);
</span><del>- logicalRect.moveVertically(lineBoxRect.top());
</del><ins>+ logicalRect.moveVertically(displayLine.top());
</ins><span class="cx"> return logicalRect;
</span><span class="cx"> };
</span><span class="cx">
</span><span class="lines">@@ -646,7 +643,7 @@
</span><span class="cx"> auto contentRightInVisualOrder = contentStartInVisualOrder;
</span><span class="cx">
</span><span class="cx"> for (auto childDisplayBoxNodeIndex : displayBoxTree.root().children)
</span><del>- adjustVisualGeometryForDisplayBox(childDisplayBoxNodeIndex, contentRightInVisualOrder, lineBoxRect.top(), displayBoxTree, boxes, lineBox, isFirstLastIndexesMap);
</del><ins>+ adjustVisualGeometryForDisplayBox(childDisplayBoxNodeIndex, contentRightInVisualOrder, displayLine.top(), displayBoxTree, boxes, lineBox, isFirstLastIndexesMap);
</ins><span class="cx"> };
</span><span class="cx"> adjustVisualGeometryWithInlineBoxes();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutformattingContextsinlinedisplayInlineDisplayLineh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayLine.h (287475 => 287476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayLine.h 2021-12-28 21:16:11 UTC (rev 287475)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayLine.h 2021-12-28 21:43:43 UTC (rev 287476)
</span><span class="lines">@@ -37,37 +37,44 @@
</span><span class="cx"> public:
</span><span class="cx"> struct EnclosingTopAndBottom {
</span><span class="cx"> // This values encloses the root inline box and any other inline level box's border box.
</span><del>- Layout::InlineLayoutUnit top { 0 };
- Layout::InlineLayoutUnit bottom { 0 };
</del><ins>+ float top { 0 };
+ float bottom { 0 };
</ins><span class="cx"> };
</span><del>- Line(const Layout::InlineRect& lineBoxRect, const Layout::InlineRect& scrollableOverflow, EnclosingTopAndBottom, Layout::InlineLayoutUnit aligmentBaseline, Layout::InlineLayoutUnit contentLeft, Layout::InlineLayoutUnit contentWidth);
</del><ins>+ Line(const FloatRect& lineBoxRect, const FloatRect& scrollableOverflow, EnclosingTopAndBottom, float aligmentBaseline, float contentLeft, float contentWidth);
</ins><span class="cx">
</span><del>- const Layout::InlineRect& lineBoxRect() const { return m_lineBoxRect; }
- const Layout::InlineRect& scrollableOverflow() const { return m_scrollableOverflow; }
</del><ins>+ float left() const { return m_lineBoxRect.x(); }
+ float right() const { return m_lineBoxRect.maxX(); }
+ float top() const { return m_lineBoxRect.y(); }
+ float bottom() const { return m_lineBoxRect.maxY(); }
</ins><span class="cx">
</span><ins>+ FloatPoint topLeft() const { return m_lineBoxRect.location(); }
+
+ const FloatRect& lineBoxRect() const { return m_lineBoxRect; }
+ const FloatRect& scrollableOverflow() const { return m_scrollableOverflow; }
+
</ins><span class="cx"> EnclosingTopAndBottom enclosingTopAndBottom() const { return m_enclosingTopAndBottom; }
</span><span class="cx">
</span><del>- Layout::InlineLayoutUnit baseline() const { return m_aligmentBaseline; }
</del><ins>+ float baseline() const { return m_aligmentBaseline; }
</ins><span class="cx">
</span><del>- Layout::InlineLayoutUnit contentLeft() const { return m_contentLeft; }
- Layout::InlineLayoutUnit contentWidth() const { return m_contentWidth; }
</del><ins>+ float contentLeft() const { return m_contentLeft; }
+ float contentWidth() const { return m_contentWidth; }
</ins><span class="cx">
</span><del>- void moveVertically(Layout::InlineLayoutUnit offset) { m_lineBoxRect.moveVertically(offset); }
</del><ins>+ void moveVertically(float offset) { m_lineBoxRect.move({ { }, offset }); }
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> // This is line box geometry (see https://www.w3.org/TR/css-inline-3/#line-box).
</span><del>- Layout::InlineRect m_lineBoxRect;
- Layout::InlineRect m_scrollableOverflow;
</del><ins>+ FloatRect m_lineBoxRect;
+ FloatRect m_scrollableOverflow;
</ins><span class="cx"> // Enclosing top and bottom includes all inline level boxes (border box) vertically.
</span><span class="cx"> // While the line box usually enclose them as well, its vertical geometry is based on
</span><span class="cx"> // the layout bounds of the inline level boxes which may be different when line-height is present.
</span><span class="cx"> EnclosingTopAndBottom m_enclosingTopAndBottom;
</span><del>- Layout::InlineLayoutUnit m_aligmentBaseline { 0 };
- Layout::InlineLayoutUnit m_contentLeft { 0 };
- Layout::InlineLayoutUnit m_contentWidth { 0 };
</del><ins>+ float m_aligmentBaseline { 0 };
+ float m_contentLeft { 0 };
+ float m_contentWidth { 0 };
</ins><span class="cx"> };
</span><span class="cx">
</span><del>-inline Line::Line(const Layout::InlineRect& lineBoxRect, const Layout::InlineRect& scrollableOverflow, EnclosingTopAndBottom enclosingTopAndBottom, Layout::InlineLayoutUnit aligmentBaseline, Layout::InlineLayoutUnit contentLeft, Layout::InlineLayoutUnit contentWidth)
</del><ins>+inline Line::Line(const FloatRect& lineBoxRect, const FloatRect& scrollableOverflow, EnclosingTopAndBottom enclosingTopAndBottom, float aligmentBaseline, float contentLeft, float contentWidth)
</ins><span class="cx"> : m_lineBoxRect(lineBoxRect)
</span><span class="cx"> , m_scrollableOverflow(scrollableOverflow)
</span><span class="cx"> , m_enclosingTopAndBottom(enclosingTopAndBottom)
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutlayouttreeLayoutTreeBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp (287475 => 287476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp 2021-12-28 21:16:11 UTC (rev 287475)
+++ trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp 2021-12-28 21:43:43 UTC (rev 287476)
</span><span class="lines">@@ -376,7 +376,7 @@
</span><span class="cx"> auto& line = lines[lineIndex];
</span><span class="cx"> auto& lineBoxRect = line.lineBoxRect();
</span><span class="cx"> auto enclosingTopAndBottom = line.enclosingTopAndBottom();
</span><del>- stream << "line at (" << lineBoxRect.left() << "," << lineBoxRect.top() << ") size (" << lineBoxRect.width() << "x" << lineBoxRect.height() << ") baseline (" << line.baseline() << ") enclosing top (" << enclosingTopAndBottom.top << ") bottom (" << enclosingTopAndBottom.bottom << ")";
</del><ins>+ stream << "line at (" << lineBoxRect.x() << "," << lineBoxRect.y() << ") size (" << lineBoxRect.width() << "x" << lineBoxRect.height() << ") baseline (" << line.baseline() << ") enclosing top (" << enclosingTopAndBottom.top << ") bottom (" << enclosingTopAndBottom.bottom << ")";
</ins><span class="cx"> stream.nextLine();
</span><span class="cx">
</span><span class="cx"> addSpacing();
</span></span></pre>
</div>
</div>
</body>
</html>