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

Unified Diff: sky/engine/core/editing/Caret.cpp

Issue 845093002: Delete an assortment of unneeded paint invalidation code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « sky/engine/core/editing/Caret.h ('k') | sky/engine/core/editing/FrameSelection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/editing/Caret.cpp
diff --git a/sky/engine/core/editing/Caret.cpp b/sky/engine/core/editing/Caret.cpp
index c3d6b77f3ad374352b4c8116217342630e22bed2..d3e7cb0279ec9d996b84dad1b0b269c229c51c4d 100644
--- a/sky/engine/core/editing/Caret.cpp
+++ b/sky/engine/core/editing/Caret.cpp
@@ -61,13 +61,10 @@ bool DragCaretController::isContentRichlyEditable() const
void DragCaretController::setCaretPosition(const VisiblePosition& position)
{
- if (Node* node = m_position.deepEquivalent().deprecatedNode())
- invalidateCaretRect(node);
m_position = position;
setCaretRectNeedsUpdate();
Document* document = 0;
if (Node* node = m_position.deepEquivalent().deprecatedNode()) {
- invalidateCaretRect(node);
document = &node->document();
}
if (m_position.isNull() || m_position.isOrphan()) {
@@ -184,42 +181,6 @@ IntRect CaretBase::absoluteBoundsForLocalRect(Node* node, const LayoutRect& rect
return caretPainter->localToAbsoluteQuad(FloatRect(rect)).enclosingBoundingBox();
}
-void CaretBase::invalidateLocalCaretRect(Node* node, const LayoutRect& rect)
-{
- RenderBlock* caretPainter = caretRenderer(node);
- if (!caretPainter)
- return;
-
- // FIXME: Need to over-paint 1 pixel to workaround some rounding problems.
- // https://bugs.webkit.org/show_bug.cgi?id=108283
- LayoutRect inflatedRect = rect;
- inflatedRect.inflate(1);
-
- caretPainter->invalidatePaintRectangle(inflatedRect);
-}
-
-void CaretBase::invalidateCaretRect(Node* node, bool caretRectChanged)
-{
- // EDIT FIXME: This is an unfortunate hack.
- // Basically, we can't trust this layout position since we
- // can't guarantee that the check to see if we are in unrendered
- // content will work at this point. We may have to wait for
- // a layout and re-render of the document to happen. So, resetting this
- // flag will cause another caret layout to happen the first time
- // that we try to paint the caret after this call. That one will work since
- // it happens after the document has accounted for any editing
- // changes which may have been done.
- // And, we need to leave this layout here so the caret moves right
- // away after clicking.
- m_caretRectNeedsUpdate = true;
-
- if (caretRectChanged)
- return;
-
- if (node->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable))
- invalidateLocalCaretRect(node, localCaretRectWithoutUpdate());
-}
-
void CaretBase::paintCaret(Node* node, GraphicsContext* context, const LayoutPoint& paintOffset, const LayoutRect& clipRect) const
{
if (m_caretVisibility == Hidden)
« no previous file with comments | « sky/engine/core/editing/Caret.h ('k') | sky/engine/core/editing/FrameSelection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698