<!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>[281734] 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/281734">281734</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2021-08-28 06:15:49 -0700 (Sat, 28 Aug 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>[LFC][IFC] Move content builder functionality to a dedicated class
https://bugs.webkit.org/show_bug.cgi?id=229631

Reviewed by Antti Koivisto.

Source/WebCore:

Let's use a dedicated class for constructing the final line runs. This is also going to be used
for computing overflow and other "display" type of value once it's merged with LayoutIntegration::InlineContentBuilder.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/LayoutUnits.h:
* layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp: Added.
(WebCore::Layout::InlineDisplayContentBuilder::InlineDisplayContentBuilder):
(WebCore::Layout::InlineDisplayContentBuilder::build):
(WebCore::Layout::InlineDisplayContentBuilder::createRunsAndUpdateGeometryForLineContent):
(WebCore::Layout::InlineDisplayContentBuilder::createRunsAndUpdateGeometryForLineSpanningInlineBoxes):
* layout/formattingContexts/inline/InlineDisplayContentBuilder.h: Copied from Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.h.
(WebCore::Layout::InlineDisplayContentBuilder::root const):
(WebCore::Layout::InlineDisplayContentBuilder::formattingState const):
* layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::lineLayout):
(WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
* layout/formattingContexts/inline/InlineFormattingContext.h:
* layout/formattingContexts/inline/InlineLevelBox.h:
(WebCore::Layout::InlineLevelBox::isInlineBox const):
(WebCore::Layout::InlineLevelBox::isLineSpanningInlineBox const):
(WebCore::Layout::InlineLevelBox::createInlineBox):
* layout/formattingContexts/inline/InlineLine.h:
(WebCore::Layout::Line::Run::type const):
* layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
(WebCore::Layout::LineBoxBuilder::constructAndAlignInlineLevelBoxes):
* layout/formattingContexts/inline/InlineLineBoxBuilder.h:
* layout/integration/LayoutIntegrationInlineContentBuilder.cpp:
(WebCore::LayoutIntegration::lineOverflowWidth):
* layout/integration/LayoutIntegrationRun.h:

LayoutTests:

* TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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="#trunkSourceWebCorelayoutLayoutUnitsh">trunk/Source/WebCore/layout/LayoutUnits.h</a></li>
<li><a href="#trunkSourceWebCorelayoutformattingContextsinlineInlineFormattingContextcpp">trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp</a></li>
<li><a href="#trunkSourceWebCorelayoutformattingContextsinlineInlineFormattingContexth">trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.h</a></li>
<li><a href="#trunkSourceWebCorelayoutformattingContextsinlineInlineLevelBoxh">trunk/Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h</a></li>
<li><a href="#trunkSourceWebCorelayoutformattingContextsinlineInlineLineh">trunk/Source/WebCore/layout/formattingContexts/inline/InlineLine.h</a></li>
<li><a href="#trunkSourceWebCorelayoutformattingContextsinlineInlineLineBoxBuildercpp">trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorelayoutformattingContextsinlineInlineLineBoxBuilderh">trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.h</a></li>
<li><a href="#trunkSourceWebCorelayoutintegrationLayoutIntegrationInlineContentBuildercpp">trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContentBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorelayoutintegrationLayoutIntegrationRunh">trunk/Source/WebCore/layout/integration/LayoutIntegrationRun.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorelayoutformattingContextsinlineInlineDisplayContentBuildercpp">trunk/Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorelayoutformattingContextsinlineInlineDisplayContentBuilderh">trunk/Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (281733 => 281734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2021-08-28 06:53:18 UTC (rev 281733)
+++ trunk/LayoutTests/ChangeLog 2021-08-28 13:15:49 UTC (rev 281734)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2021-08-28  Alan Bujtas  <zalan@apple.com>
+
+        [LFC][IFC] Move content builder functionality to a dedicated class
+        https://bugs.webkit.org/show_bug.cgi?id=229631
+
+        Reviewed by Antti Koivisto.
+
+        * TestExpectations:
+
</ins><span class="cx"> 2021-08-27  Myles C. Maxfield  <mmaxfield@apple.com>
</span><span class="cx"> 
</span><span class="cx">         The simple text codepath does not handle unpaired surrogates
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (281733 => 281734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations       2021-08-28 06:53:18 UTC (rev 281733)
+++ trunk/LayoutTests/TestExpectations  2021-08-28 13:15:49 UTC (rev 281734)
</span><span class="lines">@@ -5023,6 +5023,10 @@
</span><span class="cx"> [ Debug ] fast/layoutformattingcontext/table-fixed-width-with-max-distribution.html [ Skip ]
</span><span class="cx"> [ Debug ] fast/layoutformattingcontext/table-space-distribution-simple-mismatching.html [ Skip ]
</span><span class="cx"> 
</span><ins>+# Missing painting support for in-flow positioning
+fast/layoutformattingcontext/replaced-box-with-margin-on-baseline.html [ ImageOnlyFailure ]
+fast/layoutformattingcontext/table-cell-vertical-alignment-simple.html [ ImageOnlyFailure ]
+
</ins><span class="cx"> # This webstorage test has crashed since it was imported.
</span><span class="cx"> imported/w3c/web-platform-tests/webstorage/storage_session_setitem_quotaexceedederr.window.html [ Skip ]
</span><span class="cx"> # This webstorage test has timed out since it was imported.
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (281733 => 281734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-08-28 06:53:18 UTC (rev 281733)
+++ trunk/Source/WebCore/ChangeLog      2021-08-28 13:15:49 UTC (rev 281734)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2021-08-28  Alan Bujtas  <zalan@apple.com>
+
+        [LFC][IFC] Move content builder functionality to a dedicated class
+        https://bugs.webkit.org/show_bug.cgi?id=229631
+
+        Reviewed by Antti Koivisto.
+
+        Let's use a dedicated class for constructing the final line runs. This is also going to be used
+        for computing overflow and other "display" type of value once it's merged with LayoutIntegration::InlineContentBuilder.
+
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * layout/LayoutUnits.h:
+        * layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp: Added.
+        (WebCore::Layout::InlineDisplayContentBuilder::InlineDisplayContentBuilder):
+        (WebCore::Layout::InlineDisplayContentBuilder::build):
+        (WebCore::Layout::InlineDisplayContentBuilder::createRunsAndUpdateGeometryForLineContent):
+        (WebCore::Layout::InlineDisplayContentBuilder::createRunsAndUpdateGeometryForLineSpanningInlineBoxes):
+        * layout/formattingContexts/inline/InlineDisplayContentBuilder.h: Copied from Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.h.
+        (WebCore::Layout::InlineDisplayContentBuilder::root const):
+        (WebCore::Layout::InlineDisplayContentBuilder::formattingState const):
+        * layout/formattingContexts/inline/InlineFormattingContext.cpp:
+        (WebCore::Layout::InlineFormattingContext::lineLayout):
+        (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
+        * layout/formattingContexts/inline/InlineFormattingContext.h:
+        * layout/formattingContexts/inline/InlineLevelBox.h:
+        (WebCore::Layout::InlineLevelBox::isInlineBox const):
+        (WebCore::Layout::InlineLevelBox::isLineSpanningInlineBox const):
+        (WebCore::Layout::InlineLevelBox::createInlineBox):
+        * layout/formattingContexts/inline/InlineLine.h:
+        (WebCore::Layout::Line::Run::type const):
+        * layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
+        (WebCore::Layout::LineBoxBuilder::constructAndAlignInlineLevelBoxes):
+        * layout/formattingContexts/inline/InlineLineBoxBuilder.h:
+        * layout/integration/LayoutIntegrationInlineContentBuilder.cpp:
+        (WebCore::LayoutIntegration::lineOverflowWidth):
+        * layout/integration/LayoutIntegrationRun.h:
+
</ins><span class="cx"> 2021-08-27  Myles C. Maxfield  <mmaxfield@apple.com>
</span><span class="cx"> 
</span><span class="cx">         The simple text codepath does not handle unpaired surrogates
</span></span></pre></div>
<a id="trunkSourceWebCoreSourcestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Sources.txt (281733 => 281734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Sources.txt 2021-08-28 06:53:18 UTC (rev 281733)
+++ trunk/Source/WebCore/Sources.txt    2021-08-28 13:15:49 UTC (rev 281734)
</span><span class="lines">@@ -1452,6 +1452,7 @@
</span><span class="cx"> layout/floats/FloatingContext.cpp
</span><span class="cx"> layout/floats/FloatingState.cpp
</span><span class="cx"> layout/formattingContexts/inline/InlineContentBreaker.cpp
</span><ins>+layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp
</ins><span class="cx"> layout/formattingContexts/inline/InlineFormattingContext.cpp
</span><span class="cx"> layout/formattingContexts/inline/InlineFormattingGeometry.cpp
</span><span class="cx"> layout/formattingContexts/inline/InlineFormattingQuirks.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (281733 => 281734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj   2021-08-28 06:53:18 UTC (rev 281733)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj      2021-08-28 13:15:49 UTC (rev 281734)
</span><span class="lines">@@ -398,6 +398,7 @@
</span><span class="cx">          11310CF620BA4A560065A8D0 /* LayoutChildIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 11100FC920927CBC0081AA6C /* LayoutChildIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          113409DA203E038000C66915 /* RenderTreeBuilderContinuation.h in Headers */ = {isa = PBXBuildFile; fileRef = 113409D8203E038000C66915 /* RenderTreeBuilderContinuation.h */; };
</span><span class="cx">          113D0B521F9FDD2B00F611BB /* FrameViewLayoutContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 113D0B501F9FDD2B00F611BB /* FrameViewLayoutContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+               11513D0326D981E8004D3FAA /* InlineDisplayContentBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 11513D0226D981E7004D3FAA /* InlineDisplayContentBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">           115CFA6A208AF7D0001E6991 /* FormattingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 115CFA68208AF7D0001E6991 /* FormattingContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          115CFA6E208AFAB7001E6991 /* BlockFormattingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 115CFA6C208AFAB6001E6991 /* BlockFormattingContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          115CFA76208AFE30001E6991 /* FormattingState.h in Headers */ = {isa = PBXBuildFile; fileRef = 115CFA74208AFE30001E6991 /* FormattingState.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -6411,6 +6412,8 @@
</span><span class="cx">          113409D8203E038000C66915 /* RenderTreeBuilderContinuation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RenderTreeBuilderContinuation.h; sourceTree = "<group>"; };
</span><span class="cx">          113D0B4F1F9FDD2B00F611BB /* FrameViewLayoutContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FrameViewLayoutContext.cpp; sourceTree = "<group>"; };
</span><span class="cx">          113D0B501F9FDD2B00F611BB /* FrameViewLayoutContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FrameViewLayoutContext.h; sourceTree = "<group>"; };
</span><ins>+               11513D0026D981DD004D3FAA /* InlineDisplayContentBuilder.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InlineDisplayContentBuilder.cpp; sourceTree = "<group>"; };
+               11513D0226D981E7004D3FAA /* InlineDisplayContentBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineDisplayContentBuilder.h; sourceTree = "<group>"; };
</ins><span class="cx">           115CA83023328B1E00FD3B08 /* LayoutUnits.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutUnits.cpp; sourceTree = "<group>"; };
</span><span class="cx">          115CFA68208AF7D0001E6991 /* FormattingContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FormattingContext.h; sourceTree = "<group>"; };
</span><span class="cx">          115CFA69208AF7D0001E6991 /* FormattingContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FormattingContext.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -18031,6 +18034,8 @@
</span><span class="cx">                          6FE7DDDD20EC6E8B008B5B4E /* text */,
</span><span class="cx">                          6FE198132178397B00446F08 /* InlineContentBreaker.cpp */,
</span><span class="cx">                          6FE198152178397C00446F08 /* InlineContentBreaker.h */,
</span><ins>+                               11513D0026D981DD004D3FAA /* InlineDisplayContentBuilder.cpp */,
+                               11513D0226D981E7004D3FAA /* InlineDisplayContentBuilder.h */,
</ins><span class="cx">                           6F7CA3C9208C2B2E002F29AB /* InlineFormattingContext.cpp */,
</span><span class="cx">                          6F7CA3C8208C2B2E002F29AB /* InlineFormattingContext.h */,
</span><span class="cx">                          6F35EFAF2187CBD50044E0F4 /* InlineFormattingGeometry.cpp */,
</span><span class="lines">@@ -32431,6 +32436,7 @@
</span><span class="cx">                          CD063F831E23FA8900812BE3 /* InitDataRegistry.h in Headers */,
</span><span class="cx">                          E30592641E27A3AD00D57C98 /* InlineClassicScript.h in Headers */,
</span><span class="cx">                          6FE198172178397C00446F08 /* InlineContentBreaker.h in Headers */,
</span><ins>+                               11513D0326D981E8004D3FAA /* InlineDisplayContentBuilder.h in Headers */,
</ins><span class="cx">                           6F7CA3CA208C2B2E002F29AB /* InlineFormattingContext.h in Headers */,
</span><span class="cx">                          47C4D57D26508BCB00C7AB1F /* InlineFormattingGeometry.h in Headers */,
</span><span class="cx">                          6FE636E82647962900F0951E /* InlineFormattingQuirks.h in Headers */,
</span><span class="lines">@@ -32440,6 +32446,7 @@
</span><span class="cx">                          6FAAE71326A2814B00E07502 /* InlineLevelBox.h in Headers */,
</span><span class="cx">                          6F0CD695229ED32700C5994E /* InlineLine.h in Headers */,
</span><span class="cx">                          6FB2400523DFF12800796458 /* InlineLineBox.h in Headers */,
</span><ins>+                               11C3227D26D958CE00328F4D /* InlineLineBoxBuilder.h in Headers */,
</ins><span class="cx">                           6F6EE74326D44EE300374CDA /* InlineLineBoxVerticalAligner.h in Headers */,
</span><span class="cx">                          6F26EB48234004A5006906E2 /* InlineLineBuilder.h in Headers */,
</span><span class="cx">                          6F91421125152138004E4FEA /* InlineLineGeometry.h in Headers */,
</span><span class="lines">@@ -33306,7 +33313,6 @@
</span><span class="cx">                          07846343145B151A00A58DF1 /* JSTrackEvent.h in Headers */,
</span><span class="cx">                          E17B492116A9B8FF001C8839 /* JSTransitionEvent.h in Headers */,
</span><span class="cx">                          1A750D5D0A90DEE1000FF215 /* JSTreeWalker.h in Headers */,
</span><del>-                               11C3227D26D958CE00328F4D /* InlineLineBoxBuilder.h in Headers */,
</del><span class="cx">                           A86629CF09DA2B47009633A5 /* JSUIEvent.h in Headers */,
</span><span class="cx">                          465307D01DB6EE4800E4137C /* JSUIEventInit.h in Headers */,
</span><span class="cx">                          7C73FB12191EF6F4007DE061 /* JSUserMessageHandler.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutLayoutUnitsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/LayoutUnits.h (281733 => 281734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/LayoutUnits.h        2021-08-28 06:53:18 UTC (rev 281733)
+++ trunk/Source/WebCore/layout/LayoutUnits.h   2021-08-28 13:15:49 UTC (rev 281734)
</span><span class="lines">@@ -36,6 +36,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+namespace Layout {
+
</ins><span class="cx"> #define USE_FLOAT_AS_INLINE_LAYOUT_UNIT 1
</span><span class="cx"> 
</span><span class="cx"> #if USE_FLOAT_AS_INLINE_LAYOUT_UNIT
</span><span class="lines">@@ -50,8 +52,6 @@
</span><span class="cx"> using InlineLayoutRect = LayoutRect;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-namespace Layout {
-
</del><span class="cx"> struct Position {
</span><span class="cx">     operator LayoutUnit() const { return value; }
</span><span class="cx">     LayoutUnit value;
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutformattingContextsinlineInlineDisplayContentBuildercpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp (0 => 281734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp                            (rev 0)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp       2021-08-28 13:15:49 UTC (rev 281734)
</span><span class="lines">@@ -0,0 +1,155 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "InlineDisplayContentBuilder.h"
+
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+
+#include "LayoutBoxGeometry.h"
+
+namespace WebCore {
+namespace Layout {
+
+
+InlineDisplayContentBuilder::InlineDisplayContentBuilder(const ContainerBox& formattingContextRoot, InlineFormattingState& formattingState)
+    : m_formattingContextRoot(formattingContextRoot)
+    , m_formattingState(formattingState)
+{
+
+}
+
+void InlineDisplayContentBuilder::build(const LineBuilder::LineContent& lineContent, const LineBox& lineBox, const InlineLayoutPoint& lineBoxLogicalTopLeft, const size_t lineIndex)
+{
+    auto& formattingState = this->formattingState();
+    // Every line starts with a root run, even the empty ones.
+    formattingState.addLineRun({ lineIndex, LineRun::Type::RootInlineBox, root(), lineBox.logicalRectForRootInlineBox(), { }, { },  lineBox.rootInlineBox().hasContent()});
+
+    // Spanning inline boxes start at the very beginning of the line.
+    auto lineSpanningInlineBoxIndex = formattingState.lineRuns().size();
+    createRunsAndUpdateGeometryForLineContent(lineContent, lineBox, lineBoxLogicalTopLeft, lineIndex);
+    createRunsAndUpdateGeometryForLineSpanningInlineBoxes(lineBox, lineBoxLogicalTopLeft, lineIndex, lineSpanningInlineBoxIndex);
+}
+
+void InlineDisplayContentBuilder::createRunsAndUpdateGeometryForLineContent(const LineBuilder::LineContent& lineContent, const LineBox& lineBox, const InlineLayoutPoint& lineBoxLogicalTopLeft, const size_t lineIndex)
+{
+    auto& formattingState = this->formattingState();
+    // Create the inline runs on the current line. This is mostly text and atomic inline runs.
+    for (auto& lineRun : lineContent.runs) {
+        auto& layoutBox = lineRun.layoutBox();
+        switch (lineRun.type()) {
+        case InlineItem::Type::Text:
+            formattingState.addLineRun({ lineIndex, LineRun::Type::Text, layoutBox, lineBox.logicalRectForTextRun(lineRun), lineRun.expansion(), lineRun.textContent() });
+            break;
+        case InlineItem::Type::SoftLineBreak:
+            formattingState.addLineRun({ lineIndex, LineRun::Type::SoftLineBreak, layoutBox, lineBox.logicalRectForTextRun(lineRun), lineRun.expansion(), lineRun.textContent() });
+            break;
+        case InlineItem::Type::HardLineBreak: {
+            // Only hard linebreaks have associated layout boxes.
+            auto lineBreakBoxRect = lineBox.logicalRectForLineBreakBox(layoutBox);
+            formattingState.addLineRun({ lineIndex, LineRun::Type::LineBreakBox, layoutBox, lineBreakBoxRect, lineRun.expansion(), { } });
+
+            auto& boxGeometry = formattingState.boxGeometry(layoutBox);
+            lineBreakBoxRect.moveBy(lineBoxLogicalTopLeft);
+            boxGeometry.setLogicalTopLeft(toLayoutPoint(lineBreakBoxRect.topLeft()));
+            boxGeometry.setContentBoxHeight(toLayoutUnit(lineBreakBoxRect.height()));
+            break;
+        }
+        case InlineItem::Type::Box: {
+            ASSERT(layoutBox.isAtomicInlineLevelBox());
+            auto& boxGeometry = formattingState.boxGeometry(layoutBox);
+            auto logicalBorderBox = lineBox.logicalBorderBoxForAtomicInlineLevelBox(layoutBox, boxGeometry);
+            formattingState.addLineRun({ lineIndex, LineRun::Type::AtomicInlineLevelBox, layoutBox, logicalBorderBox, lineRun.expansion(), { } });
+
+            auto borderBoxLogicalTopLeft = logicalBorderBox.topLeft();
+            // Note that inline boxes are relative to the line and their top position can be negative.
+            borderBoxLogicalTopLeft.moveBy(lineBoxLogicalTopLeft);
+            // Atomic inline boxes are all set. Their margin/border/content box geometries are already computed. We just have to position them here.
+            boxGeometry.setLogicalTopLeft(toLayoutPoint(borderBoxLogicalTopLeft));
+            break;
+        }
+        case InlineItem::Type::InlineBoxStart: {
+            // This inline box showed up first on this line.
+            auto& boxGeometry = formattingState.boxGeometry(layoutBox);
+            auto inlineBoxBorderBox = lineBox.logicalBorderBoxForInlineBox(layoutBox, boxGeometry);
+            if (lineBox.hasContent()) {
+                // FIXME: It's expected to not have any runs on empty lines. We should reconsider this.
+                formattingState.addLineRun({ lineIndex, LineRun::Type::NonRootInlineBox, layoutBox, inlineBoxBorderBox, { }, { }, lineBox.inlineLevelBoxForLayoutBox(layoutBox).hasContent() });
+            }
+
+            auto inlineBoxSize = LayoutSize { LayoutUnit::fromFloatCeil(inlineBoxBorderBox.width()), LayoutUnit::fromFloatCeil(inlineBoxBorderBox.height()) };
+            auto logicalRect = Rect { LayoutPoint { inlineBoxBorderBox.topLeft() }, inlineBoxSize };
+            logicalRect.moveBy(LayoutPoint { lineBoxLogicalTopLeft });
+            boxGeometry.setLogicalTopLeft(logicalRect.topLeft());
+            auto contentBoxHeight = logicalRect.height() - (boxGeometry.verticalBorder() + boxGeometry.verticalPadding().value_or(0_lu));
+            boxGeometry.setContentBoxHeight(contentBoxHeight);
+            auto contentBoxWidth = logicalRect.width() - (boxGeometry.horizontalBorder() + boxGeometry.horizontalPadding().value_or(0_lu));
+            boxGeometry.setContentBoxWidth(contentBoxWidth);
+            break;
+        }
+        default:
+            ASSERT(lineRun.isInlineBoxEnd() || lineRun.isWordBreakOpportunity());
+            break;
+        }
+    }
+}
+
+void InlineDisplayContentBuilder::createRunsAndUpdateGeometryForLineSpanningInlineBoxes(const LineBox& lineBox, const InlineLayoutPoint& lineBoxLogicalTopLeft, const size_t lineIndex, size_t lineSpanningInlineBoxIndex)
+{
+    if (!lineBox.hasContent()) {
+        // When a spanning inline box (e.g. <div>text<span><br></span></div>) lands on an empty line
+        // (empty here means no content at all including line breaks, not just visually empty) then we
+        // don't extend the spanning line box over to this line -also there is no next line in cases like this.
+        return;
+    }
+
+    auto& formattingState = this->formattingState();
+    for (auto& inlineLevelBox : lineBox.nonRootInlineLevelBoxes()) {
+        if (!inlineLevelBox.isLineSpanningInlineBox())
+            continue;
+        auto& layoutBox = inlineLevelBox.layoutBox();
+        auto& boxGeometry = formattingState.boxGeometry(layoutBox);
+        // Inline boxes may or may not be wrapped and have runs on multiple lines (e.g. <span>first line<br>second line<br>third line</span>)
+        auto inlineBoxBorderBox = lineBox.logicalBorderBoxForInlineBox(layoutBox, boxGeometry);
+
+        formattingState.lineRuns().insert(lineSpanningInlineBoxIndex++, { lineIndex, LineRun::Type::NonRootInlineBox, layoutBox, inlineBoxBorderBox, { }, { }, inlineLevelBox.hasContent(), true });
+
+        auto inlineBoxSize = LayoutSize { LayoutUnit::fromFloatCeil(inlineBoxBorderBox.width()), LayoutUnit::fromFloatCeil(inlineBoxBorderBox.height()) };
+        auto logicalRect = Rect { LayoutPoint { inlineBoxBorderBox.topLeft() }, inlineBoxSize };
+        logicalRect.moveBy(LayoutPoint { lineBoxLogicalTopLeft });
+        // Middle or end of the inline box. Let's stretch the box as needed.
+        auto enclosingBorderBoxRect = BoxGeometry::borderBoxRect(boxGeometry);
+        enclosingBorderBoxRect.expandToContain(logicalRect);
+        boxGeometry.setLogicalLeft(enclosingBorderBoxRect.left());
+
+        boxGeometry.setContentBoxHeight(enclosingBorderBoxRect.height() - (boxGeometry.verticalBorder() + boxGeometry.verticalPadding().value_or(0_lu)));
+        boxGeometry.setContentBoxWidth(enclosingBorderBoxRect.width() - (boxGeometry.horizontalBorder() + boxGeometry.horizontalPadding().value_or(0_lu)));
+    }
+}
+
+}
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorelayoutformattingContextsinlineInlineDisplayContentBuilderhfromrev281733trunkSourceWebCorelayoutformattingContextsinlineInlineLineBoxBuilderh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.h (from rev 281733, trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.h) (0 => 281734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.h                              (rev 0)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.h 2021-08-28 13:15:49 UTC (rev 281734)
</span><span class="lines">@@ -0,0 +1,60 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+
+#include "InlineLineBuilder.h"
+#include "LayoutUnits.h"
+
+namespace WebCore {
+namespace Layout {
+
+class ContainerBox;
+class InlineFormattingState;
+class LineBox;
+
+class InlineDisplayContentBuilder {
+public:
+    InlineDisplayContentBuilder(const ContainerBox& formattingContextRoot, InlineFormattingState&);
+
+    void build(const LineBuilder::LineContent&, const LineBox&, const InlineLayoutPoint& lineBoxLogicalTopLeft, const size_t lineIndex);
+
+private:
+    void createRunsAndUpdateGeometryForLineContent(const LineBuilder::LineContent&, const LineBox&, const InlineLayoutPoint& lineBoxLogicalTopLeft, const size_t lineIndex);
+    void createRunsAndUpdateGeometryForLineSpanningInlineBoxes(const LineBox&, const InlineLayoutPoint& lineBoxLogicalTopLeft, const size_t lineIndex, size_t lineSpanningInlineBoxIndex);
+
+    const ContainerBox& root() const { return m_formattingContextRoot; }
+    InlineFormattingState& formattingState() const { return m_formattingState; } 
+
+    const ContainerBox& m_formattingContextRoot;
+    InlineFormattingState& m_formattingState;
+};
+
+}
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorelayoutformattingContextsinlineInlineFormattingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp (281733 => 281734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp        2021-08-28 06:53:18 UTC (rev 281733)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp   2021-08-28 13:15:49 UTC (rev 281734)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include "FloatingContext.h"
</span><span class="cx"> #include "FontCascade.h"
</span><ins>+#include "InlineDisplayContentBuilder.h"
</ins><span class="cx"> #include "InlineFormattingState.h"
</span><span class="cx"> #include "InlineLineBox.h"
</span><span class="cx"> #include "InlineLineBoxBuilder.h"
</span><span class="lines">@@ -205,7 +206,7 @@
</span><span class="cx">         }();
</span><span class="cx">         auto initialLineConstraints = InlineRect { lineLogicalTop, constraints.horizontal().logicalLeft, constraints.horizontal().logicalWidth, initialLineHeight };
</span><span class="cx">         auto lineContent = lineBuilder.layoutInlineContent(needsLayoutRange, partialLeadingContentLength, leadingLogicalWidth, initialLineConstraints, isFirstLine);
</span><del>-        auto lineLogicalRect = computeGeometryForLineContent(lineContent, constraints.horizontal());
</del><ins>+        auto lineLogicalRect = computeGeometryForLineContent(lineContent);
</ins><span class="cx"> 
</span><span class="cx">         auto lineContentRange = lineContent.inlineItemRange;
</span><span class="cx">         if (!lineContentRange.isEmpty()) {
</span><span class="lines">@@ -567,139 +568,18 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-InlineRect InlineFormattingContext::computeGeometryForLineContent(const LineBuilder::LineContent& lineContent, const HorizontalConstraints& horizontalConstraints)
</del><ins>+InlineRect InlineFormattingContext::computeGeometryForLineContent(const LineBuilder::LineContent& lineContent)
</ins><span class="cx"> {
</span><span class="cx">     auto& formattingState = this->formattingState();
</span><del>-    auto& formattingGeometry = this->formattingGeometry();
-    auto lineIndex = formattingState.lines().size();
</del><ins>+    auto currentLineIndex = formattingState.lines().size();
</ins><span class="cx"> 
</span><span class="cx">     auto lineBoxAndGeometry = LineBoxBuilder(*this).build(lineContent);
</span><span class="cx">     formattingState.addLineBox(WTFMove(lineBoxAndGeometry.lineBox));
</span><span class="cx">     formattingState.addLine(lineBoxAndGeometry.lineGeometry);
</span><span class="cx"> 
</span><del>-    const auto& lineBox = formattingState.lineBoxes().last();
</del><span class="cx">     auto lineBoxLogicalRect = lineBoxAndGeometry.lineGeometry.lineBoxLogicalRect();
</span><span class="cx"> 
</span><del>-    // Every line starts with a root run, even the empty ones.
-    formattingState.addLineRun({ lineIndex, LineRun::Type::RootInlineBox, root(), lineBox.logicalRectForRootInlineBox(), { }, { },  lineBox.rootInlineBox().hasContent()});
-
-    if (!lineBox.hasContent()) {
-        // Fast path for lines with no content e.g. <div><span></span><span></span></div> or <span><div></div></span> where we construct empty pre and post blocks.
-        ASSERT(!lineBox.rootInlineBox().hasContent() && !lineBoxLogicalRect.height());
-        auto updateInlineBoxesGeometryIfApplicable = [&] {
-            if (!lineBox.hasInlineBox())
-                return;
-            Vector<const Box*> layoutBoxList;
-            // Collect the empty inline boxes that showed up first on this line.
-            // Note that an inline box end on an empty line does not make the inline box taller.
-            // (e.g. <div>text<span><br></span></div>) <- the <span> inline box is as tall as the line even though the </span> is after a <br> so technically is on the following (empty)line.
-            for (auto& lineRun : lineContent.runs) {
-                if (lineRun.isInlineBoxStart())
-                    layoutBoxList.append(&lineRun.layoutBox());
-            }
-            for (auto* layoutBox : layoutBoxList) {
-                auto& boxGeometry = formattingState.boxGeometry(*layoutBox);
-                auto inlineBoxLogicalHeight = LayoutUnit::fromFloatCeil(lineBox.logicalBorderBoxForInlineBox(*layoutBox, boxGeometry).height());
-                boxGeometry.setContentBoxHeight(inlineBoxLogicalHeight);
-                boxGeometry.setContentBoxWidth({ });
-                boxGeometry.setLogicalTopLeft(toLayoutPoint(lineBoxLogicalRect.topLeft()));
-            }
-        };
-        updateInlineBoxesGeometryIfApplicable();
-        return lineBoxLogicalRect;
-    }
-
-    // Spanning inline boxes start at the very beginning of the line.
-    auto lineSpanningInlineBoxIndex = formattingState.lineRuns().size();
-    HashSet<const Box*> inlineBoxStartSet;
-    auto constructLineRunsAndUpdateBoxGeometry = [&] {
-        // Create the inline runs on the current line. This is mostly text and atomic inline runs.
-        for (auto& lineRun : lineContent.runs) {
-            // FIXME: We should not need to construct a line run for <br>.
-            auto& layoutBox = lineRun.layoutBox();
-            if (lineRun.isText()) {
-                formattingState.addLineRun({ lineIndex, LineRun::Type::Text, layoutBox, lineBox.logicalRectForTextRun(lineRun), lineRun.expansion(), lineRun.textContent() });
-                continue;
-            }
-            if (lineRun.isLineBreak()) {
-                if (layoutBox.isLineBreakBox()) {
-                    // Only hard linebreaks have associated layout boxes.
-                    auto lineBreakBoxRect = lineBox.logicalRectForLineBreakBox(layoutBox);
-                    formattingState.addLineRun({ lineIndex, LineRun::Type::LineBreakBox, layoutBox, lineBreakBoxRect, lineRun.expansion(), { } });
-
-                    auto& boxGeometry = formattingState.boxGeometry(layoutBox);
-                    lineBreakBoxRect.moveBy(lineBoxLogicalRect.topLeft());
-                    boxGeometry.setLogicalTopLeft(toLayoutPoint(lineBreakBoxRect.topLeft()));
-                    boxGeometry.setContentBoxHeight(toLayoutUnit(lineBreakBoxRect.height()));
-                } else 
-                    formattingState.addLineRun({ lineIndex, LineRun::Type::SoftLineBreak, layoutBox, lineBox.logicalRectForTextRun(lineRun), lineRun.expansion(), lineRun.textContent() });
-                continue;
-            }
-            if (lineRun.isBox()) {
-                ASSERT(layoutBox.isAtomicInlineLevelBox());
-                auto& boxGeometry = formattingState.boxGeometry(layoutBox);
-                auto logicalBorderBox = lineBox.logicalBorderBoxForAtomicInlineLevelBox(layoutBox, boxGeometry);
-                formattingState.addLineRun({ lineIndex, LineRun::Type::AtomicInlineLevelBox, layoutBox, logicalBorderBox, lineRun.expansion(), { } });
-
-                auto borderBoxLogicalTopLeft = logicalBorderBox.topLeft();
-                // Note that inline boxes are relative to the line and their top position can be negative.
-                borderBoxLogicalTopLeft.moveBy(lineBoxLogicalRect.topLeft());
-                if (layoutBox.isInFlowPositioned())
-                    borderBoxLogicalTopLeft += formattingGeometry.inFlowPositionedPositionOffset(layoutBox, horizontalConstraints);
-                // Atomic inline boxes are all set. Their margin/border/content box geometries are already computed. We just have to position them here.
-                boxGeometry.setLogicalTopLeft(toLayoutPoint(borderBoxLogicalTopLeft));
-                continue;
-            }
-            if (lineRun.isInlineBoxStart()) {
-                auto& boxGeometry = formattingState.boxGeometry(layoutBox);
-                auto inlineBoxLogicalRect = lineBox.logicalBorderBoxForInlineBox(layoutBox, boxGeometry);
-                formattingState.addLineRun({ lineIndex, LineRun::Type::NonRootInlineBox, layoutBox, inlineBoxLogicalRect, lineRun.expansion(), { }, lineBox.inlineLevelBoxForLayoutBox(layoutBox).hasContent() });
-                inlineBoxStartSet.add(&layoutBox);
-                continue;
-            }
-            ASSERT(lineRun.isInlineBoxEnd() || lineRun.isWordBreakOpportunity());
-        }
-    };
-    constructLineRunsAndUpdateBoxGeometry();
-
-    auto updateBoxGeometryForInlineBoxes = [&] {
-        // FIXME: We may want to keep around an inline box only set.
-        if (!lineBox.hasInlineBox())
-            return;
-        // Grab the inline boxes (even those that don't have associated layout boxes on the current line due to line wrapping)
-        // and update their geometries.
-        for (auto& inlineLevelBox : lineBox.nonRootInlineLevelBoxes()) {
-            if (!inlineLevelBox.isInlineBox())
-                continue;
-            auto& layoutBox = inlineLevelBox.layoutBox();
-            auto& boxGeometry = formattingState.boxGeometry(layoutBox);
-            // Inline boxes may or may not be wrapped and have runs on multiple lines (e.g. <span>first line<br>second line<br>third line</span>)
-            auto inlineBoxBorderBox = lineBox.logicalBorderBoxForInlineBox(layoutBox, boxGeometry);
-            auto inlineBoxSize = LayoutSize { LayoutUnit::fromFloatCeil(inlineBoxBorderBox.width()), LayoutUnit::fromFloatCeil(inlineBoxBorderBox.height()) };
-            auto logicalRect = Rect { LayoutPoint { inlineBoxBorderBox.topLeft() }, inlineBoxSize };
-            logicalRect.moveBy(LayoutPoint { lineBoxLogicalRect.topLeft() });
-            if (inlineBoxStartSet.contains(&layoutBox)) {
-                // This inline box showed up first on this line.
-                boxGeometry.setLogicalTopLeft(logicalRect.topLeft());
-                auto contentBoxHeight = logicalRect.height() - (boxGeometry.verticalBorder() + boxGeometry.verticalPadding().value_or(0_lu));
-                boxGeometry.setContentBoxHeight(contentBoxHeight);
-                auto contentBoxWidth = logicalRect.width() - (boxGeometry.horizontalBorder() + boxGeometry.horizontalPadding().value_or(0_lu));
-                boxGeometry.setContentBoxWidth(contentBoxWidth);
-                continue;
-            }
-            // Middle or end of the inline box. Let's stretch the box as needed.
-            formattingState.lineRuns().insert(lineSpanningInlineBoxIndex++, { lineIndex, LineRun::Type::NonRootInlineBox, layoutBox, inlineBoxBorderBox, { }, { }, inlineLevelBox.hasContent(), true });
-
-            auto enclosingBorderBoxRect = BoxGeometry::borderBoxRect(boxGeometry);
-            enclosingBorderBoxRect.expandToContain(logicalRect);
-            boxGeometry.setLogicalLeft(enclosingBorderBoxRect.left());
-
-            boxGeometry.setContentBoxHeight(enclosingBorderBoxRect.height() - (boxGeometry.verticalBorder() + boxGeometry.verticalPadding().value_or(0_lu)));
-            boxGeometry.setContentBoxWidth(enclosingBorderBoxRect.width() - (boxGeometry.horizontalBorder() + boxGeometry.horizontalPadding().value_or(0_lu)));
-        }
-    };
-    updateBoxGeometryForInlineBoxes();
-    
</del><ins>+    InlineDisplayContentBuilder(root(), formattingState).build(lineContent, formattingState.lineBoxes().last(), lineBoxLogicalRect.topLeft(), currentLineIndex);
</ins><span class="cx">     return lineBoxLogicalRect;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutformattingContextsinlineInlineFormattingContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.h (281733 => 281734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.h  2021-08-28 06:53:18 UTC (rev 281733)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.h     2021-08-28 13:15:49 UTC (rev 281734)
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx">     void computeWidthAndMargin(const Box&, const HorizontalConstraints&);
</span><span class="cx"> 
</span><span class="cx">     void collectContentIfNeeded();
</span><del>-    InlineRect computeGeometryForLineContent(const LineBuilder::LineContent&, const HorizontalConstraints&);
</del><ins>+    InlineRect computeGeometryForLineContent(const LineBuilder::LineContent&);
</ins><span class="cx">     void invalidateFormattingState(const InvalidationState&);
</span><span class="cx"> 
</span><span class="cx">     const InlineFormattingGeometry m_inlineFormattingGeometry;
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutformattingContextsinlineInlineLevelBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h (281733 => 281734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h   2021-08-28 06:53:18 UTC (rev 281733)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h      2021-08-28 13:15:49 UTC (rev 281734)
</span><span class="lines">@@ -41,7 +41,8 @@
</span><span class="cx"> 
</span><span class="cx"> class InlineLevelBox {
</span><span class="cx"> public:
</span><del>-    static InlineLevelBox createInlineBox(const Box&, InlineLayoutUnit logicalLeft, InlineLayoutUnit logicalWidth);
</del><ins>+    enum class LineSpanningInlineBox { Yes, No };
+    static InlineLevelBox createInlineBox(const Box&, InlineLayoutUnit logicalLeft, InlineLayoutUnit logicalWidth, LineSpanningInlineBox = LineSpanningInlineBox::No);
</ins><span class="cx">     static InlineLevelBox createAtomicInlineLevelBox(const Box&, InlineLayoutUnit logicalLeft, InlineLayoutSize);
</span><span class="cx">     static InlineLevelBox createLineBreakBox(const Box&, InlineLayoutUnit logicalLeft);
</span><span class="cx">     static InlineLevelBox createGenericInlineLevelBox(const Box&, InlineLayoutUnit logicalLeft);
</span><span class="lines">@@ -65,8 +66,9 @@
</span><span class="cx">     const Box& layoutBox() const { return *m_layoutBox; }
</span><span class="cx">     const RenderStyle& style() const { return m_layoutBox->style(); }
</span><span class="cx"> 
</span><del>-    bool isInlineBox() const { return m_type == Type::InlineBox || m_type == Type::RootInlineBox; }
</del><ins>+    bool isInlineBox() const { return m_type == Type::InlineBox || isRootInlineBox() || isLineSpanningInlineBox(); }
</ins><span class="cx">     bool isRootInlineBox() const { return m_type == Type::RootInlineBox; }
</span><ins>+    bool isLineSpanningInlineBox() const { return m_type == Type::LineSpanningInlineBox; }
</ins><span class="cx">     bool isAtomicInlineLevelBox() const { return m_type == Type::AtomicInlineLevelBox; }
</span><span class="cx">     bool isLineBreakBox() const { return m_type == Type::LineBreakBox; }
</span><span class="cx">     bool hasLineBoxRelativeAlignment() const;
</span><span class="lines">@@ -73,6 +75,7 @@
</span><span class="cx"> 
</span><span class="cx">     enum class Type : uint8_t {
</span><span class="cx">         InlineBox             = 1 << 0,
</span><ins>+        LineSpanningInlineBox = 1 << 1,
</ins><span class="cx">         RootInlineBox         = 1 << 1,
</span><span class="cx">         AtomicInlineLevelBox  = 1 << 2,
</span><span class="cx">         LineBreakBox          = 1 << 3,
</span><span class="lines">@@ -138,9 +141,9 @@
</span><span class="cx">     return InlineLevelBox { layoutBox, logicalLeft, logicalSize, Type::AtomicInlineLevelBox };
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline InlineLevelBox InlineLevelBox::createInlineBox(const Box& layoutBox, InlineLayoutUnit logicalLeft, InlineLayoutUnit logicalWidth)
</del><ins>+inline InlineLevelBox InlineLevelBox::createInlineBox(const Box& layoutBox, InlineLayoutUnit logicalLeft, InlineLayoutUnit logicalWidth, LineSpanningInlineBox isLineSpanning)
</ins><span class="cx"> {
</span><del>-    return InlineLevelBox { layoutBox, logicalLeft, InlineLayoutSize { logicalWidth, { } }, Type::InlineBox };
</del><ins>+    return InlineLevelBox { layoutBox, logicalLeft, InlineLayoutSize { logicalWidth, { } }, isLineSpanning == LineSpanningInlineBox::Yes ? Type::LineSpanningInlineBox : Type::InlineBox };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline InlineLevelBox InlineLevelBox::createLineBreakBox(const Box& layoutBox, InlineLayoutUnit logicalLeft)
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutformattingContextsinlineInlineLineh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineLine.h (281733 => 281734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineLine.h       2021-08-28 06:53:18 UTC (rev 281733)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineLine.h  2021-08-28 13:15:49 UTC (rev 281734)
</span><span class="lines">@@ -68,6 +68,7 @@
</span><span class="cx">         bool isWordBreakOpportunity() const { return m_type == InlineItem::Type::WordBreakOpportunity; }
</span><span class="cx">         bool isInlineBoxStart() const { return m_type == InlineItem::Type::InlineBoxStart; }
</span><span class="cx">         bool isInlineBoxEnd() const { return m_type == InlineItem::Type::InlineBoxEnd; }
</span><ins>+        auto type() const { return m_type; }
</ins><span class="cx"> 
</span><span class="cx">         const Box& layoutBox() const { return *m_layoutBox; }
</span><span class="cx">         const RenderStyle& style() const { return m_layoutBox->style(); }
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutformattingContextsinlineInlineLineBoxBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp (281733 => 281734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp   2021-08-28 06:53:18 UTC (rev 281733)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp      2021-08-28 13:15:49 UTC (rev 281734)
</span><span class="lines">@@ -26,7 +26,10 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "InlineLineBoxBuilder.h"
</span><span class="cx"> 
</span><ins>+#include "InlineLineBoxVerticalAligner.h"
</ins><span class="cx"> #include "InlineLineBuilder.h"
</span><ins>+#include "LayoutBoxGeometry.h"
+#include "LayoutReplacedBox.h"
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
</span><span class="cx"> 
</span><span class="lines">@@ -191,7 +194,7 @@
</span><span class="cx">         canUseSimplifiedAlignment = LineBoxVerticalAligner::canUseSimplifiedAlignmentForInlineLevelBox(rootInlineBox, inlineLevelBox, boxGeometry);
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    auto createWrappedInlineBoxes = [&] {
</del><ins>+    auto createLineSpanningInlineBoxes = [&] {
</ins><span class="cx">         if (runs.isEmpty())
</span><span class="cx">             return;
</span><span class="cx">         // An inline box may not necessarily start on the current line:
</span><span class="lines">@@ -220,13 +223,13 @@
</span><span class="cx">         }
</span><span class="cx">         // Construct the missing LineBox::InlineBoxes starting with the topmost layout box.
</span><span class="cx">         for (auto* layoutBox : WTF::makeReversedRange(layoutBoxesWithoutInlineBoxes)) {
</span><del>-            auto inlineBox = InlineLevelBox::createInlineBox(*layoutBox, rootInlineBox.logicalLeft(), rootInlineBox.logicalWidth());
</del><ins>+            auto inlineBox = InlineLevelBox::createInlineBox(*layoutBox, rootInlineBox.logicalLeft(), rootInlineBox.logicalWidth(), InlineLevelBox::LineSpanningInlineBox::Yes);
</ins><span class="cx">             setVerticalGeometryForInlineBox(inlineBox);
</span><span class="cx">             updateCanUseSimplifiedAlignment(inlineBox);
</span><span class="cx">             lineBox.addInlineLevelBox(WTFMove(inlineBox));
</span><span class="cx">         }
</span><span class="cx">     };
</span><del>-    createWrappedInlineBoxes();
</del><ins>+    createLineSpanningInlineBoxes();
</ins><span class="cx"> 
</span><span class="cx">     auto lineHasContent = false;
</span><span class="cx">     for (auto& run : runs) {
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutformattingContextsinlineInlineLineBoxBuilderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.h (281733 => 281734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.h     2021-08-28 06:53:18 UTC (rev 281733)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.h        2021-08-28 13:15:49 UTC (rev 281734)
</span><span class="lines">@@ -27,7 +27,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
</span><span class="cx"> 
</span><ins>+#include "InlineFormattingContext.h"
</ins><span class="cx"> #include "InlineLineBox.h"
</span><ins>+#include "InlineLineBuilder.h"
</ins><span class="cx"> #include "InlineLineGeometry.h"
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -35,7 +37,6 @@
</span><span class="cx"> 
</span><span class="cx"> class Box;
</span><span class="cx"> class ContainerBox;
</span><del>-class InlineFormattingContext;
</del><span class="cx"> class LayoutState;
</span><span class="cx"> 
</span><span class="cx"> class LineBoxBuilder {
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutintegrationLayoutIntegrationInlineContentBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContentBuilder.cpp (281733 => 281734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContentBuilder.cpp        2021-08-28 06:53:18 UTC (rev 281733)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContentBuilder.cpp   2021-08-28 13:15:49 UTC (rev 281734)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx">     return { enclosingTopAndBottom.top + offset, enclosingTopAndBottom.bottom + offset };
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline static float lineOverflowWidth(const RenderBlockFlow& flow, InlineLayoutUnit lineBoxLogicalWidth, InlineLayoutUnit lineContentLogicalWidth)
</del><ins>+inline static float lineOverflowWidth(const RenderBlockFlow& flow, Layout::InlineLayoutUnit lineBoxLogicalWidth, Layout::InlineLayoutUnit lineContentLogicalWidth)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: It's the copy of the lets-adjust-overflow-for-the-caret behavior from LegacyLineLayout::addOverflowFromInlineChildren.
</span><span class="cx">     auto endPadding = flow.hasNonVisibleOverflow() ? flow.paddingEnd() : 0_lu;
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutintegrationLayoutIntegrationRunh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationRun.h (281733 => 281734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/integration/LayoutIntegrationRun.h   2021-08-28 06:53:18 UTC (rev 281733)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationRun.h      2021-08-28 13:15:49 UTC (rev 281734)
</span><span class="lines">@@ -73,7 +73,7 @@
</span><span class="cx"> 
</span><span class="cx">     struct Expansion {
</span><span class="cx">         ExpansionBehavior behavior { DefaultExpansion };
</span><del>-        InlineLayoutUnit horizontalExpansion { 0 };
</del><ins>+        Layout::InlineLayoutUnit horizontalExpansion { 0 };
</ins><span class="cx">     };
</span><span class="cx">     Expansion expansion() const { return m_expansion; }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>