[LFC][IFC] Construct dedicated runs when the inline element requires it (part 2)
[WebKit-https.git] / Source / WebCore / layout / inlineformatting / InlineFormattingState.cpp
index 8d73ec5..aa43970 100644 (file)
 
 #include "config.h"
 #include "InlineFormattingState.h"
+
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+namespace Layout {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(InlineFormattingState);
+
+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