Changeset 40564 in webkit
- Timestamp:
- Feb 3, 2009 6:41:38 PM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 1 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r40563 r40564 1 2009-02-03 Simon Fraser <simon.fraser@apple.com> 2 3 Reviewed by Dave Hyatt 4 5 https://bugs.webkit.org/show_bug.cgi?id=23628 6 7 Fix selection repainting to do container-relative repaints. RenderView now 8 repaints the seleciton using the containerForRepaint() for each RenderSelectionInfo. 9 selectionRect() is now a wrapper for selectionRectForRepaint() with no container. 10 11 Pull SelectionInfo out of RenderObject.h, and BlockSelectionInfo out 12 of RenderBlock.h and move them into RenderSelectionInfo.h, with some 13 sharing and refactoring. 14 15 RenderBlock::selectionGapRectsForRepaint() is not yet container-aware. 16 17 * GNUmakefile.am: 18 * WebCore.vcproj/WebCore.vcproj: 19 * WebCore.xcodeproj/project.pbxproj: 20 * rendering/RenderBR.h: 21 (WebCore::RenderBR::selectionRectForRepaint): 22 * rendering/RenderBlock.cpp: 23 (WebCore::RenderBlock::selectionGapRectsForRepaint): 24 * rendering/RenderBlock.h: 25 (WebCore::RenderBlock::selectionRectForRepaint): 26 * rendering/RenderListMarker.cpp: 27 (WebCore::RenderListMarker::paint): 28 (WebCore::RenderListMarker::selectionRectForRepaint): 29 * rendering/RenderListMarker.h: 30 * rendering/RenderObject.h: 31 (WebCore::RenderObject::selectionRect): 32 (WebCore::RenderObject::selectionRectForRepaint): 33 * rendering/RenderReplaced.cpp: 34 (WebCore::RenderReplaced::selectionRectForRepaint): 35 * rendering/RenderReplaced.h: 36 * rendering/RenderSVGInlineText.cpp: 37 (WebCore::RenderSVGInlineText::absoluteRects): 38 (WebCore::RenderSVGInlineText::absoluteQuads): 39 (WebCore::RenderSVGInlineText::selectionRectForRepaint): 40 (WebCore::RenderSVGInlineText::computeRepaintRectForRange): 41 * rendering/RenderSVGInlineText.h: 42 * rendering/RenderSelectionInfo.h: Added. 43 (WebCore::RenderSelectionInfoBase::RenderSelectionInfoBase): 44 (WebCore::RenderSelectionInfoBase::object): 45 (WebCore::RenderSelectionInfoBase::repaintContainer): 46 (WebCore::RenderSelectionInfoBase::state): 47 (WebCore::RenderSelectionInfo::RenderSelectionInfo): 48 (WebCore::RenderSelectionInfo::repaint): 49 (WebCore::RenderSelectionInfo::rect): 50 (WebCore::RenderBlockSelectionInfo::RenderBlockSelectionInfo): 51 (WebCore::RenderBlockSelectionInfo::repaint): 52 (WebCore::RenderBlockSelectionInfo::block): 53 (WebCore::RenderBlockSelectionInfo::rects): 54 * rendering/RenderText.cpp: 55 (WebCore::RenderText::selectionRectForRepaint): 56 * rendering/RenderText.h: 57 * rendering/RenderView.cpp: 58 (WebCore::RenderView::selectionBounds): 59 (WebCore::RenderView::setSelection): 60 * rendering/RenderView.h: 61 * rendering/RenderWidget.cpp: 62 (WebCore::RenderWidget::paint): 63 1 64 2009-02-03 David Hyatt <hyatt@apple.com> 2 65 -
trunk/WebCore/GNUmakefile.am
r40535 r40564 1580 1580 WebCore/rendering/RenderScrollbarTheme.cpp \ 1581 1581 WebCore/rendering/RenderScrollbarTheme.h \ 1582 WebCore/rendering/RenderSelectionInfo.h \ 1582 1583 WebCore/rendering/RenderSlider.cpp \ 1583 1584 WebCore/rendering/RenderSlider.h \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r40531 r40564 9507 9507 </File> 9508 9508 <File 9509 RelativePath="..\rendering\RenderSelectionInfo.h" 9510 > 9511 </File> 9512 <File 9509 9513 RelativePath="..\rendering\RenderSlider.cpp" 9510 9514 > -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r40527 r40564 145 145 0BB4DBE20F2EE29800354619 /* CrossThreadCopier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0BB4DBE10F2EE29800354619 /* CrossThreadCopier.cpp */; }; 146 146 0BE030A20F3112FB003C1A46 /* RenderLineBoxList.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BE030A10F3112FB003C1A46 /* RenderLineBoxList.h */; settings = {ATTRIBUTES = (Private, ); }; }; 147 0F11A54F0F39233100C37884 /* RenderSelectionInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F11A54E0F39233100C37884 /* RenderSelectionInfo.h */; }; 147 148 0F56028F0E4B76580065B038 /* RenderMarquee.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F56028D0E4B76580065B038 /* RenderMarquee.h */; }; 148 149 0F5602900E4B76580065B038 /* RenderMarquee.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F56028E0E4B76580065B038 /* RenderMarquee.cpp */; }; … … 5009 5010 0BB4DBE10F2EE29800354619 /* CrossThreadCopier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CrossThreadCopier.cpp; sourceTree = "<group>"; }; 5010 5011 0BE030A10F3112FB003C1A46 /* RenderLineBoxList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderLineBoxList.h; sourceTree = "<group>"; }; 5012 0F11A54E0F39233100C37884 /* RenderSelectionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSelectionInfo.h; sourceTree = "<group>"; }; 5011 5013 0F56028D0E4B76580065B038 /* RenderMarquee.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMarquee.h; sourceTree = "<group>"; }; 5012 5014 0F56028E0E4B76580065B038 /* RenderMarquee.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMarquee.cpp; sourceTree = "<group>"; }; … … 14160 14162 BCA846D40DC67A350026C309 /* RenderReplica.cpp */, 14161 14163 BCA846D50DC67A350026C309 /* RenderReplica.h */, 14164 0F11A54E0F39233100C37884 /* RenderSelectionInfo.h */, 14162 14165 A7352C170B1BB89D00A986D0 /* RenderSVGBlock.cpp */, 14163 14166 A7352C180B1BB89D00A986D0 /* RenderSVGBlock.h */, … … 16727 16730 1A569D250D7E2B82007C3983 /* runtime_root.h in Headers */, 16728 16731 93309E1E099E64920056E581 /* visible_units.h in Headers */, 16732 0F11A54F0F39233100C37884 /* RenderSelectionInfo.h in Headers */, 16729 16733 ); 16730 16734 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebCore/rendering/RenderBR.h
r37464 r40564 41 41 virtual const char* renderName() const { return "RenderBR"; } 42 42 43 virtual IntRect selectionRect (bool) { return IntRect(); }43 virtual IntRect selectionRectForRepaint(RenderBox* /*repaintContainer*/, bool /*clipToVisibleContent*/) { return IntRect(); } 44 44 45 45 virtual unsigned width(unsigned /*from*/, unsigned /*len*/, const Font&, int /*xpos*/) const { return 0; } -
trunk/WebCore/rendering/RenderBlock.cpp
r40524 r40564 1963 1963 } 1964 1964 1965 GapRects RenderBlock::selectionGapRects ()1965 GapRects RenderBlock::selectionGapRectsForRepaint(RenderBox* /*repaintContainer*/) 1966 1966 { 1967 1967 ASSERT(!needsLayout()); … … 1970 1970 return GapRects(); 1971 1971 1972 // FIXME: this is broken with transforms 1972 // FIXME: this is broken with transforms and a non-null repaintContainer 1973 1973 FloatPoint absContentPoint = localToAbsolute(FloatPoint()); 1974 1974 if (hasOverflowClip()) -
trunk/WebCore/rendering/RenderBlock.h
r40518 r40564 263 263 virtual void setSelectionState(SelectionState s); 264 264 265 struct BlockSelectionInfo { 266 RenderBlock* m_block; 267 GapRects m_rects; 268 SelectionState m_state; 269 270 BlockSelectionInfo() 271 : m_block(0) 272 , m_state(SelectionNone) 273 { 274 } 275 276 BlockSelectionInfo(RenderBlock* b) 277 : m_block(b) 278 , m_rects(b->needsLayout() ? GapRects() : b->selectionGapRects()) 279 , m_state(b->selectionState()) 280 { 281 } 282 283 RenderBlock* block() const { return m_block; } 284 GapRects rects() const { return m_rects; } 285 SelectionState state() const { return m_state; } 286 }; 287 288 virtual IntRect selectionRect(bool) { return selectionGapRects(); } 289 GapRects selectionGapRects(); 265 virtual IntRect selectionRectForRepaint(RenderBox* repaintContainer, bool /*clipToVisibleContent*/) 266 { 267 return selectionGapRectsForRepaint(repaintContainer); 268 } 269 GapRects selectionGapRectsForRepaint(RenderBox* repaintContainer); 290 270 virtual bool shouldPaintSelectionGaps() const; 291 271 bool isSelectionRoot() const; -
trunk/WebCore/rendering/RenderListMarker.cpp
r40312 r40564 546 546 #endif 547 547 context->drawImage(m_image->image(this, marker.size()), marker.location()); 548 if (selectionState() != SelectionNone) 548 if (selectionState() != SelectionNone) { 549 // FIXME: selectionRect() is in absolute, not painting coordinates. 549 550 context->fillRect(selectionRect(), selectionBackgroundColor()); 551 } 550 552 return; 551 553 } … … 557 559 #endif 558 560 559 if (selectionState() != SelectionNone) 561 if (selectionState() != SelectionNone) { 562 // FIXME: selectionRect() is in absolute, not painting coordinates. 560 563 context->fillRect(selectionRect(), selectionBackgroundColor()); 564 } 561 565 562 566 const Color color(style()->color()); … … 881 885 } 882 886 883 IntRect RenderListMarker::selectionRect (bool clipToVisibleContent)887 IntRect RenderListMarker::selectionRectForRepaint(RenderBox* repaintContainer, bool clipToVisibleContent) 884 888 { 885 889 ASSERT(!needsLayout()); … … 892 896 893 897 if (clipToVisibleContent) 894 computeAbsoluteRepaintRect(rect); 895 else { 896 FloatPoint absPos = localToAbsolute(); 897 rect.move(absPos.x(), absPos.y()); 898 } 898 computeRectForRepaint(repaintContainer, rect); 899 else 900 rect = localToContainerQuad(FloatRect(rect), repaintContainer).enclosingBoundingBox(); 899 901 900 902 return rect; -
trunk/WebCore/rendering/RenderListMarker.h
r40312 r40564 62 62 63 63 virtual void setSelectionState(SelectionState); 64 virtual IntRect selectionRect (bool clipToVisibleContent = true);64 virtual IntRect selectionRectForRepaint(RenderBox* repaintContainer, bool clipToVisibleContent = true); 65 65 virtual bool canBeSelectionLeaf() const { return true; } 66 66 -
trunk/WebCore/rendering/RenderObject.h
r40547 r40564 660 660 // A single rectangle that encompasses all of the selected objects within this object. Used to determine the tightest 661 661 // possible bounding box for the selection. 662 virtual IntRect selectionRect(bool) { return IntRect(); } 662 IntRect selectionRect(bool clipToVisibleContent = true) { return selectionRectForRepaint(0, clipToVisibleContent); } 663 virtual IntRect selectionRectForRepaint(RenderBox* /*repaintContainer*/, bool /*clipToVisibleContent*/ = true) { return IntRect(); } 663 664 664 665 // Whether or not an object can be part of the leaf elements of the selection. … … 674 675 // Whether or not a given block needs to paint selection gaps. 675 676 virtual bool shouldPaintSelectionGaps() const { return false; } 676 677 // This struct is used when the selection changes to cache the old and new state of the selection for each RenderObject.678 struct SelectionInfo {679 SelectionInfo()680 : m_object(0)681 , m_state(SelectionNone)682 {683 }684 685 SelectionInfo(RenderObject* o, bool clipToVisibleContent)686 : m_object(o)687 , m_rect(o->needsLayout() ? IntRect() : o->selectionRect(clipToVisibleContent))688 , m_state(o->selectionState())689 {690 }691 692 RenderObject* object() const { return m_object; }693 IntRect rect() const { return m_rect; }694 SelectionState state() const { return m_state; }695 696 RenderObject* m_object;697 IntRect m_rect;698 SelectionState m_state;699 };700 677 701 678 Node* draggableNode(bool dhtmlOK, bool uaOK, int x, int y, bool& dhtmlWillDrag) const; -
trunk/WebCore/rendering/RenderReplaced.cpp
r40312 r40564 235 235 } 236 236 237 IntRect RenderReplaced::selectionRect (bool clipToVisibleContent)237 IntRect RenderReplaced::selectionRectForRepaint(RenderBox* repaintContainer, bool clipToVisibleContent) 238 238 { 239 239 ASSERT(!needsLayout()); … … 244 244 IntRect rect = localSelectionRect(); 245 245 if (clipToVisibleContent) 246 computeAbsoluteRepaintRect(rect); 247 else { 248 FloatPoint absPos = localToAbsolute(FloatPoint()); 249 rect.move(absPos.x(), absPos.y()); 250 } 246 computeRectForRepaint(repaintContainer, rect); 247 else 248 rect = localToContainerQuad(FloatRect(rect), repaintContainer).enclosingBoundingBox(); 251 249 252 250 return rect; -
trunk/WebCore/rendering/RenderReplaced.h
r40461 r40564 63 63 virtual bool canBeSelectionLeaf() const { return true; } 64 64 virtual void setSelectionState(SelectionState); 65 virtual IntRect selectionRect (bool clipToVisibleContent = true);65 virtual IntRect selectionRectForRepaint(RenderBox* repaintContainer, bool clipToVisibleContent = true); 66 66 67 67 bool isSelected() const; -
trunk/WebCore/rendering/RenderSVGInlineText.cpp
r40347 r40564 69 69 void RenderSVGInlineText::absoluteRects(Vector<IntRect>& rects, int, int, bool) 70 70 { 71 rects.append(compute AbsoluteRectForRange(0, textLength()));71 rects.append(computeRepaintRectForRange(0, 0, textLength())); 72 72 } 73 73 74 74 void RenderSVGInlineText::absoluteQuads(Vector<FloatQuad>& quads, bool) 75 75 { 76 quads.append(FloatRect(compute AbsoluteRectForRange(0, textLength())));76 quads.append(FloatRect(computeRepaintRectForRange(0, 0, textLength()))); 77 77 } 78 78 79 IntRect RenderSVGInlineText::selectionRect (bool)79 IntRect RenderSVGInlineText::selectionRectForRepaint(RenderBox* repaintContainer, bool /*clipToVisibleContent*/) 80 80 { 81 81 ASSERT(!needsLayout()); 82 82 83 IntRect rect;84 83 if (selectionState() == SelectionNone) 85 return rect;84 return IntRect(); 86 85 87 86 // Early exit if we're ie. a <text> within a <defs> section. 88 87 if (isChildOfHiddenContainer(this)) 89 return rect;88 return IntRect(); 90 89 91 90 // Now calculate startPos and endPos for painting selection. … … 105 104 106 105 if (startPos == endPos) 107 return rect;106 return IntRect(); 108 107 109 return compute AbsoluteRectForRange(startPos, endPos);108 return computeRepaintRectForRange(repaintContainer, startPos, endPos); 110 109 } 111 110 112 IntRect RenderSVGInlineText::compute AbsoluteRectForRange(int startPos, int endPos)111 IntRect RenderSVGInlineText::computeRepaintRectForRange(RenderBox* /*repaintContainer*/, int startPos, int endPos) 113 112 { 114 IntRect rect;115 116 113 RenderBlock* cb = containingBlock(); 117 114 if (!cb || !cb->container()) 118 return rect;115 return IntRect(); 119 116 120 117 RenderSVGRoot* root = findSVGRootObject(parent()); 121 118 if (!root) 122 return rect;119 return IntRect(); 123 120 121 IntRect rect; 124 122 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) 125 123 rect.unite(box->selectionRect(0, 0, startPos, endPos)); … … 134 132 FloatRect fixedRect(narrowPrecisionToFloat(rect.x() + absPos.x() - htmlParentCtm.e()), 135 133 narrowPrecisionToFloat(rect.y() + absPos.y() - htmlParentCtm.f()), rect.width(), rect.height()); 136 // FIXME: broken with CSS transforms 134 // FIXME: broken with CSS transforms, and non-zero repaintContainer 137 135 return enclosingIntRect(absoluteTransform().mapRect(fixedRect)); 138 136 } -
trunk/WebCore/rendering/RenderSVGInlineText.h
r40180 r40564 42 42 43 43 virtual bool requiresLayer() const { return false; } 44 virtual IntRect selectionRect (bool clipToVisibleContent = true);44 virtual IntRect selectionRectForRepaint(RenderBox* repaintContainer, bool clipToVisibleContent = true); 45 45 virtual bool isSVGText() const { return true; } 46 46 virtual InlineTextBox* createInlineTextBox(); … … 52 52 53 53 private: 54 IntRect compute AbsoluteRectForRange(int startPos, int endPos);54 IntRect computeRepaintRectForRange(RenderBox* repaintContainer, int startPos, int endPos); 55 55 }; 56 56 -
trunk/WebCore/rendering/RenderText.cpp
r40547 r40564 1074 1074 } 1075 1075 1076 IntRect RenderText::selectionRect (bool clipToVisibleContent)1076 IntRect RenderText::selectionRectForRepaint(RenderBox* repaintContainer, bool clipToVisibleContent) 1077 1077 { 1078 1078 ASSERT(!needsLayout()); 1079 1079 1080 IntRect rect;1081 1080 if (selectionState() == SelectionNone) 1082 return rect;1081 return IntRect(); 1083 1082 RenderBlock* cb = containingBlock(); 1084 1083 if (!cb) 1085 return rect;1084 return IntRect(); 1086 1085 1087 1086 // Now calculate startPos and endPos for painting selection. … … 1101 1100 1102 1101 if (startPos == endPos) 1103 return rect; 1104 1102 return IntRect(); 1103 1104 IntRect rect; 1105 1105 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) 1106 1106 rect.unite(box->selectionRect(0, 0, startPos, endPos)); 1107 1107 1108 1108 if (clipToVisibleContent) 1109 compute AbsoluteRepaintRect(rect);1109 computeRectForRepaint(repaintContainer, rect); 1110 1110 else { 1111 1111 if (cb->hasColumns()) 1112 1112 cb->adjustRectForColumns(rect); 1113 // FIXME: This doesn't work correctly with transforms. 1114 FloatPoint absPos = localToAbsolute(); 1115 rect.move(absPos.x(), absPos.y()); 1113 1114 rect = localToContainerQuad(FloatRect(rect), repaintContainer).enclosingBoundingBox(); 1116 1115 } 1117 1116 -
trunk/WebCore/rendering/RenderText.h
r40547 r40564 96 96 virtual bool canBeSelectionLeaf() const { return true; } 97 97 virtual void setSelectionState(SelectionState s); 98 virtual IntRect selectionRect (bool clipToVisibleContent = true);98 virtual IntRect selectionRectForRepaint(RenderBox* repaintContainer, bool clipToVisibleContent = true); 99 99 virtual IntRect localCaretRect(InlineBox*, int caretOffset, int* extraWidthToEndOfLine = 0); 100 100 -
trunk/WebCore/rendering/RenderView.cpp
r40543 r40564 30 30 #include "HitTestResult.h" 31 31 #include "RenderLayer.h" 32 #include "RenderSelectionInfo.h" 32 33 33 34 namespace WebCore { … … 278 279 } 279 280 280 IntRect RenderView::selectionRect(bool clipToVisibleContent)281 {282 // The virtual selectionRect() should never be called on the RenderView.283 // We assert because there used to be ambiguity between284 // RenderView::selectionRect(bool) and285 // virtual RenderObject::selectionRect(bool) const286 ASSERT_NOT_REACHED();287 return RenderBlock::selectionRect(clipToVisibleContent);288 }289 290 281 IntRect RenderView::selectionBounds(bool clipToVisibleContent) const 291 282 { 292 283 document()->updateRendering(); 293 284 294 typedef HashMap<RenderObject*, SelectionInfo*> SelectionMap;285 typedef HashMap<RenderObject*, RenderSelectionInfo*> SelectionMap; 295 286 SelectionMap selectedObjects; 296 287 … … 300 291 if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selectionEnd) && os->selectionState() != SelectionNone) { 301 292 // Blocks are responsible for painting line gaps and margin gaps. They must be examined as well. 302 selectedObjects.set(os, new SelectionInfo(os, clipToVisibleContent));293 selectedObjects.set(os, new RenderSelectionInfo(os, clipToVisibleContent)); 303 294 RenderBlock* cb = os->containingBlock(); 304 295 while (cb && !cb->isRenderView()) { 305 SelectionInfo* blockInfo = selectedObjects.get(cb);296 RenderSelectionInfo* blockInfo = selectedObjects.get(cb); 306 297 if (blockInfo) 307 298 break; 308 selectedObjects.set(cb, new SelectionInfo(cb, clipToVisibleContent));299 selectedObjects.set(cb, new RenderSelectionInfo(cb, clipToVisibleContent)); 309 300 cb = cb->containingBlock(); 310 301 } … … 318 309 SelectionMap::iterator end = selectedObjects.end(); 319 310 for (SelectionMap::iterator i = selectedObjects.begin(); i != end; ++i) { 320 SelectionInfo* info = i->second;311 RenderSelectionInfo* info = i->second; 321 312 selRect.unite(info->rect()); 322 313 delete info; … … 343 334 344 335 // Objects each have a single selection rect to examine. 345 typedef HashMap<RenderObject*, SelectionInfo*> SelectedObjectMap;336 typedef HashMap<RenderObject*, RenderSelectionInfo*> SelectedObjectMap; 346 337 SelectedObjectMap oldSelectedObjects; 347 338 SelectedObjectMap newSelectedObjects; … … 350 341 // In order to get the repaint rect right, we have to examine left, middle, and right rects individually, since otherwise 351 342 // the union of those rects might remain the same even when changes have occurred. 352 typedef HashMap<RenderBlock*, BlockSelectionInfo*> SelectedBlockMap;343 typedef HashMap<RenderBlock*, RenderBlockSelectionInfo*> SelectedBlockMap; 353 344 SelectedBlockMap oldSelectedBlocks; 354 345 SelectedBlockMap newSelectedBlocks; … … 359 350 if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selectionEnd) && os->selectionState() != SelectionNone) { 360 351 // Blocks are responsible for painting line gaps and margin gaps. They must be examined as well. 361 oldSelectedObjects.set(os, new SelectionInfo(os, true));352 oldSelectedObjects.set(os, new RenderSelectionInfo(os, true)); 362 353 RenderBlock* cb = os->containingBlock(); 363 354 while (cb && !cb->isRenderView()) { 364 BlockSelectionInfo* blockInfo = oldSelectedBlocks.get(cb);355 RenderBlockSelectionInfo* blockInfo = oldSelectedBlocks.get(cb); 365 356 if (blockInfo) 366 357 break; 367 oldSelectedBlocks.set(cb, new BlockSelectionInfo(cb));358 oldSelectedBlocks.set(cb, new RenderBlockSelectionInfo(cb)); 368 359 cb = cb->containingBlock(); 369 360 } … … 408 399 while (o && o != stop) { 409 400 if ((o->canBeSelectionLeaf() || o == start || o == end) && o->selectionState() != SelectionNone) { 410 newSelectedObjects.set(o, new SelectionInfo(o, true));401 newSelectedObjects.set(o, new RenderSelectionInfo(o, true)); 411 402 RenderBlock* cb = o->containingBlock(); 412 403 while (cb && !cb->isRenderView()) { 413 BlockSelectionInfo* blockInfo = newSelectedBlocks.get(cb);404 RenderBlockSelectionInfo* blockInfo = newSelectedBlocks.get(cb); 414 405 if (blockInfo) 415 406 break; 416 newSelectedBlocks.set(cb, new BlockSelectionInfo(cb));407 newSelectedBlocks.set(cb, new RenderBlockSelectionInfo(cb)); 417 408 cb = cb->containingBlock(); 418 409 } … … 435 426 for (SelectedObjectMap::iterator i = oldSelectedObjects.begin(); i != oldObjectsEnd; ++i) { 436 427 RenderObject* obj = i->first; 437 SelectionInfo* newInfo = newSelectedObjects.get(obj);438 SelectionInfo* oldInfo = i->second;428 RenderSelectionInfo* newInfo = newSelectedObjects.get(obj); 429 RenderSelectionInfo* oldInfo = i->second; 439 430 if (!newInfo || oldInfo->rect() != newInfo->rect() || oldInfo->state() != newInfo->state() || 440 431 (m_selectionStart == obj && oldStartPos != m_selectionStartPos) || 441 432 (m_selectionEnd == obj && oldEndPos != m_selectionEndPos)) { 442 repaintViewRectangle(oldInfo->rect());433 oldInfo->repaint(); 443 434 if (newInfo) { 444 repaintViewRectangle(newInfo->rect());435 newInfo->repaint(); 445 436 newSelectedObjects.remove(obj); 446 437 delete newInfo; … … 453 444 SelectedObjectMap::iterator newObjectsEnd = newSelectedObjects.end(); 454 445 for (SelectedObjectMap::iterator i = newSelectedObjects.begin(); i != newObjectsEnd; ++i) { 455 SelectionInfo* newInfo = i->second;456 repaintViewRectangle(newInfo->rect());446 RenderSelectionInfo* newInfo = i->second; 447 newInfo->repaint(); 457 448 delete newInfo; 458 449 } … … 462 453 for (SelectedBlockMap::iterator i = oldSelectedBlocks.begin(); i != oldBlocksEnd; ++i) { 463 454 RenderBlock* block = i->first; 464 BlockSelectionInfo* newInfo = newSelectedBlocks.get(block);465 BlockSelectionInfo* oldInfo = i->second;455 RenderBlockSelectionInfo* newInfo = newSelectedBlocks.get(block); 456 RenderBlockSelectionInfo* oldInfo = i->second; 466 457 if (!newInfo || oldInfo->rects() != newInfo->rects() || oldInfo->state() != newInfo->state()) { 467 repaintViewRectangle(oldInfo->rects());458 oldInfo->repaint(); 468 459 if (newInfo) { 469 repaintViewRectangle(newInfo->rects());460 newInfo->repaint(); 470 461 newSelectedBlocks.remove(block); 471 462 delete newInfo; … … 478 469 SelectedBlockMap::iterator newBlocksEnd = newSelectedBlocks.end(); 479 470 for (SelectedBlockMap::iterator i = newSelectedBlocks.begin(); i != newBlocksEnd; ++i) { 480 BlockSelectionInfo* newInfo = i->second;481 repaintViewRectangle(newInfo->rects());471 RenderBlockSelectionInfo* newInfo = i->second; 472 newInfo->repaint(); 482 473 delete newInfo; 483 474 } -
trunk/WebCore/rendering/RenderView.h
r40543 r40564 152 152 protected: 153 153 virtual FloatQuad localToContainerQuad(const FloatQuad&, RenderBox* repaintContainer, bool fixed = false) const; 154 155 private:156 // selectionRect should never be called on a RenderView157 virtual IntRect selectionRect(bool);158 154 159 155 protected: -
trunk/WebCore/rendering/RenderWidget.cpp
r40143 r40564 205 205 206 206 // Paint a partially transparent wash over selected widgets. 207 if (isSelected() && !document()->printing()) 207 if (isSelected() && !document()->printing()) { 208 // FIXME: selectionRect() is in absolute, not painting coordinates. 208 209 paintInfo.context->fillRect(selectionRect(), selectionBackgroundColor()); 210 } 209 211 } 210 212
Note: See TracChangeset
for help on using the changeset viewer.