Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: third_party/WebKit/Source/core/editing/DragCaret.cpp

Issue 2813883005: Remove ClearSelection() from DragCaret::NodeWillBeRemoved() (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 } 75 }
76 76
77 void DragCaret::NodeChildrenWillBeRemoved(ContainerNode& container) { 77 void DragCaret::NodeChildrenWillBeRemoved(ContainerNode& container) {
78 if (!HasCaret() || !container.InActiveDocument()) 78 if (!HasCaret() || !container.InActiveDocument())
79 return; 79 return;
80 Node* const anchor_node = position_.GetPosition().AnchorNode(); 80 Node* const anchor_node = position_.GetPosition().AnchorNode();
81 if (!anchor_node || anchor_node == container) 81 if (!anchor_node || anchor_node == container)
82 return; 82 return;
83 if (!container.IsShadowIncludingInclusiveAncestorOf(anchor_node)) 83 if (!container.IsShadowIncludingInclusiveAncestorOf(anchor_node))
84 return; 84 return;
85 position_.GetDocument()->GetLayoutViewItem().ClearSelection();
86 Clear(); 85 Clear();
87 } 86 }
88 87
89 void DragCaret::NodeWillBeRemoved(Node& node) { 88 void DragCaret::NodeWillBeRemoved(Node& node) {
90 if (!HasCaret() || !node.InActiveDocument()) 89 if (!HasCaret() || !node.InActiveDocument())
91 return; 90 return;
92 Node* const anchor_node = position_.GetPosition().AnchorNode(); 91 Node* const anchor_node = position_.GetPosition().AnchorNode();
93 if (!anchor_node) 92 if (!anchor_node)
94 return; 93 return;
95 if (!node.IsShadowIncludingInclusiveAncestorOf(anchor_node)) 94 if (!node.IsShadowIncludingInclusiveAncestorOf(anchor_node))
96 return; 95 return;
97 position_.GetDocument()->GetLayoutViewItem().ClearSelection();
98 Clear(); 96 Clear();
99 } 97 }
100 98
101 DEFINE_TRACE(DragCaret) { 99 DEFINE_TRACE(DragCaret) {
102 visitor->Trace(position_); 100 visitor->Trace(position_);
103 SynchronousMutationObserver::Trace(visitor); 101 SynchronousMutationObserver::Trace(visitor);
104 } 102 }
105 103
106 bool DragCaret::ShouldPaintCaret(const LayoutBlock& block) const { 104 bool DragCaret::ShouldPaintCaret(const LayoutBlock& block) const {
107 return display_item_client_->ShouldPaintCaret(block); 105 return display_item_client_->ShouldPaintCaret(block);
108 } 106 }
109 107
110 void DragCaret::PaintDragCaret(const LocalFrame* frame, 108 void DragCaret::PaintDragCaret(const LocalFrame* frame,
111 GraphicsContext& context, 109 GraphicsContext& context,
112 const LayoutPoint& paint_offset) const { 110 const LayoutPoint& paint_offset) const {
113 if (position_.AnchorNode()->GetDocument().GetFrame() != frame) 111 if (position_.AnchorNode()->GetDocument().GetFrame() != frame)
114 return; 112 return;
115 display_item_client_->PaintCaret(context, paint_offset, 113 display_item_client_->PaintCaret(context, paint_offset,
116 DisplayItem::kDragCaret); 114 DisplayItem::kDragCaret);
117 } 115 }
118 116
119 } // namespace blink 117 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698