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

Unified Diff: Source/core/editing/Caret.h

Issue 1226833007: Add CaretBase::m_caretPainter, and compute caretBrowsing lazily. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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 | « no previous file | Source/core/editing/Caret.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/Caret.h
diff --git a/Source/core/editing/Caret.h b/Source/core/editing/Caret.h
index b411e3f411555e53718ac706c43eac063f1b3c8b..4331e54b6b613db145f7e9c449ee19db9bf73e02 100644
--- a/Source/core/editing/Caret.h
+++ b/Source/core/editing/Caret.h
@@ -59,16 +59,17 @@ protected:
void paintCaret(Node*, GraphicsContext*, const LayoutPoint&, const LayoutRect& clipRect) const;
const LayoutRect& localCaretRectWithoutUpdate() const { return m_caretLocalRect; }
+ LayoutBlock* caretPainter() const { return m_caretPainter; }
void setCaretVisibility(CaretVisibility visibility) { m_caretVisibility = visibility; }
bool caretIsVisible() const { return m_caretVisibility == Visible; }
CaretVisibility caretVisibility() const { return m_caretVisibility; }
-protected:
static LayoutBlock* caretLayoutObject(Node*);
static void invalidateLocalCaretRect(Node*, const LayoutRect&);
private:
+ LayoutBlock* m_caretPainter; // layout object responsible for painting the caret
LayoutRect m_caretLocalRect; // caret rect in coords local to the layoutObject responsible for painting the caret
CaretVisibility m_caretVisibility;
};
@@ -79,7 +80,7 @@ class DragCaretController final : public NoBaseWillBeGarbageCollected<DragCaretC
public:
static PassOwnPtrWillBeRawPtr<DragCaretController> create();
- LayoutBlock* caretLayoutObject() const;
+ LayoutBlock* caretLayoutObject() const { return CaretBase::caretPainter(); }
void paintDragCaret(LocalFrame*, GraphicsContext*, const LayoutPoint&, const LayoutRect& clipRect) const;
bool isContentEditable() const { return m_position.rootEditableElement(); }
« no previous file with comments | « no previous file | Source/core/editing/Caret.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698