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

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

Issue 2374183004: Make non-null VisibleSelections creatable only by createVisibleSelection[Deprecated] (Closed)
Patch Set: Fix mac compile error Created 4 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 { 196 {
197 if (selectionInFlatTree.isNone()) { 197 if (selectionInFlatTree.isNone()) {
198 *selection = VisibleSelection(); 198 *selection = VisibleSelection();
199 return; 199 return;
200 } 200 }
201 201
202 const Position& base = toPositionInDOMTree(selectionInFlatTree.base()); 202 const Position& base = toPositionInDOMTree(selectionInFlatTree.base());
203 const Position& extent = toPositionInDOMTree(selectionInFlatTree.extent()); 203 const Position& extent = toPositionInDOMTree(selectionInFlatTree.extent());
204 204
205 if (isCrossingShadowBoundaries(selectionInFlatTree)) { 205 if (isCrossingShadowBoundaries(selectionInFlatTree)) {
206 *selection = VisibleSelection(base, extent); 206 *selection = createVisibleSelectionDeprecated(base, extent);
207 return; 207 return;
208 } 208 }
209 209
210 const Position& position1 = toPositionInDOMTree(selectionInFlatTree.start()) ; 210 const Position& position1 = toPositionInDOMTree(selectionInFlatTree.start()) ;
211 const Position& position2 = toPositionInDOMTree(selectionInFlatTree.end()); 211 const Position& position2 = toPositionInDOMTree(selectionInFlatTree.end());
212 selection->m_base = base; 212 selection->m_base = base;
213 selection->m_extent = extent; 213 selection->m_extent = extent;
214 selection->m_affinity = selectionInFlatTree.m_affinity; 214 selection->m_affinity = selectionInFlatTree.m_affinity;
215 selection->m_isDirectional = selectionInFlatTree.m_isDirectional; 215 selection->m_isDirectional = selectionInFlatTree.m_isDirectional;
216 selection->m_granularity = selectionInFlatTree.m_granularity; 216 selection->m_granularity = selectionInFlatTree.m_granularity;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 selection->m_end = newEnd; 268 selection->m_end = newEnd;
269 return; 269 return;
270 } 270 }
271 Node* const shadowHost = shadowHostEnd ? shadowHostEnd : shadowHostStart; 271 Node* const shadowHost = shadowHostEnd ? shadowHostEnd : shadowHostStart;
272 const PositionInFlatTree& newStart = adjustPositionInFlatTreeForStart(select ion->start(), shadowHost); 272 const PositionInFlatTree& newStart = adjustPositionInFlatTreeForStart(select ion->start(), shadowHost);
273 selection->m_extent = newStart; 273 selection->m_extent = newStart;
274 selection->m_start = newStart; 274 selection->m_start = newStart;
275 } 275 }
276 276
277 } // namespace blink 277 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698