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

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

Issue 2739253002: Fix another caret paint invalidation issue (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | third_party/WebKit/Source/core/editing/CaretDisplayItemClientTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..acfba08a8a77946c83601c948e92ceb4c38511ea 100644
--- a/third_party/WebKit/Source/core/editing/CaretDisplayItemClient.cpp
+++ b/third_party/WebKit/Source/core/editing/CaretDisplayItemClient.cpp
@@ -125,6 +125,7 @@ void CaretDisplayItemClient::updateStyleAndLayoutIfNeeded(
// intermediate changes of layoutBlock because they are not painted.
if (!m_previousLayoutBlock) {
m_previousLayoutBlock = m_layoutBlock;
+ DCHECK(m_visualRectInPreviousLayoutBlock.isEmpty());
m_visualRectInPreviousLayoutBlock = m_visualRect;
}
@@ -191,6 +192,7 @@ void CaretDisplayItemClient::invalidatePaintInPreviousLayoutBlock(
context.paintingLayer->setNeedsRepaint();
objectInvalidator.invalidateDisplayItemClient(*this, PaintInvalidationCaret);
m_previousLayoutBlock = nullptr;
+ m_visualRectInPreviousLayoutBlock = LayoutRect();
}
void CaretDisplayItemClient::invalidatePaintInCurrentLayoutBlock(
@@ -212,8 +214,11 @@ void CaretDisplayItemClient::invalidatePaintInCurrentLayoutBlock(
}
}
- if (m_layoutBlock == m_previousLayoutBlock)
+ if (m_layoutBlock == m_previousLayoutBlock &&
+ m_visualRect == m_visualRectInPreviousLayoutBlock) {
chrishtr 2017/03/10 05:06:07 Why is this conditional required? Can't figure thi
m_previousLayoutBlock = nullptr;
+ m_visualRectInPreviousLayoutBlock = LayoutRect();
+ }
ObjectPaintInvalidatorWithContext objectInvalidator(*m_layoutBlock, context);
if (!m_needsPaintInvalidation && newVisualRect == m_visualRect) {
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/CaretDisplayItemClientTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698