| Index: Source/core/paint/BlockFlowPainter.cpp
|
| diff --git a/Source/core/paint/BlockFlowPainter.cpp b/Source/core/paint/BlockFlowPainter.cpp
|
| index 1a66ed50f7de6e847477edbffb7c1d4ed1425e0e..5b8d7f3ed6b6ea14050934b25bacd2f9e670eec1 100644
|
| --- a/Source/core/paint/BlockFlowPainter.cpp
|
| +++ b/Source/core/paint/BlockFlowPainter.cpp
|
| @@ -8,6 +8,7 @@
|
| #include "core/rendering/FloatingObjects.h"
|
| #include "core/rendering/PaintInfo.h"
|
| #include "core/rendering/RenderBlockFlow.h"
|
| +#include "core/rendering/RenderLayer.h"
|
|
|
| namespace blink {
|
|
|
| @@ -44,4 +45,28 @@ void BlockFlowPainter::paintFloats(PaintInfo& paintInfo, const LayoutPoint& pain
|
| }
|
| }
|
|
|
| +void BlockFlowPainter::paintSelection(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
|
| +{
|
| + if (m_renderBlockFlow.shouldPaintSelectionGaps() && paintInfo.phase == PaintPhaseForeground) {
|
| + LayoutUnit lastTop = 0;
|
| + LayoutUnit lastLeft = m_renderBlockFlow.logicalLeftSelectionOffset(&m_renderBlockFlow, lastTop);
|
| + LayoutUnit lastRight = m_renderBlockFlow.logicalRightSelectionOffset(&m_renderBlockFlow, lastTop);
|
| + GraphicsContextStateSaver stateSaver(*paintInfo.context);
|
| +
|
| + LayoutRect gapRectsBounds = m_renderBlockFlow.selectionGaps(&m_renderBlockFlow, paintOffset, LayoutSize(), lastTop, lastLeft, lastRight, &paintInfo);
|
| + if (!gapRectsBounds.isEmpty()) {
|
| + RenderLayer* layer = m_renderBlockFlow.enclosingLayer();
|
| + gapRectsBounds.moveBy(-paintOffset);
|
| + if (!m_renderBlockFlow.hasLayer()) {
|
| + LayoutRect localBounds(gapRectsBounds);
|
| + m_renderBlockFlow.flipForWritingMode(localBounds);
|
| + gapRectsBounds = m_renderBlockFlow.localToContainerQuad(FloatRect(localBounds), layer->renderer()).enclosingBoundingBox();
|
| + if (layer->renderer()->hasOverflowClip())
|
| + gapRectsBounds.move(layer->renderBox()->scrolledContentOffset());
|
| + }
|
| + layer->addBlockSelectionGapsBounds(gapRectsBounds);
|
| + }
|
| + }
|
| +}
|
| +
|
| } // namespace blink
|
|
|