[LayoutReloaded] Decouple formatting state and context lifetime.
[WebKit-https.git] / Tools / LayoutReloaded / FormattingState / InlineFormattingState.js
index 8169b02b47a98a2597435c9fbf2d9b1c720a5efd..b9a874e363fce7059c35b9f6158b42e5a9758477 100644 (file)
 class InlineFormattingState extends FormattingState {
     constructor(formattingRoot, layoutState) {
         super(layoutState, formattingRoot);
-        this._setFormattingContext(new InlineFormattingContext(this));
+        // If the block container box that initiates this inline formatting contex also establishes a block context, create a new float for us.
+        if (this.formattingRoot().establishesBlockFormattingContext())
+            this.m_floatingState = new FloatingState(this);
+        else {
+            // TODO: use parent formatting context's floating state.
+        }
         this.m_lines = new Array();
     }