| Index: third_party/WebKit/Source/core/editing/CaretDisplayItemClient.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/CaretDisplayItemClient.cpp b/third_party/WebKit/Source/core/editing/CaretDisplayItemClient.cpp
|
| index 0990fdef8cabca9e3bf7024048e5965ca2a6dc46..5ad7545aacdc5e40134ea7e5d061d97a20c9218e 100644
|
| --- a/third_party/WebKit/Source/core/editing/CaretDisplayItemClient.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/CaretDisplayItemClient.cpp
|
| @@ -133,9 +133,17 @@ void CaretDisplayItemClient::updateStyleAndLayoutIfNeeded(
|
| if (m_layoutBlock)
|
| m_layoutBlock->setMayNeedPaintInvalidation();
|
| m_layoutBlock = newLayoutBlock;
|
| - if (newLayoutBlock)
|
| - m_needsPaintInvalidation = true;
|
| m_visualRect = LayoutRect();
|
| + if (newLayoutBlock) {
|
| + m_needsPaintInvalidation = true;
|
| + if (newLayoutBlock == m_previousLayoutBlock) {
|
| + // The caret has disappeared and is reappearing in the same block,
|
| + // since the last paint invalidation. Set m_visualRect as if the caret
|
| + // has always been there as paint invalidation doesn't care about the
|
| + // intermediate changes.
|
| + m_visualRect = m_visualRectInPreviousLayoutBlock;
|
| + }
|
| + }
|
| }
|
|
|
| if (!newLayoutBlock) {
|
|
|