OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 void DragCaret::LayoutBlockWillBeDestroyed(const LayoutBlock& block) { | 48 void DragCaret::LayoutBlockWillBeDestroyed(const LayoutBlock& block) { |
49 display_item_client_->LayoutBlockWillBeDestroyed(block); | 49 display_item_client_->LayoutBlockWillBeDestroyed(block); |
50 } | 50 } |
51 | 51 |
52 void DragCaret::UpdateStyleAndLayoutIfNeeded() { | 52 void DragCaret::UpdateStyleAndLayoutIfNeeded() { |
53 display_item_client_->UpdateStyleAndLayoutIfNeeded( | 53 display_item_client_->UpdateStyleAndLayoutIfNeeded( |
54 RootEditableElementOf(position_.GetPosition()) ? position_ | 54 RootEditableElementOf(position_.GetPosition()) ? position_ |
55 : PositionWithAffinity()); | 55 : PositionWithAffinity()); |
56 } | 56 } |
57 | 57 |
58 void DragCaret::InvalidatePaintIfNeeded( | 58 void DragCaret::InvalidatePaint(const LayoutBlock& block, |
59 const LayoutBlock& block, | 59 const PaintInvalidatorContext& context) { |
60 const PaintInvalidatorContext& context) { | 60 display_item_client_->InvalidatePaint(block, context); |
61 display_item_client_->InvalidatePaintIfNeeded(block, context); | |
62 } | 61 } |
63 | 62 |
64 bool DragCaret::IsContentRichlyEditable() const { | 63 bool DragCaret::IsContentRichlyEditable() const { |
65 return IsRichlyEditablePosition(position_.GetPosition()); | 64 return IsRichlyEditablePosition(position_.GetPosition()); |
66 } | 65 } |
67 | 66 |
68 void DragCaret::SetCaretPosition(const PositionWithAffinity& position) { | 67 void DragCaret::SetCaretPosition(const PositionWithAffinity& position) { |
69 position_ = CreateVisiblePosition(position).ToPositionWithAffinity(); | 68 position_ = CreateVisiblePosition(position).ToPositionWithAffinity(); |
70 Document* document = nullptr; | 69 Document* document = nullptr; |
71 if (Node* node = position_.AnchorNode()) { | 70 if (Node* node = position_.AnchorNode()) { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 void DragCaret::PaintDragCaret(const LocalFrame* frame, | 107 void DragCaret::PaintDragCaret(const LocalFrame* frame, |
109 GraphicsContext& context, | 108 GraphicsContext& context, |
110 const LayoutPoint& paint_offset) const { | 109 const LayoutPoint& paint_offset) const { |
111 if (position_.AnchorNode()->GetDocument().GetFrame() != frame) | 110 if (position_.AnchorNode()->GetDocument().GetFrame() != frame) |
112 return; | 111 return; |
113 display_item_client_->PaintCaret(context, paint_offset, | 112 display_item_client_->PaintCaret(context, paint_offset, |
114 DisplayItem::kDragCaret); | 113 DisplayItem::kDragCaret); |
115 } | 114 } |
116 | 115 |
117 } // namespace blink | 116 } // namespace blink |
OLD | NEW |