Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1530)

Unified Diff: Source/core/paint/BlockPainter.cpp

Issue 720313002: Push selection gaps logic down to RenderBlockFlow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: move even MOAR! Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/paint/BlockFlowPainter.cpp ('k') | Source/core/rendering/RenderBlock.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/BlockPainter.cpp
diff --git a/Source/core/paint/BlockPainter.cpp b/Source/core/paint/BlockPainter.cpp
index 8954cd3c35cfe9c172b7bbc096d42bd3aa4cd63b..c8bd98b05cea85f7a1b01241c3cdb32198e0b198 100644
--- a/Source/core/paint/BlockPainter.cpp
+++ b/Source/core/paint/BlockPainter.cpp
@@ -196,7 +196,7 @@ void BlockPainter::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOff
// FIXME: Make this work with multi column layouts. For now don't fill gaps.
bool isPrinting = m_renderBlock.document().printing();
if (!isPrinting && !m_renderBlock.hasColumns())
- paintSelection(paintInfo, scrolledOffset); // Fill in gaps in selection on lines and between blocks.
+ m_renderBlock.paintSelection(paintInfo, scrolledOffset); // Fill in gaps in selection on lines and between blocks.
// 4. paint floats.
if (paintPhase == PaintPhaseFloat || paintPhase == PaintPhaseSelection || paintPhase == PaintPhaseTextClip) {
@@ -441,30 +441,6 @@ void BlockPainter::paintContents(PaintInfo& paintInfo, const LayoutPoint& paintO
}
}
-void BlockPainter::paintSelection(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
-{
- if (m_renderBlock.shouldPaintSelectionGaps() && paintInfo.phase == PaintPhaseForeground) {
- LayoutUnit lastTop = 0;
- LayoutUnit lastLeft = m_renderBlock.logicalLeftSelectionOffset(&m_renderBlock, lastTop);
- LayoutUnit lastRight = m_renderBlock.logicalRightSelectionOffset(&m_renderBlock, lastTop);
- GraphicsContextStateSaver stateSaver(*paintInfo.context);
-
- LayoutRect gapRectsBounds = m_renderBlock.selectionGaps(&m_renderBlock, paintOffset, LayoutSize(), lastTop, lastLeft, lastRight, &paintInfo);
- if (!gapRectsBounds.isEmpty()) {
- RenderLayer* layer = m_renderBlock.enclosingLayer();
- gapRectsBounds.moveBy(-paintOffset);
- if (!m_renderBlock.hasLayer()) {
- LayoutRect localBounds(gapRectsBounds);
- m_renderBlock.flipForWritingMode(localBounds);
- gapRectsBounds = m_renderBlock.localToContainerQuad(FloatRect(localBounds), layer->renderer()).enclosingBoundingBox();
- if (layer->renderer()->hasOverflowClip())
- gapRectsBounds.move(layer->renderBox()->scrolledContentOffset());
- }
- layer->addBlockSelectionGapsBounds(gapRectsBounds);
- }
- }
-}
-
void BlockPainter::paintContinuationOutlines(PaintInfo& info, const LayoutPoint& paintOffset)
{
RenderInline* inlineCont = m_renderBlock.inlineElementContinuation();
« no previous file with comments | « Source/core/paint/BlockFlowPainter.cpp ('k') | Source/core/rendering/RenderBlock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698