OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 WTF_MAKE_NONCOPYABLE(CaretBase); | 58 WTF_MAKE_NONCOPYABLE(CaretBase); |
59 WTF_MAKE_FAST_ALLOCATED; | 59 WTF_MAKE_FAST_ALLOCATED; |
60 protected: | 60 protected: |
61 enum CaretVisibility { Visible, Hidden }; | 61 enum CaretVisibility { Visible, Hidden }; |
62 explicit CaretBase(CaretVisibility = Hidden); | 62 explicit CaretBase(CaretVisibility = Hidden); |
63 | 63 |
64 void invalidateCaretRect(Node*, bool caretRectChanged = false); | 64 void invalidateCaretRect(Node*, bool caretRectChanged = false); |
65 void clearCaretRect(); | 65 void clearCaretRect(); |
66 bool updateCaretRect(Document*, const VisiblePosition& caretPosition); | 66 bool updateCaretRect(Document*, const VisiblePosition& caretPosition); |
67 IntRect absoluteBoundsForLocalRect(Node*, const LayoutRect&) const; | 67 IntRect absoluteBoundsForLocalRect(Node*, const LayoutRect&) const; |
68 IntRect caretRepaintRect(Node*) const; | |
69 bool shouldRepaintCaret(const RenderView*, bool isContentEditable) const; | 68 bool shouldRepaintCaret(const RenderView*, bool isContentEditable) const; |
70 void paintCaret(Node*, GraphicsContext*, const LayoutPoint&, const LayoutRec
t& clipRect) const; | 69 void paintCaret(Node*, GraphicsContext*, const LayoutPoint&, const LayoutRec
t& clipRect) const; |
71 RenderObject* caretRenderer(Node*) const; | |
72 | 70 |
73 const LayoutRect& localCaretRectWithoutUpdate() const { return m_caretLocalR
ect; } | 71 const LayoutRect& localCaretRectWithoutUpdate() const { return m_caretLocalR
ect; } |
74 | 72 |
75 bool shouldUpdateCaretRect() const { return m_caretRectNeedsUpdate; } | 73 bool shouldUpdateCaretRect() const { return m_caretRectNeedsUpdate; } |
76 void setCaretRectNeedsUpdate() { m_caretRectNeedsUpdate = true; } | 74 void setCaretRectNeedsUpdate() { m_caretRectNeedsUpdate = true; } |
77 | 75 |
78 void setCaretVisibility(CaretVisibility visibility) { m_caretVisibility = vi
sibility; } | 76 void setCaretVisibility(CaretVisibility visibility) { m_caretVisibility = vi
sibility; } |
79 bool caretIsVisible() const { return m_caretVisibility == Visible; } | 77 bool caretIsVisible() const { return m_caretVisibility == Visible; } |
80 CaretVisibility caretVisibility() const { return m_caretVisibility; } | 78 CaretVisibility caretVisibility() const { return m_caretVisibility; } |
81 | 79 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 bool visualWordMovementEnabled() const; | 293 bool visualWordMovementEnabled() const; |
296 | 294 |
297 Frame* m_frame; | 295 Frame* m_frame; |
298 | 296 |
299 LayoutUnit m_xPosForVerticalArrowNavigation; | 297 LayoutUnit m_xPosForVerticalArrowNavigation; |
300 | 298 |
301 VisibleSelection m_selection; | 299 VisibleSelection m_selection; |
302 VisiblePosition m_originalBase; // Used to store base before the adjustment
at bidi boundary | 300 VisiblePosition m_originalBase; // Used to store base before the adjustment
at bidi boundary |
303 TextGranularity m_granularity; | 301 TextGranularity m_granularity; |
304 | 302 |
| 303 RefPtr<Node> m_previousCaretNode; // The last node which painted the caret.
Retained for clearing the old caret when it moves. |
| 304 |
305 RefPtr<EditingStyle> m_typingStyle; | 305 RefPtr<EditingStyle> m_typingStyle; |
306 | 306 |
307 Timer<FrameSelection> m_caretBlinkTimer; | 307 Timer<FrameSelection> m_caretBlinkTimer; |
308 // The painted bounds of the caret in absolute coordinates | 308 // The painted bounds of the caret in absolute coordinates |
309 IntRect m_absCaretBounds; | 309 IntRect m_absCaretBounds; |
310 // Similar to above, but inflated to ensure proper repaint (see https://bugs
.webkit.org/show_bug.cgi?id=19086) | |
311 IntRect m_absoluteCaretRepaintBounds; | |
312 bool m_absCaretBoundsDirty : 1; | 310 bool m_absCaretBoundsDirty : 1; |
313 bool m_caretPaint : 1; | 311 bool m_caretPaint : 1; |
314 bool m_isCaretBlinkingSuspended : 1; | 312 bool m_isCaretBlinkingSuspended : 1; |
315 bool m_focused : 1; | 313 bool m_focused : 1; |
316 }; | 314 }; |
317 | 315 |
318 inline EditingStyle* FrameSelection::typingStyle() const | 316 inline EditingStyle* FrameSelection::typingStyle() const |
319 { | 317 { |
320 return m_typingStyle.get(); | 318 return m_typingStyle.get(); |
321 } | 319 } |
(...skipping 16 matching lines...) Expand all Loading... |
338 | 336 |
339 } // namespace WebCore | 337 } // namespace WebCore |
340 | 338 |
341 #ifndef NDEBUG | 339 #ifndef NDEBUG |
342 // Outside the WebCore namespace for ease of invocation from gdb. | 340 // Outside the WebCore namespace for ease of invocation from gdb. |
343 void showTree(const WebCore::FrameSelection&); | 341 void showTree(const WebCore::FrameSelection&); |
344 void showTree(const WebCore::FrameSelection*); | 342 void showTree(const WebCore::FrameSelection*); |
345 #endif | 343 #endif |
346 | 344 |
347 #endif // FrameSelection_h | 345 #endif // FrameSelection_h |
OLD | NEW |