[LFC][IFC] Construct dedicated runs when the inline element requires it (part 2)
[WebKit-https.git] / Source / WebCore / layout / inlineformatting / InlineFormattingState.cpp
index 99970d1..aa43970 100644 (file)
@@ -35,11 +35,30 @@ namespace Layout {
 
 WTF_MAKE_ISO_ALLOCATED_IMPL(InlineFormattingState);
 
-InlineFormattingState::InlineFormattingState(Ref<FloatingState>&& floatingState)
-    : FormattingState(WTFMove(floatingState))
+InlineFormattingState::InlineFormattingState(Ref<FloatingState>&& floatingState, LayoutState& layoutState)
+    : FormattingState(WTFMove(floatingState), Type::Inline, layoutState)
 {
 }
 
+InlineFormattingState::~InlineFormattingState()
+{
+}
+
+std::unique_ptr<FormattingContext> InlineFormattingState::formattingContext(const Box& formattingContextRoot)
+{
+    ASSERT(formattingContextRoot.establishesInlineFormattingContext());
+    return std::make_unique<InlineFormattingContext>(formattingContextRoot, *this);
+}
+
+std::optional<InlineFormattingState::DetachingRules> InlineFormattingState::detachingRules(const Box& layoutBox) const
+{
+    auto detachingRules = m_detachingRules.get(&layoutBox);
+    if (!detachingRules)
+        return { };
+
+    return detachingRules;
+}
+
 }
 }
 #endif