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

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

Issue 2972753002: Make FrameSelection::MoveRangeSelection() not to set live granularity selection (Closed)
Patch Set: 2017-07-05T18:14:38 Created 3 years, 5 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 | third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp » ('j') | 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 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1129 .SetBaseAndExtentDeprecated(base_position.DeepEquivalent(), 1129 .SetBaseAndExtentDeprecated(base_position.DeepEquivalent(),
1130 extent_position.DeepEquivalent()) 1130 extent_position.DeepEquivalent())
1131 .SetAffinity(base_position.Affinity()) 1131 .SetAffinity(base_position.Affinity())
1132 .SetGranularity(granularity) 1132 .SetGranularity(granularity)
1133 .SetIsHandleVisible(IsHandleVisible()) 1133 .SetIsHandleVisible(IsHandleVisible())
1134 .Build(); 1134 .Build();
1135 1135
1136 if (new_selection.IsNone()) 1136 if (new_selection.IsNone())
1137 return; 1137 return;
1138 1138
1139 SetSelection(new_selection, kCloseTyping | kClearTypingStyle, 1139 const VisibleSelection visible_selection =
1140 CreateVisibleSelection(new_selection);
yoichio 2017/07/06 02:26:32 nlgtm Is this not VSinflattree?
yosin_UTC9 2017/07/06 03:24:21 Talked offline. We should use flat tree version of
1141 if (visible_selection.IsNone())
1142 return;
1143
1144 SelectionInDOMTree::Builder builder;
1145 if (visible_selection.IsBaseFirst()) {
1146 builder.SetBaseAndExtent(visible_selection.Start(),
1147 visible_selection.End());
1148 } else {
1149 builder.SetBaseAndExtent(visible_selection.End(),
1150 visible_selection.Start());
1151 }
1152 builder.SetAffinity(visible_selection.Affinity());
1153 builder.SetIsHandleVisible(IsHandleVisible());
1154 SetSelection(builder.Build(), kCloseTyping | kClearTypingStyle,
1140 CursorAlignOnScroll::kIfNeeded, granularity); 1155 CursorAlignOnScroll::kIfNeeded, granularity);
1141 } 1156 }
1142 1157
1143 void FrameSelection::SetCaretVisible(bool caret_is_visible) { 1158 void FrameSelection::SetCaretVisible(bool caret_is_visible) {
1144 frame_caret_->SetCaretVisibility(caret_is_visible ? CaretVisibility::kVisible 1159 frame_caret_->SetCaretVisibility(caret_is_visible ? CaretVisibility::kVisible
1145 : CaretVisibility::kHidden); 1160 : CaretVisibility::kHidden);
1146 } 1161 }
1147 1162
1148 void FrameSelection::SetCaretBlinkingSuspended(bool suspended) { 1163 void FrameSelection::SetCaretBlinkingSuspended(bool suspended) {
1149 frame_caret_->SetCaretBlinkingSuspended(suspended); 1164 frame_caret_->SetCaretBlinkingSuspended(suspended);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1182 } 1197 }
1183 1198
1184 void showTree(const blink::FrameSelection* sel) { 1199 void showTree(const blink::FrameSelection* sel) {
1185 if (sel) 1200 if (sel)
1186 sel->ShowTreeForThis(); 1201 sel->ShowTreeForThis();
1187 else 1202 else
1188 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; 1203 LOG(INFO) << "Cannot showTree for <null> FrameSelection.";
1189 } 1204 }
1190 1205
1191 #endif 1206 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698