| Index: Source/core/layout/LayoutBlockFlowLine.cpp
|
| diff --git a/Source/core/layout/LayoutBlockFlowLine.cpp b/Source/core/layout/LayoutBlockFlowLine.cpp
|
| index 73cb7b05fddff414d2de4d325ebb92b8744618a0..f37a019d3e6ede2b2a216174bcfdda5fcd56d09b 100644
|
| --- a/Source/core/layout/LayoutBlockFlowLine.cpp
|
| +++ b/Source/core/layout/LayoutBlockFlowLine.cpp
|
| @@ -36,6 +36,7 @@
|
| #include "core/layout/line/LayoutTextInfo.h"
|
| #include "core/layout/line/LineLayoutState.h"
|
| #include "core/layout/line/LineWidth.h"
|
| +#include "core/layout/line/TrailingFloatsRootInlineBox.h"
|
| #include "core/layout/line/WordMeasurement.h"
|
| #include "core/layout/svg/line/SVGRootInlineBox.h"
|
| #include "platform/fonts/Character.h"
|
| @@ -769,6 +770,7 @@ void LayoutBlockFlow::layoutRunsAndFloatsInRange(LineLayoutState& layoutState,
|
| // Once BidiRunList is separated from BidiResolver this will not be needed.
|
| resolver.runs().deleteRuns();
|
| resolver.markCurrentRunEmpty(); // FIXME: This can probably be replaced by an ASSERT (or just removed).
|
| + layoutState.setCheckForFloatsFromLastLine(true);
|
| resolver.setPosition(InlineIterator(resolver.position().root(), 0, 0), 0);
|
| break;
|
| }
|
| @@ -965,7 +967,7 @@ void LayoutBlockFlow::linkToEndLineIfNeeded(LineLayoutState& layoutState)
|
| }
|
| }
|
|
|
| - if (positionNewFloats() && lastRootBox()) {
|
| + if (m_floatingObjects && (layoutState.checkForFloatsFromLastLine() || positionNewFloats()) && lastRootBox()) {
|
| // In case we have a float on the last line, it might not be positioned up to now.
|
| // This has to be done before adding in the bottom border/padding, or the float will
|
| // include the padding incorrectly. -dwh
|
| @@ -983,6 +985,22 @@ void LayoutBlockFlow::linkToEndLineIfNeeded(LineLayoutState& layoutState)
|
| if (it == end)
|
| return;
|
|
|
| + if (layoutState.checkForFloatsFromLastLine()) {
|
| + LayoutUnit bottomVisualOverflow = lastRootBox()->logicalBottomVisualOverflow();
|
| + LayoutUnit bottomLayoutOverflow = lastRootBox()->logicalBottomLayoutOverflow();
|
| + TrailingFloatsRootInlineBox* trailingFloatsLineBox = new TrailingFloatsRootInlineBox(*this);
|
| + m_lineBoxes.appendLineBox(trailingFloatsLineBox);
|
| + trailingFloatsLineBox->setConstructed();
|
| + GlyphOverflowAndFallbackFontsMap textBoxDataMap;
|
| + VerticalPositionCache verticalPositionCache;
|
| + LayoutUnit blockLogicalHeight = logicalHeight();
|
| + trailingFloatsLineBox->alignBoxesInBlockDirection(blockLogicalHeight, textBoxDataMap, verticalPositionCache);
|
| + trailingFloatsLineBox->setLineTopBottomPositions(blockLogicalHeight, blockLogicalHeight, blockLogicalHeight, blockLogicalHeight);
|
| + LayoutRect logicalLayoutOverflow(0, blockLogicalHeight, 1, bottomLayoutOverflow - blockLogicalHeight);
|
| + LayoutRect logicalVisualOverflow(0, blockLogicalHeight, 1, bottomVisualOverflow - blockLogicalHeight);
|
| + trailingFloatsLineBox->setOverflowFromLogicalRects(logicalLayoutOverflow, logicalVisualOverflow, trailingFloatsLineBox->lineTop(), trailingFloatsLineBox->lineBottom());
|
| + }
|
| +
|
| for (; it != end; ++it)
|
| appendFloatingObjectToLastLine(it->get());
|
| }
|
|
|