From 643ca7872b450ea4efacab6188849e5aac2ba161 Mon Sep 17 00:00:00 2001 From: Steve Block Date: Tue, 15 Dec 2009 10:12:09 +0000 Subject: Merge webkit.org at r51976 : Initial merge by git. Change-Id: Ib0e7e2f0fb4bee5a186610272edf3186f0986b43 --- WebCore/rendering/RenderView.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'WebCore/rendering/RenderView.cpp') diff --git a/WebCore/rendering/RenderView.cpp b/WebCore/rendering/RenderView.cpp index c4a666f..753afe4 100644 --- a/WebCore/rendering/RenderView.cpp +++ b/WebCore/rendering/RenderView.cpp @@ -210,7 +210,7 @@ void RenderView::paintBoxDecorations(PaintInfo& paintInfo, int, int) if (baseColor.alpha() > 0) { paintInfo.context->save(); paintInfo.context->setCompositeOperation(CompositeCopy); - paintInfo.context->fillRect(paintInfo.rect, baseColor); + paintInfo.context->fillRect(paintInfo.rect, baseColor, style()->colorSpace()); paintInfo.context->restore(); } else paintInfo.context->clearRect(paintInfo.rect); @@ -338,7 +338,13 @@ IntRect RenderView::selectionBounds(bool clipToVisibleContent) const SelectionMap::iterator end = selectedObjects.end(); for (SelectionMap::iterator i = selectedObjects.begin(); i != end; ++i) { RenderSelectionInfo* info = i->second; - selRect.unite(info->rect()); + // RenderSelectionInfo::rect() is in the coordinates of the repaintContainer, so map to page coordinates. + IntRect currRect = info->rect(); + if (RenderBoxModelObject* repaintContainer = info->repaintContainer()) { + FloatQuad absQuad = repaintContainer->localToAbsoluteQuad(FloatRect(currRect)); + currRect = absQuad.enclosingBoundingBox(); + } + selRect.unite(currRect); delete info; } return selRect; @@ -437,7 +443,7 @@ void RenderView::setSelection(RenderObject* start, int startPos, RenderObject* e o = o->nextInPreOrder(); } - m_cachedSelectionBounds = IntRect(); + m_layer->clearBlockSelectionGapsBounds(); // Now that the selection state has been updated for the new objects, walk them again and // put them in the new objects list. @@ -450,9 +456,7 @@ void RenderView::setSelection(RenderObject* start, int startPos, RenderObject* e RenderBlockSelectionInfo* blockInfo = newSelectedBlocks.get(cb); if (blockInfo) break; - blockInfo = new RenderBlockSelectionInfo(cb); - newSelectedBlocks.set(cb, blockInfo); - m_cachedSelectionBounds.unite(blockInfo->rects()); + newSelectedBlocks.set(cb, new RenderBlockSelectionInfo(cb)); cb = cb->containingBlock(); } } @@ -529,7 +533,7 @@ void RenderView::setSelection(RenderObject* start, int startPos, RenderObject* e void RenderView::clearSelection() { - repaintViewRectangle(m_cachedSelectionBounds); + m_layer->repaintBlockSelectionGaps(); setSelection(0, -1, 0, -1, RepaintNewMinusOld); } -- cgit v1.1