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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBlock.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/layout/LayoutBlock.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
index 8d111bb57d37d7b494d39004698e14fae44abb4b..6853f96f2562e19d9dd195e25593dac6c11269b3 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
@@ -134,6 +134,11 @@ void LayoutBlock::willBeDestroyed() {
if (!documentBeingDestroyed() && parent())
parent()->dirtyLinesFromChangedChild(this);
+ if (LocalFrame* frame = this->frame()) {
+ frame->selection().layoutBlockWillBeDestroyed(*this);
+ frame->page()->dragCaret().layoutBlockWillBeDestroyed(*this);
+ }
+
if (TextAutosizer* textAutosizer = document().textAutosizer())
textAutosizer->destroy(this);
@@ -1024,7 +1029,12 @@ PaintInvalidationReason LayoutBlock::invalidatePaintIfNeeded(
PaintInvalidationReason LayoutBlock::invalidatePaintIfNeeded(
const PaintInvalidatorContext& context) const {
- return BlockPaintInvalidator(*this, context).invalidatePaintIfNeeded();
+ return BlockPaintInvalidator(*this).invalidatePaintIfNeeded(context);
+}
+
+void LayoutBlock::clearPreviousVisualRects() {
+ LayoutBox::clearPreviousVisualRects();
+ BlockPaintInvalidator(*this).clearPreviousVisualRects();
}
void LayoutBlock::removePositionedObjects(
@@ -1842,15 +1852,12 @@ inline bool LayoutBlock::isInlineBoxWrapperActuallyChild() const {
editingIgnoresContent(*node());
}
-bool LayoutBlock::hasCursorCaret() const {
- LocalFrame* frame = this->frame();
- return frame->selection().hasCaretIn(*this);
+bool LayoutBlock::shouldPaintCursorCaret() const {
+ return frame()->selection().shouldPaintCaret(*this);
}
-bool LayoutBlock::hasDragCaret() const {
- LocalFrame* frame = this->frame();
- DragCaret& dragCaret = frame->page()->dragCaret();
- return dragCaret.hasCaretIn(*this);
+bool LayoutBlock::shouldPaintDragCaret() const {
+ return frame()->page()->dragCaret().shouldPaintCaret(*this);
}
LayoutRect LayoutBlock::localCaretRect(InlineBox* inlineBox,
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.h ('k') | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698