Index: Source/core/rendering/RenderBlockFlow.cpp |
diff --git a/Source/core/rendering/RenderBlockFlow.cpp b/Source/core/rendering/RenderBlockFlow.cpp |
index 068627320dad05554a93bd69b39d3ba7dbdbe420..1dec21bc0ebced9228759ef718b579d34d7a032e 100644 |
--- a/Source/core/rendering/RenderBlockFlow.cpp |
+++ b/Source/core/rendering/RenderBlockFlow.cpp |
@@ -36,6 +36,7 @@ |
#include "core/frame/LocalFrame.h" |
#include "core/frame/Settings.h" |
#include "core/html/HTMLDialogElement.h" |
+#include "core/paint/BlockFlowPainter.h" |
#include "core/rendering/HitTestLocation.h" |
#include "core/rendering/RenderFlowThread.h" |
#include "core/rendering/RenderLayer.h" |
@@ -2102,32 +2103,7 @@ void RenderBlockFlow::invalidatePaintForOverflow() |
void RenderBlockFlow::paintFloats(PaintInfo& paintInfo, const LayoutPoint& paintOffset, bool preservePhase) |
{ |
- if (!m_floatingObjects) |
- return; |
- |
- const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); |
- FloatingObjectSetIterator end = floatingObjectSet.end(); |
- for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) { |
- FloatingObject* floatingObject = it->get(); |
- // Only paint the object if our m_shouldPaint flag is set. |
- if (floatingObject->shouldPaint() && !floatingObject->renderer()->hasSelfPaintingLayer()) { |
- PaintInfo currentPaintInfo(paintInfo); |
- currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground; |
- // FIXME: LayoutPoint version of xPositionForFloatIncludingMargin would make this much cleaner. |
- LayoutPoint childPoint = flipFloatForWritingModeForChild(floatingObject, LayoutPoint(paintOffset.x() + xPositionForFloatIncludingMargin(floatingObject) - floatingObject->renderer()->x(), paintOffset.y() + yPositionForFloatIncludingMargin(floatingObject) - floatingObject->renderer()->y())); |
- floatingObject->renderer()->paint(currentPaintInfo, childPoint); |
- if (!preservePhase) { |
- currentPaintInfo.phase = PaintPhaseChildBlockBackgrounds; |
- floatingObject->renderer()->paint(currentPaintInfo, childPoint); |
- currentPaintInfo.phase = PaintPhaseFloat; |
- floatingObject->renderer()->paint(currentPaintInfo, childPoint); |
- currentPaintInfo.phase = PaintPhaseForeground; |
- floatingObject->renderer()->paint(currentPaintInfo, childPoint); |
- currentPaintInfo.phase = PaintPhaseOutline; |
- floatingObject->renderer()->paint(currentPaintInfo, childPoint); |
- } |
- } |
- } |
+ BlockFlowPainter(*this).paintFloats(paintInfo, paintOffset, preservePhase); |
} |
void RenderBlockFlow::clipOutFloatingObjects(const RenderBlock* rootBlock, const PaintInfo* paintInfo, const LayoutPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock) const |