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

Unified Diff: third_party/WebKit/Source/core/paint/BlockPaintInvalidator.cpp

Issue 2665823002: Invalidate caret during paint invalidation (Closed)
Patch Set: NeedsRebaseline Created 3 years, 10 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
Index: third_party/WebKit/Source/core/paint/BlockPaintInvalidator.cpp
diff --git a/third_party/WebKit/Source/core/paint/BlockPaintInvalidator.cpp b/third_party/WebKit/Source/core/paint/BlockPaintInvalidator.cpp
index b64c32efdcfffe4881adadce03d35816fc869609..a7db1ebc07582f9155c043387afdb4ca3b9cccfa 100644
--- a/third_party/WebKit/Source/core/paint/BlockPaintInvalidator.cpp
+++ b/third_party/WebKit/Source/core/paint/BlockPaintInvalidator.cpp
@@ -4,23 +4,32 @@
#include "core/paint/BlockPaintInvalidator.h"
+#include "core/editing/DragCaret.h"
#include "core/editing/FrameSelection.h"
#include "core/frame/LocalFrame.h"
#include "core/layout/LayoutBlock.h"
+#include "core/page/Page.h"
#include "core/paint/BoxPaintInvalidator.h"
+#include "core/paint/ObjectPaintInvalidator.h"
#include "core/paint/PaintInvalidator.h"
namespace blink {
-PaintInvalidationReason BlockPaintInvalidator::invalidatePaintIfNeeded() {
+void BlockPaintInvalidator::clearPreviousVisualRects() {
+ m_block.frame()->selection().clearPreviousCaretVisualRect(m_block);
+ m_block.frame()->page()->dragCaret().clearPreviousVisualRect(m_block);
+}
+
+PaintInvalidationReason BlockPaintInvalidator::invalidatePaintIfNeeded(
+ const PaintInvalidatorContext& context) {
PaintInvalidationReason reason =
- BoxPaintInvalidator(m_block, m_context).invalidatePaintIfNeeded();
+ BoxPaintInvalidator(m_block, context).invalidatePaintIfNeeded();
+
+ m_block.frame()->selection().invalidatePaintIfNeeded(m_block, context,
+ reason);
+ m_block.frame()->page()->dragCaret().invalidatePaintIfNeeded(m_block, context,
+ reason);
- if (reason != PaintInvalidationNone && m_block.hasCaret()) {
- FrameSelection& selection = m_block.frame()->selection();
- selection.setCaretRectNeedsUpdate();
- selection.invalidateCaretRect(true);
- }
return reason;
}
}

Powered by Google App Engine
This is Rietveld 408576698