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 f9e3ba0e3c77930a62846a3d3fc637387c6cbd26..4645c46efdc57c4a5d1fa7c63d09bcd1c8eec84e 100644 |
--- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp |
+++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp |
@@ -405,6 +405,15 @@ void FrameSelection::nodeWillBeRemoved(Node& node) |
respondToNodeModification(node, removingNodeRemovesPosition(node, selection().base()), removingNodeRemovesPosition(node, selection().extent()), |
removingNodeRemovesPosition(node, selection().start()), removingNodeRemovesPosition(node, selection().end())); |
+ |
+ if (node == m_previousCaretNode) { |
+ // Hits in ManualTests/caret-paint-after-last-text-is-removed.html |
+ DisableCompositingQueryAsserts disabler; |
+ invalidateLocalCaretRect(m_previousCaretNode.get(), m_previousCaretRect); |
+ m_previousCaretNode = nullptr; |
+ m_previousCaretRect = LayoutRect(); |
+ m_previousCaretVisibility = Hidden; |
+ } |
} |
static bool intersectsNode(const VisibleSelection& selection, Node* node) |