Newly added float should trigger full layout on the block.
[WebKit-https.git] / Source / WebCore / rendering / RenderBlockLineLayout.cpp
index 1ec11c3..937a1e8 100644 (file)
@@ -1834,8 +1834,19 @@ RootInlineBox* RenderBlockFlow::determineStartPosition(LineLayoutState& layoutSt
             }
         }
         // Check if a new float has been inserted after the last known float.
-        if (!currentLine && floatsIterator != end)
-            layoutState.markForFullLayout();
+        if (floatsIterator != end) {
+            if (!currentLine)
+                layoutState.markForFullLayout();
+            else {
+                for (; floatsIterator != end; ++floatsIterator) {
+                    auto& floatWithRect = *floatsIterator;
+                    if (!floatWithRect->renderer().needsLayout())
+                        continue;
+                    layoutState.markForFullLayout();
+                    break;
+                }
+            }
+        }
     }
 
     if (layoutState.isFullLayout()) {