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

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

Issue 431983005: FrameSelection::updateApperance for caret should not cause layout. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Let FrameSelection rember the previous rect. Created 6 years, 4 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: Source/core/editing/FrameSelection.h
diff --git a/Source/core/editing/FrameSelection.h b/Source/core/editing/FrameSelection.h
index ebffebe35f6ffa60f3aa7b1f63c8f5b722ede3d2..1b8f46dd537ec543924d869255ac94952b72dc7a 100644
--- a/Source/core/editing/FrameSelection.h
+++ b/Source/core/editing/FrameSelection.h
@@ -89,6 +89,10 @@ public:
NonDirectional,
Directional
};
+ enum UpdateAppearanceOption {
+ None,
+ ResetCaretBlink
+ };
abarth-chromium 2014/08/13 20:42:44 Why do we need this option?
yoichio 2014/08/13 21:43:32 To use restart caret blinking, for example, moving
Element* rootEditableElement() const { return m_selection.rootEditableElement(); }
Element* rootEditableElementOrDocumentElement() const;
@@ -139,13 +143,8 @@ public:
// Return the renderer that is responsible for painting the caret (in the selection start node)
RenderBlock* caretRenderer() const;
- // Caret rect local to the caret's renderer
- LayoutRect localCaretRect();
- LayoutRect localCaretRectWithoutUpdateForTesting() const { return CaretBase::localCaretRectWithoutUpdate(); }
-
// Bounds of (possibly transformed) caret in absolute coords
IntRect absoluteCaretBounds();
- void setCaretRectNeedsUpdate() { CaretBase::setCaretRectNeedsUpdate(); }
void didChangeFocus();
void willBeModified(EAlteration, SelectionDirection);
@@ -168,8 +167,12 @@ public:
void didMergeTextNodes(const Text& oldNode, unsigned offset);
void didSplitTextNode(const Text& oldNode);
+ // Painting.
+ void updateAppearance(UpdateAppearanceOption = None);
abarth-chromium 2014/08/13 20:42:44 What does updateAppearance do? Does it update the
yoichio 2014/08/13 21:43:32 Yes, it updates. The name was confusing. Renamed.
void setCaretVisible(bool caretIsVisible) { setCaretVisibility(caretIsVisible ? Visible : Hidden); }
- bool recomputeCaretRect();
+ bool isCaretBoundsDirty() const { return m_caretRectDirty; }
+ void setCaretRectNeedsUpdate();
+ void scheduleVisualUpdate() const;
void invalidateCaretRect();
void paintCaret(GraphicsContext*, const LayoutPoint&, const LayoutRect& clipRect);
@@ -183,8 +186,7 @@ public:
bool isFocusedAndActive() const;
void pageActivationChanged();
- // Painting.
- void updateAppearance();
+
void updateSecureKeyboardEntryIfActive();
@@ -280,13 +282,13 @@ private:
RefPtrWillBeMember<Range> m_logicalRange;
RefPtrWillBeMember<Node> m_previousCaretNode; // The last node which painted the caret. Retained for clearing the old caret when it moves.
+ LayoutRect m_previousCaretRect;
RefPtrWillBeMember<EditingStyle> m_typingStyle;
Timer<FrameSelection> m_caretBlinkTimer;
- // The painted bounds of the caret in absolute coordinates
- IntRect m_absCaretBounds;
- bool m_absCaretBoundsDirty : 1;
+
+ bool m_caretRectDirty : 1;
bool m_caretPaint : 1;
bool m_isCaretBlinkingSuspended : 1;
bool m_focused : 1;

Powered by Google App Engine
This is Rietveld 408576698