Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Unified Diff: third_party/WebKit/Source/core/editing/FrameSelection.cpp

Issue 1931513003: Invalidate the previous caret location when editing text nodes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/FrameSelection.cpp
diff --git a/third_party/WebKit/Source/core/editing/FrameSelection.cpp b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
index 02fd9921d87ecfd72dc766d6b7e02429d59dab69..e19f7cfd33a16e8947b7e9b36a9aef7cb2f98ee2 100644
--- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
@@ -731,6 +731,15 @@ void FrameSelection::invalidateCaretRect()
m_previousCaretVisibility = m_caretBase->getCaretVisibility();
}
+void FrameSelection::dataWillChange(const CharacterData& node)
+{
+ if (node == m_previousCaretNode) {
+ // This invalidation is eager, and intentionally uses stale state.
+ DisableCompositingQueryAsserts disabler;
+ m_caretBase->invalidateLocalCaretRect(m_previousCaretNode.get(), m_previousCaretRect);
+ }
+}
+
void FrameSelection::paintCaret(GraphicsContext& context, const LayoutPoint& paintOffset)
{
if (selection().isCaret() && m_shouldPaintCaret) {
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698