LayoutTests:
Reviewed by sullivan
<rdar://problem/
4776765>
REGRESSION: Caret's ghost left behind after inserting a paragraph separator (11237)
* fast/repaint/
4776765-expected.checksum: Added.
* fast/repaint/
4776765-expected.png: Added.
* fast/repaint/
4776765-expected.txt: Added.
* fast/repaint/
4776765.html: Added.
WebCore:
Reviewed by sullivan
<rdar://problem/
4776765>
REGRESSION: Caret's ghost left behind after inserting a paragraph separator (11237)
We set m_needsLayout to false and call caretRect() in the hopes that it will give us
the old caret rect. It in fact corrects the caret rect for an offset that it
believes is due to scrolling but which is actually due to a change in selection
without an accompanying layout. So it returns the new caret rect regardless of
what m_needsLayout is set to.
* editing/SelectionController.cpp:
(WebCore::repaintRectForCaret): Moved the code from caretRepaintRect that
adds a one pixel slop to this new function.
(WebCore::SelectionController::caretRepaintRect): Moved this code to
repaintRectForCaret.
(WebCore::SelectionController::recomputeCaretRect): Compare the old
caret rect to the new one that's computed with a fresh layout. If
they are different, invalidate both repaint rects.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17089
268f45cc-cd09-0410-ab3c-
d52691b4dbfc