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

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

Issue 2312383002: Make CaretBase a DisplayItemClient. (Closed)
Patch Set: Created 4 years, 3 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 754ba3498df89678cbba151237cb7186ba27e57c..9b9e41c7a30406bdfec182440e7f44e93e166b1d 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
@@ -226,6 +226,15 @@ void LayoutBlock::styleDidChange(StyleDifference diff, const ComputedStyle* oldS
m_heightAvailableToChildrenChanged |= oldStyle && diff.needsFullLayout() && needsLayout() && borderOrPaddingLogicalDimensionChanged(*oldStyle, newStyle, LogicalHeight);
}
+void LayoutBlock::invalidateCaret() const
+{
+ if (hasCaret()) {
+ ObjectPaintInvalidator(*this).slowSetPaintingLayerNeedsRepaint();
+ frame()->selection().setCaretRectNeedsUpdate();
+ frame()->selection().invalidateCaretRect(true);
+ }
+}
+
void LayoutBlock::updateFromStyle()
{
LayoutBox::updateFromStyle();
@@ -922,6 +931,14 @@ void LayoutBlock::removePositionedObject(LayoutBox* o)
}
}
+PaintInvalidationReason LayoutBlock::invalidatePaintIfNeeded(const PaintInvalidationState& paintInvalidationState)
+{
+ PaintInvalidationReason reason = LayoutBox::invalidatePaintIfNeeded(paintInvalidationState);
+ if (reason != PaintInvalidationNone)
+ invalidateCaret();
+ return reason;
+}
+
void LayoutBlock::removePositionedObjects(LayoutBlock* o, ContainingBlockState containingBlockState)
{
TrackedLayoutBoxListHashSet* positionedDescendants = positionedObjects();
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.h ('k') | third_party/WebKit/Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698