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

Unified Diff: third_party/WebKit/Source/core/editing/FrameCaret.h

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/editing/FrameCaret.h
diff --git a/third_party/WebKit/Source/core/editing/FrameCaret.h b/third_party/WebKit/Source/core/editing/FrameCaret.h
index cbe7ead1804cc3b831d1a45a04d6299c70f24b72..1bec7be8854d90b1d7a695c39f117beef78efb42 100644
--- a/third_party/WebKit/Source/core/editing/FrameCaret.h
+++ b/third_party/WebKit/Source/core/editing/FrameCaret.h
@@ -38,11 +38,10 @@
namespace blink {
class CaretDisplayItemClient;
-class CharacterData;
class DisplayItemClient;
class Document;
class GraphicsContext;
-class Node;
+class LayoutBlock;
class LocalFrame;
class SelectionEditor;
@@ -57,7 +56,9 @@ class CORE_EXPORT FrameCaret final
FrameCaret(LocalFrame&, const SelectionEditor&);
~FrameCaret();
- const DisplayItemClient& displayItemClient() const;
+ void setVisualRect(const LayoutRect&);
+ const DisplayItemClient& getDisplayItemClient() const;
+
bool isActive() const { return caretPosition().isNotNull(); }
void documentAttached(Document*);
@@ -70,24 +71,23 @@ class CORE_EXPORT FrameCaret final
bool isCaretBlinkingSuspended() const { return m_isCaretBlinkingSuspended; }
void stopCaretBlinkTimer();
void startBlinkCaret();
-
void setCaretVisibility(CaretVisibility);
- void setCaretRectNeedsUpdate();
- // If |forceInvalidation| is true the caret's previous and new rectangles
- // are forcibly invalidated regardless of the state of the blink timer.
- void invalidateCaretRect(bool forceInvalidation);
IntRect absoluteCaretBounds() const;
+ // Return the caret rect in local coordinate space of |caretLayoutBlock|.
wkorman 2017/01/31 20:40:28 Suggest adding to comment to define rect more expl
+ LayoutRect caretLocalRect() const;
+ LayoutBlock* caretLayoutBlock() const;
+
+ void setMayNeedPaintInvalidation();
+ void setNeedsPaintInvalidation();
+
bool shouldShowBlockCursor() const { return m_shouldShowBlockCursor; }
void setShouldShowBlockCursor(bool);
void paintCaret(GraphicsContext&, const LayoutPoint&);
- void dataWillChange(const CharacterData&);
-
// For unittests
bool shouldPaintCaretForTesting() const { return m_shouldPaintCaret; }
- bool isPreviousCaretDirtyForTesting() const { return m_previousCaretNode; }
DECLARE_TRACE();
@@ -102,21 +102,15 @@ class CORE_EXPORT FrameCaret final
// Implementation of |SynchronousMutationObserver| member functions.
void contextDestroyed(Document*) final;
yosin_UTC9 2017/01/31 20:12:58 Since FrameCaret doesn't hold |Node| anymore, Fram
Xianzhu 2017/02/02 23:42:06 Great. Done.
- void nodeWillBeRemoved(Node&) final;
+
+ void scheduleVisualUpdate();
const Member<const SelectionEditor> m_selectionEditor;
const Member<LocalFrame> m_frame;
const std::unique_ptr<CaretDisplayItemClient> m_caretBase;
- // The last node which painted the caret. Retained for clearing the old
- // caret when it moves.
- Member<Node> m_previousCaretNode;
- Member<Node> m_previousCaretAnchorNode;
- LayoutRect m_previousCaretRect;
CaretVisibility m_caretVisibility;
- CaretVisibility m_previousCaretVisibility;
// TODO(https://crbug.com/668758): Consider using BeginFrame update for this.
TaskRunnerTimer<FrameCaret> m_caretBlinkTimer;
- bool m_caretRectDirty : 1;
bool m_shouldPaintCaret : 1;
bool m_isCaretBlinkingSuspended : 1;
bool m_shouldShowBlockCursor : 1;

Powered by Google App Engine
This is Rietveld 408576698