From 635860845790a19bf50bbc51ba8fb66a96dde068 Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Thu, 5 Mar 2009 14:34:32 -0800 Subject: auto import from //depot/cupcake/@136594 --- WebCore/editing/SelectionController.h | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'WebCore/editing/SelectionController.h') diff --git a/WebCore/editing/SelectionController.h b/WebCore/editing/SelectionController.h index ba89670..fe5e90d 100644 --- a/WebCore/editing/SelectionController.h +++ b/WebCore/editing/SelectionController.h @@ -57,7 +57,7 @@ public: void moveTo(const Position&, const Position&, EAffinity, bool userTriggered = false); const Selection& selection() const { return m_sel; } - void setSelection(const Selection&, bool closeTyping = true, bool clearTypingStyleAndRemovedAnchor = true, bool userTriggered = false); + void setSelection(const Selection&, bool closeTyping = true, bool clearTypingStyle = true, bool userTriggered = false); bool setSelectedRange(Range*, EAffinity, bool closeTyping); void selectAll(); void clear(); @@ -85,7 +85,13 @@ public: Position start() const { return m_sel.start(); } Position end() const { return m_sel.end(); } - IntRect caretRect() const; + // Return the renderer that is responsible for painting the caret (in the selection start node) + RenderObject* caretRenderer() const; + + // Caret rect local to the caret's renderer + IntRect localCaretRect() const; + // Bounds of (possibly transformed) caret in absolute coords + IntRect absoluteCaretBounds(); void setNeedsLayout(bool flag = true); void setLastChangeWasHorizontalExtension(bool b) { m_lastChangeWasHorizontalExtension = b; } @@ -96,7 +102,6 @@ public: bool isRange() const { return m_sel.isRange(); } bool isCaretOrRange() const { return m_sel.isCaretOrRange(); } bool isInPasswordField() const; - bool isInsideNode() const; PassRefPtr toRange() const { return m_sel.toRange(); } @@ -106,7 +111,7 @@ public: bool recomputeCaretRect(); // returns true if caret rect moved void invalidateCaretRect(); - void paintCaret(GraphicsContext*, const IntRect&); + void paintCaret(GraphicsContext*, int tx, int ty, const IntRect& clipRect); // Used to suspend caret blinking while the mouse is down. void setCaretBlinkingSuspended(bool suspended) { m_isCaretBlinkingSuspended = suspended; } @@ -144,25 +149,23 @@ private: #endif void focusedOrActiveStateChanged(); + bool caretRendersInsideNode(Node*) const; + + Frame* m_frame; + int m_xPosForVerticalArrowNavigation; Selection m_sel; - IntRect m_caretRect; // caret coordinates, size, and position - - // m_caretPositionOnLayout stores the scroll offset on the previous call to SelectionController::layout(). - // When asked for caretRect(), we correct m_caretRect for offset due to scrolling since the last layout(). - // This is faster than doing another layout(). - IntPoint m_caretPositionOnLayout; + IntRect m_caretRect; // caret rect in coords local to the renderer responsible for painting the caret + IntRect m_absCaretBounds; // absolute bounding rect for the caret bool m_needsLayout : 1; // true if the caret and expectedVisible rectangles need to be calculated + bool m_absCaretBoundsDirty: 1; bool m_lastChangeWasHorizontalExtension : 1; - Frame* m_frame; - bool m_isDragCaretController; + bool m_isDragCaretController : 1; + bool m_isCaretBlinkingSuspended : 1; + bool m_focused : 1; - bool m_isCaretBlinkingSuspended; - - int m_xPosForVerticalArrowNavigation; - bool m_focused; }; inline bool operator==(const SelectionController& a, const SelectionController& b) -- cgit v1.1