Diff
Modified: trunk/Source/WebCore/ChangeLog (254874 => 254875)
--- trunk/Source/WebCore/ChangeLog 2020-01-21 21:07:52 UTC (rev 254874)
+++ trunk/Source/WebCore/ChangeLog 2020-01-21 21:08:55 UTC (rev 254875)
@@ -1,3 +1,57 @@
+2020-01-21 Antti Koivisto <[email protected]>
+
+ [LFC] Typed accessors for formatting states
+ https://bugs.webkit.org/show_bug.cgi?id=206538
+
+ Reviewed by Zalan Bujtas.
+
+ Almost all clients know what sort of formatting state they want and immediately cast it.
+
+ * layout/FormattingContextGeometry.cpp:
+ (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
+ (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
+ * layout/LayoutContext.cpp:
+ (WebCore::Layout::LayoutContext::createFormattingContext):
+ * layout/LayoutState.cpp:
+ (WebCore::Layout::LayoutState::formattingStateForBox const):
+ (WebCore::Layout::LayoutState::establishedFormattingState const):
+ (WebCore::Layout::LayoutState::establishedInlineFormattingState const):
+ (WebCore::Layout::LayoutState::establishedBlockFormattingState const):
+ (WebCore::Layout::LayoutState::establishedTableFormattingState const):
+
+ Typed function for getting established states.
+
+ (WebCore::Layout::LayoutState::ensureFormattingState):
+ (WebCore::Layout::LayoutState::ensureInlineFormattingState):
+
+ Also add a fast path for integrated layout.
+
+ (WebCore::Layout::LayoutState::ensureBlockFormattingState):
+ (WebCore::Layout::LayoutState::ensureTableFormattingState):
+
+ Typed function for creating states.
+
+ (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded): Deleted.
+ * layout/LayoutState.h:
+ (WebCore::Layout::LayoutState::hasInlineFormattingState const):
+ (WebCore::Layout::LayoutState::hasFormattingState const): Deleted.
+ * layout/blockformatting/BlockFormattingContextGeometry.cpp:
+ (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
+ * layout/blockformatting/BlockMarginCollapse.cpp:
+ (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const):
+ * layout/displaytree/DisplayPainter.cpp:
+ (WebCore::Display::paintSubtree):
+ (WebCore::Display::Painter::paintInlineFlow):
+ * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
+ (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
+ * layout/inlineformatting/InlineLineBuilder.cpp:
+ (WebCore::Layout::LineBuilder::alignContentVertically):
+ (WebCore::Layout::LineBuilder::adjustBaselineAndLineHeight):
+ * layout/integration/LayoutIntegrationLineLayout.cpp:
+ (WebCore::LayoutIntegration::LineLayout::LineLayout):
+ * layout/layouttree/LayoutTreeBuilder.cpp:
+ (WebCore::Layout::outputInlineRuns):
+
2020-01-21 Justin Fan <[email protected]>
[WebGL2] Sampler objects
Modified: trunk/Source/WebCore/layout/FormattingContextGeometry.cpp (254874 => 254875)
--- trunk/Source/WebCore/layout/FormattingContextGeometry.cpp 2020-01-21 21:07:52 UTC (rev 254874)
+++ trunk/Source/WebCore/layout/FormattingContextGeometry.cpp 2020-01-21 21:08:55 UTC (rev 254875)
@@ -133,7 +133,7 @@
auto bottom = borderAndPaddingTop;
auto& formattingRootContainer = downcast<Container>(layoutBox);
if (formattingRootContainer.establishesInlineFormattingContext()) {
- auto& lineBoxes = downcast<InlineFormattingState>(layoutState.establishedFormattingState(formattingRootContainer)).displayInlineContent()->lineBoxes;
+ auto& lineBoxes = layoutState.establishedInlineFormattingState(formattingRootContainer).displayInlineContent()->lineBoxes;
// Even empty containers generate one line.
ASSERT(!lineBoxes.isEmpty());
top = lineBoxes.first().logicalTop();
@@ -287,7 +287,7 @@
auto intrinsicWidthConstraints = IntrinsicWidthConstraints { };
if (is<Container>(formattingRoot)) {
auto& root = downcast<Container>(formattingRoot);
- auto& formattingStateForRoot = layoutState().createFormattingStateForFormattingRootIfNeeded(root);
+ auto& formattingStateForRoot = layoutState().ensureFormattingState(root);
auto precomputedIntrinsicWidthConstraints = formattingStateForRoot.intrinsicWidthConstraints();
if (!precomputedIntrinsicWidthConstraints)
intrinsicWidthConstraints = LayoutContext::createFormattingContext(root, layoutState())->computedIntrinsicWidthConstraints();
Modified: trunk/Source/WebCore/layout/LayoutContext.cpp (254874 => 254875)
--- trunk/Source/WebCore/layout/LayoutContext.cpp 2020-01-21 21:07:52 UTC (rev 254874)
+++ trunk/Source/WebCore/layout/LayoutContext.cpp 2020-01-21 21:08:55 UTC (rev 254875)
@@ -113,18 +113,18 @@
{
ASSERT(formattingContextRoot.establishesFormattingContext());
if (formattingContextRoot.establishesInlineFormattingContext()) {
- auto& inlineFormattingState = downcast<InlineFormattingState>(layoutState.createFormattingStateForFormattingRootIfNeeded(formattingContextRoot));
+ auto& inlineFormattingState = layoutState.ensureInlineFormattingState(formattingContextRoot);
return makeUnique<InlineFormattingContext>(formattingContextRoot, inlineFormattingState);
}
if (formattingContextRoot.establishesBlockFormattingContext()) {
ASSERT(formattingContextRoot.establishesBlockFormattingContextOnly());
- auto& blockFormattingState = downcast<BlockFormattingState>(layoutState.createFormattingStateForFormattingRootIfNeeded(formattingContextRoot));
+ auto& blockFormattingState = layoutState.ensureBlockFormattingState(formattingContextRoot);
return makeUnique<BlockFormattingContext>(formattingContextRoot, blockFormattingState);
}
if (formattingContextRoot.establishesTableFormattingContext()) {
- auto& tableFormattingState = downcast<TableFormattingState>(layoutState.createFormattingStateForFormattingRootIfNeeded(formattingContextRoot));
+ auto& tableFormattingState = layoutState.ensureTableFormattingState(formattingContextRoot);
return makeUnique<TableFormattingContext>(formattingContextRoot, tableFormattingState);
}
Modified: trunk/Source/WebCore/layout/LayoutState.cpp (254874 => 254875)
--- trunk/Source/WebCore/layout/LayoutState.cpp 2020-01-21 21:07:52 UTC (rev 254874)
+++ trunk/Source/WebCore/layout/LayoutState.cpp 2020-01-21 21:08:55 UTC (rev 254875)
@@ -84,67 +84,113 @@
FormattingState& LayoutState::formattingStateForBox(const Box& layoutBox) const
{
- auto& root = layoutBox.formattingContextRoot();
- RELEASE_ASSERT(m_formattingStates.contains(&root));
- return *m_formattingStates.get(&root);
+ return establishedFormattingState(layoutBox.formattingContextRoot());
}
-FormattingState& LayoutState::establishedFormattingState(const Container& formattingRoot) const
+FormattingState& LayoutState::establishedFormattingState(const Container& formattingContextRoot) const
{
- ASSERT(formattingRoot.establishesFormattingContext());
- RELEASE_ASSERT(m_formattingStates.contains(&formattingRoot));
- return *m_formattingStates.get(&formattingRoot);
+ if (RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextIntegrationEnabled()) {
+ ASSERT(&formattingContextRoot == m_rootContainer.get());
+ return *m_rootInlineFormattingStateForIntegration;
+ }
+
+ if (auto* formattingState = m_inlineFormattingStates.get(&formattingContextRoot))
+ return *formattingState;
+
+ if (auto* formattingState = m_blockFormattingStates.get(&formattingContextRoot))
+ return *formattingState;
+
+ ASSERT(m_tableFormattingStates.contains(&formattingContextRoot));
+ return *m_tableFormattingStates.get(&formattingContextRoot);
}
-FormattingState& LayoutState::createFormattingStateForFormattingRootIfNeeded(const Container& formattingContextRoot)
+InlineFormattingState& LayoutState::establishedInlineFormattingState(const Container& formattingContextRoot) const
{
- ASSERT(formattingContextRoot.establishesFormattingContext());
+ ASSERT(formattingContextRoot.establishesInlineFormattingContext());
- if (formattingContextRoot.establishesInlineFormattingContext()) {
- return *m_formattingStates.ensure(&formattingContextRoot, [&] {
+ if (RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextIntegrationEnabled()) {
+ ASSERT(&formattingContextRoot == m_rootContainer.get());
+ return *m_rootInlineFormattingStateForIntegration;
+ }
- // If the block container box that initiates this inline formatting context also establishes a block context, the floats outside of the formatting root
- // should not interfere with the content inside.
- // <div style="float: left"></div><div style="overflow: hidden"> <- is a non-intrusive float, because overflow: hidden triggers new block formatting context.</div>
- if (formattingContextRoot.establishesBlockFormattingContext()) {
- auto formattingState = makeUnique<InlineFormattingState>(FloatingState::create(*this, formattingContextRoot), *this);
- m_inlineFormattingStates.append(WTFMove(formattingState));
- return m_inlineFormattingStates.last().get();
- }
+ return *m_inlineFormattingStates.get(&formattingContextRoot);
+}
- // Otherwise, the formatting context inherits the floats from the parent formatting context.
- // Find the formatting state in which this formatting root lives, not the one it creates and use its floating state.
- auto& parentFormattingState = createFormattingStateForFormattingRootIfNeeded(formattingContextRoot.formattingContextRoot());
- auto& parentFloatingState = parentFormattingState.floatingState();
- auto formattingState = makeUnique<InlineFormattingState>(parentFloatingState, *this);
- m_inlineFormattingStates.append(WTFMove(formattingState));
- return m_inlineFormattingStates.last().get();
- }).iterator->value;
- }
+BlockFormattingState& LayoutState::establishedBlockFormattingState(const Container& formattingContextRoot) const
+{
+ ASSERT(formattingContextRoot.establishesBlockFormattingContext());
+ return *m_blockFormattingStates.get(&formattingContextRoot);
+}
- if (formattingContextRoot.establishesBlockFormattingContext()) {
- return *m_formattingStates.ensure(&formattingContextRoot, [&] {
+TableFormattingState& LayoutState::establishedTableFormattingState(const Container& formattingContextRoot) const
+{
+ ASSERT(formattingContextRoot.establishesTableFormattingContext());
+ return *m_tableFormattingStates.get(&formattingContextRoot);
+}
- // Block formatting context always establishes a new floating state.
- auto formattingState = makeUnique<BlockFormattingState>(FloatingState::create(*this, formattingContextRoot), *this);
- m_blockFormattingStates.append(WTFMove(formattingState));
- return m_blockFormattingStates.last().get();
- }).iterator->value;
- }
+FormattingState& LayoutState::ensureFormattingState(const Container& formattingContextRoot)
+{
+ if (formattingContextRoot.establishesInlineFormattingContext())
+ return ensureInlineFormattingState(formattingContextRoot);
- if (formattingContextRoot.establishesTableFormattingContext()) {
- return *m_formattingStates.ensure(&formattingContextRoot, [&] {
+ if (formattingContextRoot.establishesBlockFormattingContext())
+ return ensureBlockFormattingState(formattingContextRoot);
- // Table formatting context always establishes a new floating state -and it stays empty.
- auto formattingState = makeUnique<TableFormattingState>(FloatingState::create(*this, formattingContextRoot), *this);
- m_tableFormattingStates.append(WTFMove(formattingState));
- return m_tableFormattingStates.last().get();
- }).iterator->value;
+ return ensureTableFormattingState(formattingContextRoot);
+}
+
+InlineFormattingState& LayoutState::ensureInlineFormattingState(const Container& formattingContextRoot)
+{
+ ASSERT(formattingContextRoot.establishesInlineFormattingContext());
+
+ auto create = [&] {
+ // If the block container box that initiates this inline formatting context also establishes a block context, the floats outside of the formatting root
+ // should not interfere with the content inside.
+ // <div style="float: left"></div><div style="overflow: hidden"> <- is a non-intrusive float, because overflow: hidden triggers new block formatting context.</div>
+ if (formattingContextRoot.establishesBlockFormattingContext())
+ return makeUnique<InlineFormattingState>(FloatingState::create(*this, formattingContextRoot), *this);
+
+ // Otherwise, the formatting context inherits the floats from the parent formatting context.
+ // Find the formatting state in which this formatting root lives, not the one it creates and use its floating state.
+ auto& parentFormattingState = ensureFormattingState(formattingContextRoot.formattingContextRoot());
+ auto& parentFloatingState = parentFormattingState.floatingState();
+ return makeUnique<InlineFormattingState>(parentFloatingState, *this);
+ };
+
+ if (RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextIntegrationEnabled()) {
+ if (!m_rootInlineFormattingStateForIntegration) {
+ ASSERT(&formattingContextRoot == m_rootContainer.get());
+ m_rootInlineFormattingStateForIntegration = create();
+ }
+ return *m_rootInlineFormattingStateForIntegration;
}
- CRASH();
+ return *m_inlineFormattingStates.ensure(&formattingContextRoot, create).iterator->value;
}
+BlockFormattingState& LayoutState::ensureBlockFormattingState(const Container& formattingContextRoot)
+{
+ ASSERT(formattingContextRoot.establishesBlockFormattingContext());
+
+ auto create = [&] {
+ return makeUnique<BlockFormattingState>(FloatingState::create(*this, formattingContextRoot), *this);
+ };
+
+ return *m_blockFormattingStates.ensure(&formattingContextRoot, create).iterator->value;
+}
+
+TableFormattingState& LayoutState::ensureTableFormattingState(const Container& formattingContextRoot)
+{
+ ASSERT(formattingContextRoot.establishesTableFormattingContext());
+
+ auto create = [&] {
+ // Table formatting context always establishes a new floating state -and it stays empty.
+ return makeUnique<TableFormattingState>(FloatingState::create(*this, formattingContextRoot), *this);
+ };
+
+ return *m_tableFormattingStates.ensure(&formattingContextRoot, create).iterator->value;
+}
+
void LayoutState::setViewportSize(const LayoutSize& viewportSize)
{
ASSERT(RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextIntegrationEnabled());
Modified: trunk/Source/WebCore/layout/LayoutState.h (254874 => 254875)
--- trunk/Source/WebCore/layout/LayoutState.h 2020-01-21 21:07:52 UTC (rev 254874)
+++ trunk/Source/WebCore/layout/LayoutState.h 2020-01-21 21:08:55 UTC (rev 254875)
@@ -53,10 +53,18 @@
LayoutState(const Document&, const Container& rootContainer);
~LayoutState();
- FormattingState& createFormattingStateForFormattingRootIfNeeded(const Container& formattingContextRoot);
+ FormattingState& ensureFormattingState(const Container& formattingContextRoot);
+ InlineFormattingState& ensureInlineFormattingState(const Container& formattingContextRoot);
+ BlockFormattingState& ensureBlockFormattingState(const Container& formattingContextRoot);
+ TableFormattingState& ensureTableFormattingState(const Container& formattingContextRoot);
+
FormattingState& establishedFormattingState(const Container& formattingRoot) const;
+ InlineFormattingState& establishedInlineFormattingState(const Container& formattingContextRoot) const;
+ BlockFormattingState& establishedBlockFormattingState(const Container& formattingContextRoot) const;
+ TableFormattingState& establishedTableFormattingState(const Container& formattingContextRoot) const;
+
FormattingState& formattingStateForBox(const Box&) const;
- bool hasFormattingState(const Container& formattingRoot) const { return m_formattingStates.contains(&formattingRoot); }
+ bool hasInlineFormattingState(const Container& formattingRoot) const { return m_inlineFormattingStates.contains(&formattingRoot); }
#ifndef NDEBUG
void registerFormattingContext(const FormattingContext&);
@@ -86,11 +94,12 @@
void setQuirksMode(QuirksMode quirksMode) { m_quirksMode = quirksMode; }
Display::Box& ensureDisplayBoxForLayoutBoxSlow(const Box&);
- Vector<std::unique_ptr<InlineFormattingState>, 1> m_inlineFormattingStates;
- Vector<std::unique_ptr<BlockFormattingState>, 1> m_blockFormattingStates;
- Vector<std::unique_ptr<TableFormattingState>> m_tableFormattingStates;
+ HashMap<const Container*, std::unique_ptr<InlineFormattingState>> m_inlineFormattingStates;
+ HashMap<const Container*, std::unique_ptr<BlockFormattingState>> m_blockFormattingStates;
+ HashMap<const Container*, std::unique_ptr<TableFormattingState>> m_tableFormattingStates;
- HashMap<const Container*, FormattingState*> m_formattingStates;
+ std::unique_ptr<InlineFormattingState> m_rootInlineFormattingStateForIntegration;
+
#ifndef NDEBUG
HashSet<const FormattingContext*> m_formattingContextList;
#endif
Modified: trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp (254874 => 254875)
--- trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp 2020-01-21 21:07:52 UTC (rev 254874)
+++ trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp 2020-01-21 21:08:55 UTC (rev 254875)
@@ -74,7 +74,7 @@
// 1. the bottom edge of the last line box, if the box establishes a inline formatting context with one or more lines
auto& layoutContainer = downcast<Container>(layoutBox);
if (layoutContainer.establishesInlineFormattingContext()) {
- auto& lineBoxes = downcast<InlineFormattingState>(layoutState().establishedFormattingState(layoutContainer)).displayInlineContent()->lineBoxes;
+ auto& lineBoxes = layoutState().establishedInlineFormattingState(layoutContainer).displayInlineContent()->lineBoxes;
// Even empty containers generate one line.
ASSERT(!lineBoxes.isEmpty());
return { toLayoutUnit(lineBoxes.last().logicalBottom()) - borderAndPaddingTop, nonCollapsedMargin };
Modified: trunk/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp (254874 => 254875)
--- trunk/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp 2020-01-21 21:07:52 UTC (rev 254874)
+++ trunk/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp 2020-01-21 21:08:55 UTC (rev 254875)
@@ -392,11 +392,11 @@
// If we get here through margin estimation, we don't necessarily have an actual state for this layout box since
// we haven't started laying it out yet.
auto& layoutContainer = downcast<Container>(layoutBox);
- if (!layoutState.hasFormattingState(layoutContainer))
+ if (!layoutState.hasInlineFormattingState(layoutContainer))
return false;
auto isConsideredEmpty = [&] {
- auto& formattingState = downcast<InlineFormattingState>(layoutState.establishedFormattingState(layoutContainer));
+ auto& formattingState = layoutState.establishedInlineFormattingState(layoutContainer);
if (auto* inlineContent = formattingState.displayInlineContent()) {
for (auto& lineBox : inlineContent->lineBoxes) {
if (!lineBox.isConsideredEmpty())
Modified: trunk/Source/WebCore/layout/displaytree/DisplayPainter.cpp (254874 => 254875)
--- trunk/Source/WebCore/layout/displaytree/DisplayPainter.cpp 2020-01-21 21:07:52 UTC (rev 254874)
+++ trunk/Source/WebCore/layout/displaytree/DisplayPainter.cpp 2020-01-21 21:08:55 UTC (rev 254875)
@@ -183,7 +183,7 @@
// Only inline content for now.
if (layoutBox.establishesInlineFormattingContext()) {
auto& container = downcast<Layout::Container>(layoutBox);
- paintInlineContent(context, absoluteDisplayBox.topLeft(), downcast<Layout::InlineFormattingState>(layoutState.establishedFormattingState(container)));
+ paintInlineContent(context, absoluteDisplayBox.topLeft(), layoutState.establishedInlineFormattingState(container));
}
};
@@ -292,7 +292,7 @@
ASSERT(layoutRoot.establishesInlineFormattingContext());
- paintInlineContent(context, { }, downcast<Layout::InlineFormattingState>(layoutState.establishedFormattingState(layoutRoot)));
+ paintInlineContent(context, { }, layoutState.establishedInlineFormattingState(layoutRoot));
}
}
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextQuirks.cpp (254874 => 254875)
--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextQuirks.cpp 2020-01-21 21:07:52 UTC (rev 254874)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextQuirks.cpp 2020-01-21 21:08:55 UTC (rev 254875)
@@ -59,7 +59,7 @@
}
if (run.isBox()) {
if (layoutBox.isInlineBlockBox() && layoutBox.establishesInlineFormattingContext()) {
- auto& formattingState = downcast<InlineFormattingState>(layoutState.establishedFormattingState(downcast<Container>(layoutBox)));
+ auto& formattingState = layoutState.establishedInlineFormattingState(downcast<Container>(layoutBox));
auto inlineBlockBaseline = formattingState.displayInlineContent()->lineBoxes.last().baseline();
if (inlineBlockBaseline.descent())
return false;
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp (254874 => 254875)
--- trunk/Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp 2020-01-21 21:07:52 UTC (rev 254874)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp 2020-01-21 21:08:55 UTC (rev 254875)
@@ -155,7 +155,7 @@
auto& boxGeometry = formattingContext().geometryForBox(layoutBox);
logicalTop = baselineOffset() - ascent - boxGeometry.borderTop() - boxGeometry.paddingTop().valueOr(0);
} else if (layoutBox.isInlineBlockBox() && layoutBox.establishesInlineFormattingContext()) {
- auto& formattingState = downcast<InlineFormattingState>(layoutState().establishedFormattingState(downcast<Container>(layoutBox)));
+ auto& formattingState = layoutState().establishedInlineFormattingState(downcast<Container>(layoutBox));
// Spec makes us generate at least one line -even if it is empty.
auto inlineBlockBaselineOffset = formattingState.displayInlineContent()->lineBoxes.last().baselineOffset();
// The inline-block's baseline offset is relative to its content box. Let's convert it relative to the margin box.
@@ -565,7 +565,7 @@
case VerticalAlign::Baseline: {
if (layoutBox.isInlineBlockBox() && layoutBox.establishesInlineFormattingContext()) {
// Inline-blocks with inline content always have baselines.
- auto& formattingState = downcast<InlineFormattingState>(layoutState().establishedFormattingState(downcast<Container>(layoutBox)));
+ auto& formattingState = layoutState().establishedInlineFormattingState(downcast<Container>(layoutBox));
// Spec makes us generate at least one line -even if it is empty.
auto& lastLineBox = formattingState.displayInlineContent()->lineBoxes.last();
auto inlineBlockBaseline = lastLineBox.baseline();
Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp (254874 => 254875)
--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp 2020-01-21 21:07:52 UTC (rev 254874)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp 2020-01-21 21:08:55 UTC (rev 254875)
@@ -55,7 +55,7 @@
: m_flow(flow)
, m_boxTree(flow)
, m_layoutState(m_flow.document(), rootLayoutBox())
- , m_inlineFormattingState(downcast<Layout::InlineFormattingState>(m_layoutState.createFormattingStateForFormattingRootIfNeeded(rootLayoutBox())))
+ , m_inlineFormattingState(m_layoutState.ensureInlineFormattingState(rootLayoutBox()))
{
m_layoutState.setIsIntegratedRootBoxFirstChild(m_flow.parent()->firstChild() == &m_flow);
}
Modified: trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp (254874 => 254875)
--- trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp 2020-01-21 21:07:52 UTC (rev 254874)
+++ trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp 2020-01-21 21:08:55 UTC (rev 254875)
@@ -315,7 +315,7 @@
#if ENABLE(TREE_DEBUGGING)
static void outputInlineRuns(TextStream& stream, const LayoutState& layoutState, const Container& inlineFormattingRoot, unsigned depth)
{
- auto& inlineFormattingState = downcast<InlineFormattingState>(layoutState.establishedFormattingState(inlineFormattingRoot));
+ auto& inlineFormattingState = layoutState.establishedInlineFormattingState(inlineFormattingRoot);
auto* displayInlineContent = inlineFormattingState.displayInlineContent();
if (!displayInlineContent)
return;