[LFC] Implement LayoutContext::createDisplayBox
[WebKit-https.git] / Source / WebCore / layout / LayoutContext.cpp
index 9c2d4b71f9015956c79b04e87cb9870727f29569..9e98ae7f61a2c3aaa3cfae2ce86051b061da57a4 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "BlockFormattingContext.h"
 #include "BlockFormattingState.h"
+#include "DisplayBox.h"
 #include "InlineFormattingContext.h"
 #include "InlineFormattingState.h"
 #include "LayoutBox.h"
@@ -53,6 +54,14 @@ void LayoutContext::updateLayout()
     context->layout(*this, state);
 }
 
+Display::Box& LayoutContext::createDisplayBox(const Box& layoutBox)
+{
+    std::unique_ptr<Display::Box> displayBox(new Display::Box());
+    auto* displayBoxPtr = displayBox.get();
+    m_layoutToDisplayBox.add(&layoutBox, WTFMove(displayBox));
+    return *displayBoxPtr;
+}
+
 FormattingState& LayoutContext::formattingStateForBox(const Box& layoutBox) const
 {
     auto& root = layoutBox.formattingContextRoot();