Changeset 17089 in webkit
- Timestamp:
- Oct 17, 2006 12:47:55 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r17084 r17089 1 2006-10-17 Justin Garcia <justin.garcia@apple.com> 2 3 Reviewed by sullivan 4 5 <rdar://problem/4776765> 6 REGRESSION: Caret's ghost left behind after inserting a paragraph separator (11237) 7 8 * fast/repaint/4776765-expected.checksum: Added. 9 * fast/repaint/4776765-expected.png: Added. 10 * fast/repaint/4776765-expected.txt: Added. 11 * fast/repaint/4776765.html: Added. 12 1 13 2006-10-17 Alice Liu <alice.liu@apple.com> 2 14 3 15 Reviewed by Tim Hatcher. 4 16 5 When nodes are removed, selections are cleared, and when http://bugs.webkit.org/show_bug.cgi?id=6498 was fixed, we started sending didChangeSelection notifications. Updating the test results fixes some of the tests mentioned in http://bugs.webkit.org/show_bug.cgi?id=10924 17 When nodes are removed, selections are cleared, and when 18 http://bugs.webkit.org/show_bug.cgi?id=6498 was fixed, we started 19 sending didChangeSelection notifications. Updating the test results 20 fixes some of the tests mentioned in http://bugs.webkit.org/show_bug.cgi?id=10924 6 21 7 22 * fast/dynamic/move-node-with-selection-expected.txt: -
trunk/WebCore/ChangeLog
r17083 r17089 1 2006-10-16 Justin Garcia <justin.garcia@apple.com> 2 3 Reviewed by sullivan 4 5 <rdar://problem/4776765> 6 REGRESSION: Caret's ghost left behind after inserting a paragraph separator (11237) 7 8 We set m_needsLayout to false and call caretRect() in the hopes that it will give us 9 the old caret rect. It in fact corrects the caret rect for an offset that it 10 believes is due to scrolling but which is actually due to a change in selection 11 without an accompanying layout. So it returns the new caret rect regardless of 12 what m_needsLayout is set to. 13 14 * editing/SelectionController.cpp: 15 (WebCore::repaintRectForCaret): Moved the code from caretRepaintRect that 16 adds a one pixel slop to this new function. 17 (WebCore::SelectionController::caretRepaintRect): Moved this code to 18 repaintRectForCaret. 19 (WebCore::SelectionController::recomputeCaretRect): Compare the old 20 caret rect to the new one that's computed with a fresh layout. If 21 they are different, invalidate both repaint rects. 22 1 23 2006-10-17 David Harrison <harrison@apple.com> 2 24 -
trunk/WebCore/editing/SelectionController.cpp
r16738 r17089 777 777 } 778 778 779 static IntRect repaintRectForCaret(IntRect caret) 780 { 781 if (caret.isEmpty()) 782 return IntRect(); 783 caret.inflate(1); 784 return caret; 785 } 786 779 787 IntRect SelectionController::caretRepaintRect() const 780 788 { 781 // FIXME: Add one pixel of slop on each side to make sure we don't leave behind artifacts. 782 IntRect r = caretRect(); 783 if (r.isEmpty()) 784 return IntRect(); 785 return IntRect(r.x() - 1, r.y() - 1, r.width() + 2, r.height() + 2); 789 return repaintRectForCaret(caretRect()); 786 790 } 787 791 … … 798 802 return false; 799 803 800 // Set m_needsLayout to false to get the "old" repaint rect, 801 // since caretRepaintRect currently recomputes the rect if 802 // m_needsLayout is true. It's a problem if that ever happens 803 // outside this function, so we need to change that design in 804 // the future. 805 m_needsLayout = false; 806 IntRect oldRect = caretRepaintRect(); 804 IntRect oldRect = m_caretRect; 807 805 m_needsLayout = true; 808 IntRect newRect = caretRe paintRect();806 IntRect newRect = caretRect(); 809 807 if (oldRect == newRect) 810 808 return false; 811 809 812 v->updateContents( oldRect, false);813 v->updateContents( newRect, false);810 v->updateContents(repaintRectForCaret(oldRect), false); 811 v->updateContents(repaintRectForCaret(newRect), false); 814 812 return true; 815 813 }
Note: See TracChangeset
for help on using the changeset viewer.