<!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>[282350] 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/282350">282350</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2021-09-13 12:50:02 -0700 (Mon, 13 Sep 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>[LFC] Rename LayoutState::established*FormattingState to formattingStateFor*FormattingContext
https://bugs.webkit.org/show_bug.cgi?id=229263
<rdar://problem/82365067>

Reviewed by Antti Koivisto.

Stop using "established" when asking for the state object associated with a formatting context.
The spec term, "established", is used to indicate that a particular node in the layout tree forces a set of formatting rules on its descendants.
This terms works well in the context of forming formatting contexts. However the corresponding (persistent)formatting states are not "established" in the same sense.

* display/DisplayTreeBuilder.cpp:
(WebCore::Display::TreeBuilder::buildInlineDisplayTree):
* layout/FormattingState.cpp:
(WebCore::Layout::FormattingState::boxGeometry):
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::formattingStateForBox const):
(WebCore::Layout::LayoutState::formattingStateForFormattingContext const):
(WebCore::Layout::LayoutState::formattingStateForInlineFormattingContext const):
(WebCore::Layout::LayoutState::formattingStateForBlockFormattingContext const):
(WebCore::Layout::LayoutState::formattingStateForTableFormattingContext const):
(WebCore::Layout::LayoutState::formattingStateForFlexFormattingContext const):
(WebCore::Layout::LayoutState::ensureInlineFormattingState):
(WebCore::Layout::LayoutState::establishedFormattingState const): Deleted.
(WebCore::Layout::LayoutState::establishedInlineFormattingState const): Deleted.
(WebCore::Layout::LayoutState::establishedBlockFormattingState const): Deleted.
(WebCore::Layout::LayoutState::establishedTableFormattingState const): Deleted.
(WebCore::Layout::LayoutState::establishedFlexFormattingState const): Deleted.
* layout/LayoutState.h:
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
* layout/formattingContexts/FormattingGeometry.cpp:
(WebCore::Layout::FormattingGeometry::computedWidthValue const):
(WebCore::Layout::FormattingGeometry::shrinkToFitWidth const):
(WebCore::Layout::FormattingGeometry::complicatedCases const):
* layout/formattingContexts/block/BlockFormattingGeometry.cpp:
(WebCore::Layout::BlockFormattingGeometry::inFlowNonReplacedContentHeightAndMargin const):
* layout/formattingContexts/block/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockMarginCollapse::marginsCollapseThrough const):
* layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.cpp:
(WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox):
(WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox):
* layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
(WebCore::Layout::LineBoxBuilder::constructAndAlignInlineLevelBoxes):
* layout/formattingContexts/table/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::setUsedGeometryForCells):
* layout/formattingContexts/table/TableFormattingGeometry.cpp:
(WebCore::Layout::TableFormattingGeometry::usedBaselineForCell const):
* 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="#trunkSourceWebCoredisplayDisplayTreeBuildercpp">trunk/Source/WebCore/display/DisplayTreeBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorelayoutFormattingStatecpp">trunk/Source/WebCore/layout/FormattingState.cpp</a></li>
<li><a href="#trunkSourceWebCorelayoutLayoutStatecpp">trunk/Source/WebCore/layout/LayoutState.cpp</a></li>
<li><a href="#trunkSourceWebCorelayoutLayoutStateh">trunk/Source/WebCore/layout/LayoutState.h</a></li>
<li><a href="#trunkSourceWebCorelayoutVerificationcpp">trunk/Source/WebCore/layout/Verification.cpp</a></li>
<li><a href="#trunkSourceWebCorelayoutformattingContextsFormattingGeometrycpp">trunk/Source/WebCore/layout/formattingContexts/FormattingGeometry.cpp</a></li>
<li><a href="#trunkSourceWebCorelayoutformattingContextsblockBlockFormattingGeometrycpp">trunk/Source/WebCore/layout/formattingContexts/block/BlockFormattingGeometry.cpp</a></li>
<li><a href="#trunkSourceWebCorelayoutformattingContextsblockBlockMarginCollapsecpp">trunk/Source/WebCore/layout/formattingContexts/block/BlockMarginCollapse.cpp</a></li>
<li><a href="#trunkSourceWebCorelayoutformattingContextsblocktablewrapperTableWrapperBlockFormattingContextcpp">trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.cpp</a></li>
<li><a href="#trunkSourceWebCorelayoutformattingContextsinlineInlineLineBoxBuildercpp">trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorelayoutformattingContextstableTableFormattingContextcpp">trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingContext.cpp</a></li>
<li><a href="#trunkSourceWebCorelayoutformattingContextstableTableFormattingGeometrycpp">trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingGeometry.cpp</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 (282349 => 282350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/ChangeLog      2021-09-13 19:50:02 UTC (rev 282350)
</span><span class="lines">@@ -1,5 +1,57 @@
</span><span class="cx"> 2021-09-13  Alan Bujtas  <zalan@apple.com>
</span><span class="cx"> 
</span><ins>+        [LFC] Rename LayoutState::established*FormattingState to formattingStateFor*FormattingContext
+        https://bugs.webkit.org/show_bug.cgi?id=229263
+        <rdar://problem/82365067>
+
+        Reviewed by Antti Koivisto.
+
+        Stop using "established" when asking for the state object associated with a formatting context. 
+        The spec term, "established", is used to indicate that a particular node in the layout tree forces a set of formatting rules on its descendants.
+        This terms works well in the context of forming formatting contexts. However the corresponding (persistent)formatting states are not "established" in the same sense.
+
+        * display/DisplayTreeBuilder.cpp:
+        (WebCore::Display::TreeBuilder::buildInlineDisplayTree):
+        * layout/FormattingState.cpp:
+        (WebCore::Layout::FormattingState::boxGeometry):
+        * layout/LayoutState.cpp:
+        (WebCore::Layout::LayoutState::formattingStateForBox const):
+        (WebCore::Layout::LayoutState::formattingStateForFormattingContext const):
+        (WebCore::Layout::LayoutState::formattingStateForInlineFormattingContext const):
+        (WebCore::Layout::LayoutState::formattingStateForBlockFormattingContext const):
+        (WebCore::Layout::LayoutState::formattingStateForTableFormattingContext const):
+        (WebCore::Layout::LayoutState::formattingStateForFlexFormattingContext const):
+        (WebCore::Layout::LayoutState::ensureInlineFormattingState):
+        (WebCore::Layout::LayoutState::establishedFormattingState const): Deleted.
+        (WebCore::Layout::LayoutState::establishedInlineFormattingState const): Deleted.
+        (WebCore::Layout::LayoutState::establishedBlockFormattingState const): Deleted.
+        (WebCore::Layout::LayoutState::establishedTableFormattingState const): Deleted.
+        (WebCore::Layout::LayoutState::establishedFlexFormattingState const): Deleted.
+        * layout/LayoutState.h:
+        * layout/Verification.cpp:
+        (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
+        * layout/formattingContexts/FormattingGeometry.cpp:
+        (WebCore::Layout::FormattingGeometry::computedWidthValue const):
+        (WebCore::Layout::FormattingGeometry::shrinkToFitWidth const):
+        (WebCore::Layout::FormattingGeometry::complicatedCases const):
+        * layout/formattingContexts/block/BlockFormattingGeometry.cpp:
+        (WebCore::Layout::BlockFormattingGeometry::inFlowNonReplacedContentHeightAndMargin const):
+        * layout/formattingContexts/block/BlockMarginCollapse.cpp:
+        (WebCore::Layout::BlockMarginCollapse::marginsCollapseThrough const):
+        * layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.cpp:
+        (WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox):
+        (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox):
+        * layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
+        (WebCore::Layout::LineBoxBuilder::constructAndAlignInlineLevelBoxes):
+        * layout/formattingContexts/table/TableFormattingContext.cpp:
+        (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells):
+        * layout/formattingContexts/table/TableFormattingGeometry.cpp:
+        (WebCore::Layout::TableFormattingGeometry::usedBaselineForCell const):
+        * layout/layouttree/LayoutTreeBuilder.cpp:
+        (WebCore::Layout::showInlineTreeAndRuns):
+
+2021-09-13  Alan Bujtas  <zalan@apple.com>
+
</ins><span class="cx">         [LFC][IFC] Do not pass in the InvalidationState to the layout functions
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=229221
</span><span class="cx">         <rdar://problem/82321574>
</span></span></pre></div>
<a id="trunkSourceWebCoredisplayDisplayTreeBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/display/DisplayTreeBuilder.cpp (282349 => 282350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/display/DisplayTreeBuilder.cpp      2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/display/DisplayTreeBuilder.cpp 2021-09-13 19:50:02 UTC (rev 282350)
</span><span class="lines">@@ -303,7 +303,7 @@
</span><span class="cx"> 
</span><span class="cx"> void TreeBuilder::buildInlineDisplayTree(const Layout::LayoutState& layoutState, const Layout::ContainerBox& inlineFormattingRoot, InsertionPosition& insertionPosition)
</span><span class="cx"> {
</span><del>-    auto& inlineFormattingState = layoutState.establishedInlineFormattingState(inlineFormattingRoot);
</del><ins>+    auto& inlineFormattingState = layoutState.formattingStateForInlineFormattingContext(inlineFormattingRoot);
</ins><span class="cx"> 
</span><span class="cx">     for (auto& run : inlineFormattingState.runs()) {
</span><span class="cx">         if (run.isRootInlineBox()) {
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutFormattingStatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/FormattingState.cpp (282349 => 282350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/FormattingState.cpp  2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/layout/FormattingState.cpp     2021-09-13 19:50:02 UTC (rev 282350)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx"> BoxGeometry& FormattingState::boxGeometry(const Box& layoutBox)
</span><span class="cx"> {
</span><span class="cx">     // Should never need to mutate a display box outside of the formatting context.
</span><del>-    ASSERT(&layoutState().establishedFormattingState(layoutBox.formattingContextRoot()) == this);
</del><ins>+    ASSERT(&layoutState().formattingStateForFormattingContext(layoutBox.formattingContextRoot()) == this);
</ins><span class="cx">     // Anonymous text wrappers do not need to compute box geometry. They initiate inline runs.
</span><span class="cx">     ASSERT(!layoutBox.isInlineTextBox());
</span><span class="cx">     return layoutState().ensureGeometryForBox(layoutBox);
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutLayoutStatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/LayoutState.cpp (282349 => 282350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/LayoutState.cpp      2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/layout/LayoutState.cpp 2021-09-13 19:50:02 UTC (rev 282350)
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx"> 
</span><span class="cx"> FormattingState& LayoutState::formattingStateForBox(const Box& layoutBox) const
</span><span class="cx"> {
</span><del>-    return establishedFormattingState(layoutBox.formattingContextRoot());
</del><ins>+    return formattingStateForFormattingContext(layoutBox.formattingContextRoot());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool LayoutState::hasFormattingState(const ContainerBox& formattingContextRoot) const
</span><span class="lines">@@ -97,56 +97,57 @@
</span><span class="cx">         || m_flexFormattingStates.contains(&formattingContextRoot);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-FormattingState& LayoutState::establishedFormattingState(const ContainerBox& formattingContextRoot) const
</del><ins>+FormattingState& LayoutState::formattingStateForFormattingContext(const ContainerBox& formattingContextRoot) const
</ins><span class="cx"> {
</span><ins>+    ASSERT(formattingContextRoot.establishesFormattingContext());
</ins><span class="cx">     if (RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextIntegrationEnabled()) {
</span><span class="cx">         ASSERT(&formattingContextRoot == m_rootContainer.get());
</span><span class="cx">         return *m_rootInlineFormattingStateForIntegration;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (auto* formattingState = m_inlineFormattingStates.get(&formattingContextRoot))
-        return *formattingState;
</del><ins>+    if (formattingContextRoot.establishesInlineFormattingContext())
+        return formattingStateForInlineFormattingContext(formattingContextRoot);
</ins><span class="cx"> 
</span><del>-    if (auto* formattingState = m_blockFormattingStates.get(&formattingContextRoot))
-        return *formattingState;
</del><ins>+    if (formattingContextRoot.establishesBlockFormattingContext())
+        return formattingStateForBlockFormattingContext(formattingContextRoot);
</ins><span class="cx"> 
</span><del>-    if (auto* formattingState = m_tableFormattingStates.get(&formattingContextRoot))
-        return *formattingState;
</del><ins>+    if (formattingContextRoot.establishesTableFormattingContext())
+        return formattingStateForTableFormattingContext(formattingContextRoot);
</ins><span class="cx"> 
</span><del>-    if (auto* formattingState = m_flexFormattingStates.get(&formattingContextRoot))
-        return *formattingState;
</del><ins>+    if (formattingContextRoot.establishesFlexFormattingContext())
+        return formattingStateForFlexFormattingContext(formattingContextRoot);
</ins><span class="cx"> 
</span><span class="cx">     CRASH();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-InlineFormattingState& LayoutState::establishedInlineFormattingState(const ContainerBox& formattingContextRoot) const
</del><ins>+InlineFormattingState& LayoutState::formattingStateForInlineFormattingContext(const ContainerBox& inlineFormattingContextRoot) const
</ins><span class="cx"> {
</span><del>-    ASSERT(formattingContextRoot.establishesInlineFormattingContext());
</del><ins>+    ASSERT(inlineFormattingContextRoot.establishesInlineFormattingContext());
</ins><span class="cx"> 
</span><span class="cx">     if (RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextIntegrationEnabled()) {
</span><del>-        ASSERT(&formattingContextRoot == m_rootContainer.get());
</del><ins>+        ASSERT(&inlineFormattingContextRoot == m_rootContainer.get());
</ins><span class="cx">         return *m_rootInlineFormattingStateForIntegration;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return *m_inlineFormattingStates.get(&formattingContextRoot);
</del><ins>+    return *m_inlineFormattingStates.get(&inlineFormattingContextRoot);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-BlockFormattingState& LayoutState::establishedBlockFormattingState(const ContainerBox& formattingContextRoot) const
</del><ins>+BlockFormattingState& LayoutState::formattingStateForBlockFormattingContext(const ContainerBox& blockFormattingContextRoot) const
</ins><span class="cx"> {
</span><del>-    ASSERT(formattingContextRoot.establishesBlockFormattingContext());
-    return *m_blockFormattingStates.get(&formattingContextRoot);
</del><ins>+    ASSERT(blockFormattingContextRoot.establishesBlockFormattingContext());
+    return *m_blockFormattingStates.get(&blockFormattingContextRoot);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-TableFormattingState& LayoutState::establishedTableFormattingState(const ContainerBox& formattingContextRoot) const
</del><ins>+TableFormattingState& LayoutState::formattingStateForTableFormattingContext(const ContainerBox& tableFormattingContextRoot) const
</ins><span class="cx"> {
</span><del>-    ASSERT(formattingContextRoot.establishesTableFormattingContext());
-    return *m_tableFormattingStates.get(&formattingContextRoot);
</del><ins>+    ASSERT(tableFormattingContextRoot.establishesTableFormattingContext());
+    return *m_tableFormattingStates.get(&tableFormattingContextRoot);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-FlexFormattingState& LayoutState::establishedFlexFormattingState(const ContainerBox& formattingContextRoot) const
</del><ins>+FlexFormattingState& LayoutState::formattingStateForFlexFormattingContext(const ContainerBox& flexFormattingContextRoot) const
</ins><span class="cx"> {
</span><del>-    ASSERT(formattingContextRoot.establishesFlexFormattingContext());
-    return *m_flexFormattingStates.get(&formattingContextRoot);
</del><ins>+    ASSERT(flexFormattingContextRoot.establishesFlexFormattingContext());
+    return *m_flexFormattingStates.get(&flexFormattingContextRoot);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> InlineFormattingState& LayoutState::ensureInlineFormattingState(const ContainerBox& formattingContextRoot)
</span><span class="lines">@@ -162,7 +163,8 @@
</span><span class="cx"> 
</span><span class="cx">         // Otherwise, the formatting context inherits the floats from the parent formatting context.
</span><span class="cx">         // Find the formatting state in which this formatting root lives, not the one it creates and use its floating state.
</span><del>-        auto& parentFormattingState = establishedBlockFormattingState(formattingContextRoot.formattingContextRoot());
</del><ins>+        ASSERT(formattingContextRoot.formattingContextRoot().establishesBlockFormattingContext());
+        auto& parentFormattingState = formattingStateForBlockFormattingContext(formattingContextRoot.formattingContextRoot());
</ins><span class="cx">         auto& parentFloatingState = parentFormattingState.floatingState();
</span><span class="cx">         return makeUnique<InlineFormattingState>(parentFloatingState, *this);
</span><span class="cx">     };
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutLayoutStateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/LayoutState.h (282349 => 282350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/LayoutState.h        2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/layout/LayoutState.h   2021-09-13 19:50:02 UTC (rev 282350)
</span><span class="lines">@@ -57,12 +57,12 @@
</span><span class="cx">     TableFormattingState& ensureTableFormattingState(const ContainerBox& formattingContextRoot);
</span><span class="cx">     FlexFormattingState& ensureFlexFormattingState(const ContainerBox& formattingContextRoot);
</span><span class="cx"> 
</span><del>-    FormattingState& establishedFormattingState(const ContainerBox& formattingRoot) const;
-    InlineFormattingState& establishedInlineFormattingState(const ContainerBox& formattingContextRoot) const;
-    BlockFormattingState& establishedBlockFormattingState(const ContainerBox& formattingContextRoot) const;
-    TableFormattingState& establishedTableFormattingState(const ContainerBox& formattingContextRoot) const;
-    FlexFormattingState& establishedFlexFormattingState(const ContainerBox& formattingContextRoot) const;
</del><ins>+    InlineFormattingState& formattingStateForInlineFormattingContext(const ContainerBox& inlineFormattingContextRoot) const;
+    BlockFormattingState& formattingStateForBlockFormattingContext(const ContainerBox& blockFormattingContextRoot) const;
+    TableFormattingState& formattingStateForTableFormattingContext(const ContainerBox& tableFormattingContextRoot) const;
+    FlexFormattingState& formattingStateForFlexFormattingContext(const ContainerBox& flexFormattingContextRoot) const;
</ins><span class="cx"> 
</span><ins>+    FormattingState& formattingStateForFormattingContext(const ContainerBox& formattingRoot) const;
</ins><span class="cx">     FormattingState& formattingStateForBox(const Box&) const;
</span><span class="cx"> 
</span><span class="cx">     bool hasFormattingState(const ContainerBox& formattingRoot) const;
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutVerificationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/Verification.cpp (282349 => 282350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/Verification.cpp     2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/layout/Verification.cpp        2021-09-13 19:50:02 UTC (rev 282350)
</span><span class="lines">@@ -117,7 +117,7 @@
</span><span class="cx"> 
</span><span class="cx"> static bool outputMismatchingComplexLineInformationIfNeeded(TextStream& stream, const LayoutState& layoutState, const RenderBlockFlow& blockFlow, const ContainerBox& inlineFormattingRoot)
</span><span class="cx"> {
</span><del>-    auto& inlineFormattingState = layoutState.establishedFormattingState(inlineFormattingRoot);
</del><ins>+    auto& inlineFormattingState = layoutState.formattingStateForFormattingContext(inlineFormattingRoot);
</ins><span class="cx">     auto& runs = downcast<InlineFormattingState>(inlineFormattingState).runs();
</span><span class="cx">     // Collect inlineboxes.
</span><span class="cx">     Vector<WebCore::LegacyInlineBox*> inlineBoxes;
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutformattingContextsFormattingGeometrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/formattingContexts/FormattingGeometry.cpp (282349 => 282350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/formattingContexts/FormattingGeometry.cpp    2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/layout/formattingContexts/FormattingGeometry.cpp       2021-09-13 19:50:02 UTC (rev 282350)
</span><span class="lines">@@ -149,7 +149,7 @@
</span><span class="cx">             ASSERT(containerBox.establishesFormattingContext());
</span><span class="cx">             auto& layoutState = this->layoutState();
</span><span class="cx">             if (layoutState.hasFormattingState(containerBox)) {
</span><del>-                if (auto intrinsicWidthConstraints = layoutState.establishedFormattingState(containerBox).intrinsicWidthConstraints())
</del><ins>+                if (auto intrinsicWidthConstraints = layoutState.formattingStateForFormattingContext(containerBox).intrinsicWidthConstraints())
</ins><span class="cx">                     return *intrinsicWidthConstraints;
</span><span class="cx">             }
</span><span class="cx">             return LayoutContext::createFormattingContext(containerBox, const_cast<LayoutState&>(layoutState))->computedIntrinsicWidthConstraints();
</span><span class="lines">@@ -313,7 +313,7 @@
</span><span class="cx">         auto& layoutState = this->layoutState();
</span><span class="cx">         auto& root = downcast<ContainerBox>(formattingContextRoot);
</span><span class="cx">         if (layoutState.hasFormattingState(root)) {
</span><del>-            if (auto intrinsicWidthConstraints = layoutState.establishedFormattingState(root).intrinsicWidthConstraints())
</del><ins>+            if (auto intrinsicWidthConstraints = layoutState.formattingStateForFormattingContext(root).intrinsicWidthConstraints())
</ins><span class="cx">                 return *intrinsicWidthConstraints;
</span><span class="cx">         }
</span><span class="cx">         return LayoutContext::createFormattingContext(root, const_cast<LayoutState&>(layoutState))->computedIntrinsicWidthConstraints();
</span><span class="lines">@@ -798,7 +798,7 @@
</span><span class="cx">             // This is a special (quirk?) behavior since the document box is not a formatting context root and
</span><span class="cx">             // all the float boxes end up at the ICB level.
</span><span class="cx">             auto& initialContainingBlock = documentBox.formattingContextRoot();
</span><del>-            auto floatingContext = FloatingContext { formattingContext(), layoutState().establishedFormattingState(initialContainingBlock).floatingState() };
</del><ins>+            auto floatingContext = FloatingContext { formattingContext(), layoutState().formattingStateForFormattingContext(initialContainingBlock).floatingState() };
</ins><span class="cx">             if (auto floatBottom = floatingContext.bottom()) {
</span><span class="cx">                 bottom = std::max<LayoutUnit>(*floatBottom, bottom);
</span><span class="cx">                 auto floatTop = floatingContext.top();
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutformattingContextsblockBlockFormattingGeometrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/formattingContexts/block/BlockFormattingGeometry.cpp (282349 => 282350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/formattingContexts/block/BlockFormattingGeometry.cpp 2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/layout/formattingContexts/block/BlockFormattingGeometry.cpp    2021-09-13 19:50:02 UTC (rev 282350)
</span><span class="lines">@@ -83,7 +83,7 @@
</span><span class="cx">         // 1. the bottom edge of the last line box, if the box establishes a inline formatting context with one or more lines
</span><span class="cx">         auto& layoutContainer = downcast<ContainerBox>(layoutBox);
</span><span class="cx">         if (layoutContainer.establishesInlineFormattingContext()) {
</span><del>-            auto& inlineFormattingState = layoutState().establishedInlineFormattingState(layoutContainer);
</del><ins>+            auto& inlineFormattingState = layoutState().formattingStateForInlineFormattingContext(layoutContainer);
</ins><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></span></pre></div>
<a id="trunkSourceWebCorelayoutformattingContextsblockBlockMarginCollapsecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/formattingContexts/block/BlockMarginCollapse.cpp (282349 => 282350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/formattingContexts/block/BlockMarginCollapse.cpp     2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/layout/formattingContexts/block/BlockMarginCollapse.cpp        2021-09-13 19:50:02 UTC (rev 282350)
</span><span class="lines">@@ -413,7 +413,7 @@
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><span class="cx">             auto isConsideredEmpty = [&] {
</span><del>-                auto& inlineFormattingState = layoutState.establishedInlineFormattingState(containerBox);
</del><ins>+                auto& inlineFormattingState = layoutState.formattingStateForInlineFormattingContext(containerBox);
</ins><span class="cx">                 if (!inlineFormattingState.lines().isEmpty())
</span><span class="cx">                     return false;
</span><span class="cx">                 // Any float box in this formatting context prevents collapsing through.
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutformattingContextsblocktablewrapperTableWrapperBlockFormattingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.cpp (282349 => 282350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.cpp 2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.cpp    2021-09-13 19:50:02 UTC (rev 282350)
</span><span class="lines">@@ -101,7 +101,7 @@
</span><span class="cx">     // borders with the top border of the table. The top border width of the table is equal to half of the
</span><span class="cx">     // maximum collapsed top border. The bottom border width is computed by examining all cells whose bottom borders collapse
</span><span class="cx">     // with the bottom of the table. The bottom border width is equal to half of the maximum collapsed bottom border.
</span><del>-    auto& grid = layoutState().establishedTableFormattingState(tableBox).tableGrid();
</del><ins>+    auto& grid = layoutState().formattingStateForTableFormattingContext(tableBox).tableGrid();
</ins><span class="cx">     auto tableBorder = formattingGeometry().computedBorder(tableBox);
</span><span class="cx"> 
</span><span class="cx">     auto& firstColumnFirstRowBox = grid.slot({ 0 , 0 })->cell().box();
</span><span class="lines">@@ -151,7 +151,7 @@
</span><span class="cx">     ASSERT(tableBox.isTableBox());
</span><span class="cx">     // This is a special table "fit-content size" behavior handling. Not in the spec though.
</span><span class="cx">     // Table returns its final width as min/max. Use this final width value to computed horizontal margins etc.
</span><del>-    auto& formattingStateForTableBox = layoutState().establishedTableFormattingState(tableBox);
</del><ins>+    auto& formattingStateForTableBox = layoutState().formattingStateForTableFormattingContext(tableBox);
</ins><span class="cx">     auto intrinsicWidthConstraints = IntrinsicWidthConstraints { };
</span><span class="cx">     if (auto precomputedIntrinsicWidthConstraints = formattingStateForTableBox.intrinsicWidthConstraints())
</span><span class="cx">         intrinsicWidthConstraints = *precomputedIntrinsicWidthConstraints;
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutformattingContextsinlineInlineLineBoxBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp (282349 => 282350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp   2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp      2021-09-13 19:50:02 UTC (rev 282350)
</span><span class="lines">@@ -278,7 +278,7 @@
</span><span class="cx">                 if (synthesizeBaseline)
</span><span class="cx">                     ascent = marginBoxHeight;
</span><span class="cx">                 else {
</span><del>-                    auto& formattingState = layoutState().establishedInlineFormattingState(downcast<ContainerBox>(layoutBox));
</del><ins>+                    auto& formattingState = layoutState().formattingStateForInlineFormattingContext(downcast<ContainerBox>(layoutBox));
</ins><span class="cx">                     auto& lastLine = formattingState.lines().last();
</span><span class="cx">                     auto inlineBlockBaseline = lastLine.lineBoxLogicalRect().top() + lastLine.baseline();
</span><span class="cx">                     ascent = inlineLevelBoxGeometry.marginBefore() + inlineLevelBoxGeometry.borderTop() + inlineLevelBoxGeometry.paddingTop().value_or(0) + inlineBlockBaseline;
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutformattingContextstableTableFormattingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingContext.cpp (282349 => 282350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingContext.cpp  2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingContext.cpp     2021-09-13 19:50:02 UTC (rev 282350)
</span><span class="lines">@@ -154,7 +154,7 @@
</span><span class="cx">                     // Normally by the time we start positioning the child content, we already have computed borders and padding for the containing block.
</span><span class="cx">                     // This is different with table cells where the final padding offset depends on the content height as we use
</span><span class="cx">                     // the padding box to vertically align the table cell content.
</span><del>-                    auto& formattingState = layoutState().establishedFormattingState(cellBox);
</del><ins>+                    auto& formattingState = layoutState().formattingStateForFormattingContext(cellBox);
</ins><span class="cx">                     for (auto* child = cellBox.firstInFlowOrFloatingChild(); child; child = child->nextInFlowOrFloatingSibling()) {
</span><span class="cx">                         if (child->isInlineTextBox())
</span><span class="cx">                             continue;
</span><span class="lines">@@ -161,7 +161,7 @@
</span><span class="cx">                         formattingState.boxGeometry(*child).moveVertically(intrinsicPaddingTop);
</span><span class="cx">                     }
</span><span class="cx">                     if (cellBox.establishesInlineFormattingContext()) {
</span><del>-                        auto& inlineFormattingStatee = layoutState().establishedInlineFormattingState(cellBox);
</del><ins>+                        auto& inlineFormattingStatee = layoutState().formattingStateForInlineFormattingContext(cellBox);
</ins><span class="cx">                         for (auto& run : inlineFormattingStatee.runs())
</span><span class="cx">                             run.moveVertically(intrinsicPaddingTop);
</span><span class="cx">                         for (auto& line : inlineFormattingStatee.lines())
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutformattingContextstableTableFormattingGeometrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingGeometry.cpp (282349 => 282350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingGeometry.cpp 2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingGeometry.cpp    2021-09-13 19:50:02 UTC (rev 282350)
</span><span class="lines">@@ -133,15 +133,15 @@
</span><span class="cx">     // or the first in-flow table-row in the cell, whichever comes first.
</span><span class="cx">     // If there is no such line box, the baseline is the bottom of content edge of the cell box.
</span><span class="cx">     if (cellBox.establishesInlineFormattingContext())
</span><del>-        return layoutState().establishedInlineFormattingState(cellBox).lines()[0].baseline();
</del><ins>+        return layoutState().formattingStateForInlineFormattingContext(cellBox).lines()[0].baseline();
</ins><span class="cx">     for (auto& cellDescendant : descendantsOfType<ContainerBox>(cellBox)) {
</span><span class="cx">         if (cellDescendant.establishesInlineFormattingContext()) {
</span><del>-            auto& inlineFormattingStateForCell = layoutState().establishedInlineFormattingState(cellDescendant);
</del><ins>+            auto& inlineFormattingStateForCell = layoutState().formattingStateForInlineFormattingContext(cellDescendant);
</ins><span class="cx">             if (!inlineFormattingStateForCell.lines().isEmpty())
</span><span class="cx">                 return inlineFormattingStateForCell.lines()[0].baseline();
</span><span class="cx">         }
</span><span class="cx">         if (cellDescendant.establishesTableFormattingContext())
</span><del>-            return layoutState().establishedTableFormattingState(cellDescendant).tableGrid().rows().list()[0].baseline();
</del><ins>+            return layoutState().formattingStateForTableFormattingContext(cellDescendant).tableGrid().rows().list()[0].baseline();
</ins><span class="cx">     }
</span><span class="cx">     return formattingContext().geometryForBox(cellBox).contentBoxBottom();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutlayouttreeLayoutTreeBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp (282349 => 282350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp     2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp        2021-09-13 19:50:02 UTC (rev 282350)
</span><span class="lines">@@ -383,7 +383,7 @@
</span><span class="cx"> #if ENABLE(TREE_DEBUGGING)
</span><span class="cx"> void showInlineTreeAndRuns(TextStream& stream, const LayoutState& layoutState, const ContainerBox& inlineFormattingRoot, size_t depth)
</span><span class="cx"> {
</span><del>-    auto& inlineFormattingState = layoutState.establishedInlineFormattingState(inlineFormattingRoot);
</del><ins>+    auto& inlineFormattingState = layoutState.formattingStateForInlineFormattingContext(inlineFormattingRoot);
</ins><span class="cx">     auto& lines = inlineFormattingState.lines();
</span><span class="cx">     auto& runs = inlineFormattingState.runs();
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>