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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 void invalidateCaretRect(Node*, bool caretRectChanged = false); | 50 void invalidateCaretRect(Node*, bool caretRectChanged = false); |
51 void clearCaretRect(); | 51 void clearCaretRect(); |
52 // Creating VisiblePosition causes synchronous layout so we should use the | 52 // Creating VisiblePosition causes synchronous layout so we should use the |
53 // PositionWithAffinity version if possible. | 53 // PositionWithAffinity version if possible. |
54 // A position in HTMLTextFromControlElement is a typical example. | 54 // A position in HTMLTextFromControlElement is a typical example. |
55 bool updateCaretRect(const PositionWithAffinity& caretPosition); | 55 bool updateCaretRect(const PositionWithAffinity& caretPosition); |
56 bool updateCaretRect(const VisiblePosition& caretPosition); | 56 bool updateCaretRect(const VisiblePosition& caretPosition); |
57 IntRect absoluteBoundsForLocalRect(Node*, const LayoutRect&) const; | 57 IntRect absoluteBoundsForLocalRect(Node*, const LayoutRect&) const; |
58 bool shouldRepaintCaret(Node&) const; | 58 bool shouldRepaintCaret(Node&) const; |
59 bool shouldRepaintCaret(const LayoutView*) const; | 59 bool shouldRepaintCaret(const LayoutView*) const; |
60 void paintCaret(Node*, GraphicsContext*, const LayoutPoint&) const; | 60 void paintCaret(Node*, GraphicsContext&, const LayoutPoint&) const; |
61 | 61 |
62 const LayoutRect& localCaretRectWithoutUpdate() const { return m_caretLocalR
ect; } | 62 const LayoutRect& localCaretRectWithoutUpdate() const { return m_caretLocalR
ect; } |
63 | 63 |
64 void setCaretVisibility(CaretVisibility visibility) { m_caretVisibility = vi
sibility; } | 64 void setCaretVisibility(CaretVisibility visibility) { m_caretVisibility = vi
sibility; } |
65 bool caretIsVisible() const { return m_caretVisibility == Visible; } | 65 bool caretIsVisible() const { return m_caretVisibility == Visible; } |
66 CaretVisibility caretVisibility() const { return m_caretVisibility; } | 66 CaretVisibility caretVisibility() const { return m_caretVisibility; } |
67 | 67 |
68 static LayoutBlock* caretLayoutObject(Node*); | 68 static LayoutBlock* caretLayoutObject(Node*); |
69 static void invalidateLocalCaretRect(Node*, const LayoutRect&); | 69 static void invalidateLocalCaretRect(Node*, const LayoutRect&); |
70 | 70 |
71 private: | 71 private: |
72 LayoutRect m_caretLocalRect; // caret rect in coords local to the layoutObje
ct responsible for painting the caret | 72 LayoutRect m_caretLocalRect; // caret rect in coords local to the layoutObje
ct responsible for painting the caret |
73 CaretVisibility m_caretVisibility; | 73 CaretVisibility m_caretVisibility; |
74 }; | 74 }; |
75 | 75 |
76 } // namespace blink | 76 } // namespace blink |
77 | 77 |
78 #endif // CaretBase_h | 78 #endif // CaretBase_h |
OLD | NEW |