| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights |
| 3 * reserved. | 3 * reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 public: | 45 public: |
| 46 static DragCaret* create(); | 46 static DragCaret* create(); |
| 47 | 47 |
| 48 virtual ~DragCaret(); | 48 virtual ~DragCaret(); |
| 49 | 49 |
| 50 // Paint invalidation methods delegating to CaretDisplayItemClient. | 50 // Paint invalidation methods delegating to CaretDisplayItemClient. |
| 51 void clearPreviousVisualRect(const LayoutBlock&); | 51 void clearPreviousVisualRect(const LayoutBlock&); |
| 52 void layoutBlockWillBeDestroyed(const LayoutBlock&); | 52 void layoutBlockWillBeDestroyed(const LayoutBlock&); |
| 53 void updateStyleAndLayoutIfNeeded(); | 53 void updateStyleAndLayoutIfNeeded(); |
| 54 void invalidatePaintIfNeeded(const LayoutBlock&, | 54 void invalidatePaintIfNeeded(const LayoutBlock&, |
| 55 const PaintInvalidatorContext&, | 55 const PaintInvalidatorContext&); |
| 56 PaintInvalidationReason); | |
| 57 | 56 |
| 58 bool shouldPaintCaret(const LayoutBlock&) const; | 57 bool shouldPaintCaret(const LayoutBlock&) const; |
| 59 void paintDragCaret(const LocalFrame*, | 58 void paintDragCaret(const LocalFrame*, |
| 60 GraphicsContext&, | 59 GraphicsContext&, |
| 61 const LayoutPoint&) const; | 60 const LayoutPoint&) const; |
| 62 | 61 |
| 63 bool isContentRichlyEditable() const; | 62 bool isContentRichlyEditable() const; |
| 64 | 63 |
| 65 bool hasCaret() const { return m_position.isNotNull(); } | 64 bool hasCaret() const { return m_position.isNotNull(); } |
| 66 const PositionWithAffinity& caretPosition() { return m_position; } | 65 const PositionWithAffinity& caretPosition() { return m_position; } |
| 67 void setCaretPosition(const PositionWithAffinity&); | 66 void setCaretPosition(const PositionWithAffinity&); |
| 68 void clear() { setCaretPosition(PositionWithAffinity()); } | 67 void clear() { setCaretPosition(PositionWithAffinity()); } |
| 69 | 68 |
| 70 DECLARE_TRACE(); | 69 DECLARE_TRACE(); |
| 71 | 70 |
| 72 private: | 71 private: |
| 73 DragCaret(); | 72 DragCaret(); |
| 74 | 73 |
| 75 // Implementations of |SynchronousMutationObserver| | 74 // Implementations of |SynchronousMutationObserver| |
| 76 void nodeChildrenWillBeRemoved(ContainerNode&) final; | 75 void nodeChildrenWillBeRemoved(ContainerNode&) final; |
| 77 void nodeWillBeRemoved(Node&) final; | 76 void nodeWillBeRemoved(Node&) final; |
| 78 | 77 |
| 79 PositionWithAffinity m_position; | 78 PositionWithAffinity m_position; |
| 80 const std::unique_ptr<CaretDisplayItemClient> m_displayItemClient; | 79 const std::unique_ptr<CaretDisplayItemClient> m_displayItemClient; |
| 81 }; | 80 }; |
| 82 | 81 |
| 83 } // namespace blink | 82 } // namespace blink |
| 84 | 83 |
| 85 #endif // DragCaret_h | 84 #endif // DragCaret_h |
| OLD | NEW |