| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 LayoutBlock* m_caretPainter; // layout object responsible for painting the c
aret | 72 LayoutBlock* m_caretPainter; // layout object responsible for painting the c
aret |
| 73 LayoutRect m_caretLocalRect; // caret rect in coords local to the layoutObje
ct responsible for painting the caret | 73 LayoutRect m_caretLocalRect; // caret rect in coords local to the layoutObje
ct responsible for painting the caret |
| 74 CaretVisibility m_caretVisibility; | 74 CaretVisibility m_caretVisibility; |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 class DragCaretController final : public NoBaseWillBeGarbageCollected<DragCaretC
ontroller>, private CaretBase { | |
| 78 WTF_MAKE_NONCOPYABLE(DragCaretController); | |
| 79 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(DragCaretController); | |
| 80 public: | |
| 81 static PassOwnPtrWillBeRawPtr<DragCaretController> create(); | |
| 82 | |
| 83 LayoutBlock* caretLayoutObject() const { return CaretBase::caretPainter(); } | |
| 84 void paintDragCaret(LocalFrame*, GraphicsContext*, const LayoutPoint&, const
LayoutRect& clipRect) const; | |
| 85 | |
| 86 bool isContentEditable() const { return m_position.rootEditableElement(); } | |
| 87 bool isContentRichlyEditable() const; | |
| 88 | |
| 89 bool hasCaret() const { return m_position.isNotNull(); } | |
| 90 const VisiblePosition& caretPosition() { return m_position; } | |
| 91 void setCaretPosition(const VisiblePosition&); | |
| 92 void clear() { setCaretPosition(VisiblePosition()); } | |
| 93 | |
| 94 void nodeWillBeRemoved(Node&); | |
| 95 | |
| 96 DECLARE_TRACE(); | |
| 97 | |
| 98 private: | |
| 99 DragCaretController(); | |
| 100 | |
| 101 VisiblePosition m_position; | |
| 102 }; | |
| 103 | |
| 104 } // namespace blink | 77 } // namespace blink |
| 105 | 78 |
| 106 | |
| 107 #endif // Caret_h | 79 #endif // Caret_h |
| OLD | NEW |