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

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

Issue 1950473002: Invalidate the previous caret location when editing text nodes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
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 e26488ebe4424e0bab75c793ed08199a137e74b2..ea08e76c8afb43e642169a58f03989b5998b06b0 100644
--- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
@@ -733,6 +733,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