Reviewed by Geoff.
- fix http://bugs.webkit.org/show_bug.cgi?id=11132
Caret disappears when you're typing
* editing/SelectionController.cpp:
(WebCore::SelectionController::setSelection): Remove unnecessary call to
clearCaretRectIfNeeded. The recomputeCaretRect now takes care of this.
(WebCore::SelectionController::recomputeCaretRect): Explicitly set m_needsLayout
to false so we can get the old caret repaint rect. Later we need to change the
design so getting the rect doesn't have a side effect of causing a layout without
invalidation.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16738
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-10-04 Darin Adler <darin@apple.com>
+
+ Reviewed by Geoff.
+
+ - fix http://bugs.webkit.org/show_bug.cgi?id=11132
+ Caret disappears when you're typing
+
+ * editing/SelectionController.cpp:
+ (WebCore::SelectionController::setSelection): Remove unnecessary call to
+ clearCaretRectIfNeeded. The recomputeCaretRect now takes care of this.
+ (WebCore::SelectionController::recomputeCaretRect): Explicitly set m_needsLayout
+ to false so we can get the old caret repaint rect. Later we need to change the
+ design so getting the rect doesn't have a side effect of causing a layout without
+ invalidation.
+
2006-10-03 David Harrison <harrison@apple.com>
Reviewed by Maciej.
if (m_sel == s)
return;
- m_frame->clearCaretRectIfNeeded();
-
Selection oldSelection = m_sel;
m_sel = s;
if (!m_needsLayout)
return false;
+ // Set m_needsLayout to false to get the "old" repaint rect,
+ // since caretRepaintRect currently recomputes the rect if
+ // m_needsLayout is true. It's a problem if that ever happens
+ // outside this function, so we need to change that design in
+ // the future.
+ m_needsLayout = false;
IntRect oldRect = caretRepaintRect();
- layout();
+ m_needsLayout = true;
IntRect newRect = caretRepaintRect();
if (oldRect == newRect)
return false;