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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBlock.cpp

Issue 2665823002: Invalidate caret during paint invalidation (Closed)
Patch Set: Rebaseline Created 3 years, 11 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 b826a3e0771feb27c2a01a0ab53f9e5245428e6c..f68b03126a1528907fc2446ca1824178dc1ec9dc 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
@@ -100,7 +100,9 @@ LayoutBlock::LayoutBlock(ContainerNode* node)
m_descendantsWithFloatsMarkedForLayout(false),
m_hasPositionedObjects(false),
m_hasPercentHeightDescendants(false),
- m_paginationStateChanged(false) {
+ m_paginationStateChanged(false),
+ m_hasPreviousCaretVisualRects(false),
+ m_caretsNeedPaintInvalidation(false) {
// LayoutBlockFlow calls setChildrenInline(true).
// By default, subclasses do not have inline children.
}
@@ -131,6 +133,8 @@ LayoutBlock::~LayoutBlock() {
}
void LayoutBlock::willBeDestroyed() {
+ BlockPaintInvalidator::blockWillBeDestroyed(*this);
+
if (!documentBeingDestroyed() && parent())
parent()->dirtyLinesFromChangedChild(this);
@@ -207,6 +211,10 @@ void LayoutBlock::styleDidChange(StyleDifference diff,
const ComputedStyle* oldStyle) {
LayoutBox::styleDidChange(diff, oldStyle);
+ // Carets are painted in text color.
+ if (diff.textDecorationOrColorChanged() && hasCaret())
+ setCaretsNeedPaintInvalidation();
+
const ComputedStyle& newStyle = styleRef();
if (oldStyle && parent()) {
@@ -1027,6 +1035,11 @@ PaintInvalidationReason LayoutBlock::invalidatePaintIfNeeded(
return BlockPaintInvalidator(*this, context).invalidatePaintIfNeeded();
}
+void LayoutBlock::clearPreviousVisualRects() {
+ LayoutBox::clearPreviousVisualRects();
+ BlockPaintInvalidator::clearPreviousCaretVisualRects(*this);
+}
+
void LayoutBlock::removePositionedObjects(
LayoutObject* o,
ContainingBlockState containingBlockState) {

Powered by Google App Engine
This is Rietveld 408576698