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

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

Issue 2465803002: Get rid of VisibleSelection::expandUsingGranularity() (Closed)
Patch Set: 2016-10-31T17:16:07 Created 4 years, 1 month 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/SelectionController.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 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after
1341 // two |IntPoint| instead of two |VisiblePosition| like 1341 // two |IntPoint| instead of two |VisiblePosition| like
1342 // |moveRangeSelectionExtent()|. 1342 // |moveRangeSelectionExtent()|.
1343 void FrameSelection::moveRangeSelection(const VisiblePosition& basePosition, 1343 void FrameSelection::moveRangeSelection(const VisiblePosition& basePosition,
1344 const VisiblePosition& extentPosition, 1344 const VisiblePosition& extentPosition,
1345 TextGranularity granularity) { 1345 TextGranularity granularity) {
1346 VisibleSelection newSelection = createVisibleSelection( 1346 VisibleSelection newSelection = createVisibleSelection(
1347 SelectionInDOMTree::Builder() 1347 SelectionInDOMTree::Builder()
1348 .setBaseAndExtentDeprecated(basePosition.deepEquivalent(), 1348 .setBaseAndExtentDeprecated(basePosition.deepEquivalent(),
1349 extentPosition.deepEquivalent()) 1349 extentPosition.deepEquivalent())
1350 .setAffinity(basePosition.affinity()) 1350 .setAffinity(basePosition.affinity())
1351 .setGranularity(granularity)
1351 .build()); 1352 .build());
1352 newSelection.expandUsingGranularity(granularity);
1353 1353
1354 if (newSelection.isNone()) 1354 if (newSelection.isNone())
1355 return; 1355 return;
1356 1356
1357 setSelection(newSelection, CloseTyping | ClearTypingStyle, 1357 setSelection(newSelection, CloseTyping | ClearTypingStyle,
1358 CursorAlignOnScroll::IfNeeded, granularity); 1358 CursorAlignOnScroll::IfNeeded, granularity);
1359 } 1359 }
1360 1360
1361 void FrameSelection::updateIfNeeded() { 1361 void FrameSelection::updateIfNeeded() {
1362 DCHECK(!m_frame->document()->needsLayoutTreeUpdate()); 1362 DCHECK(!m_frame->document()->needsLayoutTreeUpdate());
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 } 1401 }
1402 1402
1403 void showTree(const blink::FrameSelection* sel) { 1403 void showTree(const blink::FrameSelection* sel) {
1404 if (sel) 1404 if (sel)
1405 sel->showTreeForThis(); 1405 sel->showTreeForThis();
1406 else 1406 else
1407 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; 1407 LOG(INFO) << "Cannot showTree for <null> FrameSelection.";
1408 } 1408 }
1409 1409
1410 #endif 1410 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/SelectionController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698