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

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

Issue 2020143002: Get rid of a redundant FrameSelection::setSelection() with VisibleSelectionInFlatTree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-05-31T13:04:09 Created 4 years, 6 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 | « third_party/WebKit/Source/core/editing/FrameSelection.h ('k') | 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 if (visibleSelection<Strategy>().base() == newSelection.base()) 255 if (visibleSelection<Strategy>().base() == newSelection.base())
256 newSelection.setBase(originalBase); 256 newSelection.setBase(originalBase);
257 setOriginalBase(VisiblePositionTemplate<Strategy>()); 257 setOriginalBase(VisiblePositionTemplate<Strategy>());
258 } 258 }
259 259
260 // Adjusting base and extent will make newSelection always directional 260 // Adjusting base and extent will make newSelection always directional
261 newSelection.setIsDirectional(isDirectional); 261 newSelection.setIsDirectional(isDirectional);
262 if (visibleSelection<Strategy>() == newSelection) 262 if (visibleSelection<Strategy>() == newSelection)
263 return; 263 return;
264 264
265 setSelection(newSelection, granularity); 265 const SetSelectionOptions options = CloseTyping | ClearTypingStyle;
266 setSelection(newSelection, options, CursorAlignOnScroll::IfNeeded, granulari ty);
266 } 267 }
267 268
268 void FrameSelection::setNonDirectionalSelectionIfNeeded(const VisibleSelection& passedNewSelection, TextGranularity granularity, EndPointsAdjustmentMode endpoin tsAdjustmentMode) 269 void FrameSelection::setNonDirectionalSelectionIfNeeded(const VisibleSelection& passedNewSelection, TextGranularity granularity, EndPointsAdjustmentMode endpoin tsAdjustmentMode)
269 { 270 {
270 setNonDirectionalSelectionIfNeededAlgorithm<EditingStrategy>(passedNewSelect ion, granularity, endpointsAdjustmentMode); 271 setNonDirectionalSelectionIfNeededAlgorithm<EditingStrategy>(passedNewSelect ion, granularity, endpointsAdjustmentMode);
271 } 272 }
272 273
273 void FrameSelection::setNonDirectionalSelectionIfNeeded(const VisibleSelectionIn FlatTree& passedNewSelection, TextGranularity granularity, EndPointsAdjustmentMo de endpointsAdjustmentMode) 274 void FrameSelection::setNonDirectionalSelectionIfNeeded(const VisibleSelectionIn FlatTree& passedNewSelection, TextGranularity granularity, EndPointsAdjustmentMo de endpointsAdjustmentMode)
274 { 275 {
275 setNonDirectionalSelectionIfNeededAlgorithm<EditingInFlatTreeStrategy>(passe dNewSelection, granularity, endpointsAdjustmentMode); 276 setNonDirectionalSelectionIfNeededAlgorithm<EditingInFlatTreeStrategy>(passe dNewSelection, granularity, endpointsAdjustmentMode);
(...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after
1361 1362
1362 void showTree(const blink::FrameSelection* sel) 1363 void showTree(const blink::FrameSelection* sel)
1363 { 1364 {
1364 if (sel) 1365 if (sel)
1365 sel->showTreeForThis(); 1366 sel->showTreeForThis();
1366 else 1367 else
1367 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); 1368 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n");
1368 } 1369 }
1369 1370
1370 #endif 1371 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698