[LFC][IFC] Construct dedicated runs when the inline element requires it (part 2)
[WebKit-https.git] / Source / WebCore / layout / inlineformatting / InlineFormattingState.cpp
index 437d948..aa43970 100644 (file)
@@ -35,7 +35,7 @@ namespace Layout {
 
 WTF_MAKE_ISO_ALLOCATED_IMPL(InlineFormattingState);
 
-InlineFormattingState::InlineFormattingState(Ref<FloatingState>&& floatingState, const LayoutState& layoutState)
+InlineFormattingState::InlineFormattingState(Ref<FloatingState>&& floatingState, LayoutState& layoutState)
     : FormattingState(WTFMove(floatingState), Type::Inline, layoutState)
 {
 }
@@ -44,10 +44,19 @@ InlineFormattingState::~InlineFormattingState()
 {
 }
 
-std::unique_ptr<FormattingContext> InlineFormattingState::formattingContext(const Box& formattingContextRoot) const
+std::unique_ptr<FormattingContext> InlineFormattingState::formattingContext(const Box& formattingContextRoot)
 {
     ASSERT(formattingContextRoot.establishesInlineFormattingContext());
-    return std::make_unique<InlineFormattingContext>(formattingContextRoot);
+    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;
 }
 
 }