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

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

Issue 2740893003: Simplify directional selection check in FrameSelection::moveCaretSelection() (Closed)
Patch Set: 2017-03-10T10:07:02 Created 3 years, 9 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 DCHECK(!document().needsLayoutTreeUpdate()); 166 DCHECK(!document().needsLayoutTreeUpdate());
167 167
168 Element* const editable = 168 Element* const editable =
169 computeVisibleSelectionInDOMTree().rootEditableElement(); 169 computeVisibleSelectionInDOMTree().rootEditableElement();
170 if (!editable) 170 if (!editable)
171 return; 171 return;
172 172
173 const VisiblePosition position = 173 const VisiblePosition position =
174 visiblePositionForContentsPoint(point, frame()); 174 visiblePositionForContentsPoint(point, frame());
175 SelectionInDOMTree::Builder builder; 175 SelectionInDOMTree::Builder builder;
176 builder.setIsDirectional( 176 builder.setIsDirectional(selectionInDOMTree().isDirectional());
177 computeVisibleSelectionInDOMTreeDeprecated().isDirectional());
178 builder.setIsHandleVisible(true); 177 builder.setIsHandleVisible(true);
179 if (position.isNotNull()) 178 if (position.isNotNull())
180 builder.collapse(position.toPositionWithAffinity()); 179 builder.collapse(position.toPositionWithAffinity());
181 setSelection(builder.build(), CloseTyping | ClearTypingStyle | UserTriggered); 180 setSelection(builder.build(), CloseTyping | ClearTypingStyle | UserTriggered);
182 } 181 }
183 182
184 void FrameSelection::setSelection(const SelectionInDOMTree& passedSelection, 183 void FrameSelection::setSelection(const SelectionInDOMTree& passedSelection,
185 SetSelectionOptions options, 184 SetSelectionOptions options,
186 CursorAlignOnScroll align, 185 CursorAlignOnScroll align,
187 TextGranularity granularity) { 186 TextGranularity granularity) {
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after
1157 } 1156 }
1158 1157
1159 void showTree(const blink::FrameSelection* sel) { 1158 void showTree(const blink::FrameSelection* sel) {
1160 if (sel) 1159 if (sel)
1161 sel->showTreeForThis(); 1160 sel->showTreeForThis();
1162 else 1161 else
1163 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; 1162 LOG(INFO) << "Cannot showTree for <null> FrameSelection.";
1164 } 1163 }
1165 1164
1166 #endif 1165 #endif
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