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

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

Issue 2426513002: Prune createVisiblePositionDeprecated (Closed)
Patch Set: 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
« no previous file with comments | « third_party/WebKit/Source/core/editing/VisiblePosition.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, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Portions Copyright (c) 2011 Motorola Mobility, Inc. All rights reserved. 4 * Portions Copyright (c) 2011 Motorola Mobility, Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 PositionTemplate<Strategy>::inParentBeforeNode(node))); 129 PositionTemplate<Strategy>::inParentBeforeNode(node)));
130 } 130 }
131 131
132 template <typename Strategy> 132 template <typename Strategy>
133 VisiblePositionTemplate<Strategy> 133 VisiblePositionTemplate<Strategy>
134 VisiblePositionTemplate<Strategy>::lastPositionInNode(Node* node) { 134 VisiblePositionTemplate<Strategy>::lastPositionInNode(Node* node) {
135 return create(PositionWithAffinityTemplate<Strategy>( 135 return create(PositionWithAffinityTemplate<Strategy>(
136 PositionTemplate<Strategy>::lastPositionInNode(node))); 136 PositionTemplate<Strategy>::lastPositionInNode(node)));
137 } 137 }
138 138
139 VisiblePosition createVisiblePositionDeprecated(const Position& position,
140 TextAffinity affinity) {
141 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
142 // needs to be audited. See http://crbug.com/590369 for more details.
143 if (position.isNotNull())
144 position.document()->updateStyleAndLayoutIgnorePendingStylesheets();
145
146 return VisiblePosition::create(PositionWithAffinity(position, affinity));
147 }
148
149 VisiblePosition createVisiblePositionDeprecated(
150 const PositionWithAffinity& positionWithAffinity) {
151 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
152 // needs to be audited. See http://crbug.com/590369 for more details.
153 if (positionWithAffinity.isNotNull())
154 positionWithAffinity.position()
155 .document()
156 ->updateStyleAndLayoutIgnorePendingStylesheets();
157
158 return VisiblePosition::create(positionWithAffinity);
159 }
160
161 VisiblePositionInFlatTree createVisiblePositionDeprecated(
162 const PositionInFlatTree& position,
163 TextAffinity affinity) {
164 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
165 // needs to be audited. See http://crbug.com/590369 for more details.
166 if (position.isNotNull())
167 position.document()->updateStyleAndLayoutIgnorePendingStylesheets();
168
169 return VisiblePositionInFlatTree::create(
170 PositionInFlatTreeWithAffinity(position, affinity));
171 }
172
173 VisiblePositionInFlatTree createVisiblePositionDeprecated(
174 const PositionInFlatTreeWithAffinity& positionWithAffinity) {
175 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
176 // needs to be audited. See http://crbug.com/590369 for more details.
177 if (positionWithAffinity.isNotNull())
178 positionWithAffinity.position()
179 .document()
180 ->updateStyleAndLayoutIgnorePendingStylesheets();
181
182 return VisiblePositionInFlatTree::create(positionWithAffinity);
183 }
184
185 VisiblePosition createVisiblePosition(const Position& position, 139 VisiblePosition createVisiblePosition(const Position& position,
186 TextAffinity affinity) { 140 TextAffinity affinity) {
187 return VisiblePosition::create(PositionWithAffinity(position, affinity)); 141 return VisiblePosition::create(PositionWithAffinity(position, affinity));
188 } 142 }
189 143
190 VisiblePosition createVisiblePosition( 144 VisiblePosition createVisiblePosition(
191 const PositionWithAffinity& positionWithAffinity) { 145 const PositionWithAffinity& positionWithAffinity) {
192 return VisiblePosition::create(positionWithAffinity); 146 return VisiblePosition::create(positionWithAffinity);
193 } 147 }
194 148
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 return; 205 return;
252 } 206 }
253 DVLOG(0) << "Cannot showTree for (nil) VisiblePosition."; 207 DVLOG(0) << "Cannot showTree for (nil) VisiblePosition.";
254 } 208 }
255 209
256 void showTree(const blink::VisiblePosition& vpos) { 210 void showTree(const blink::VisiblePosition& vpos) {
257 vpos.showTreeForThis(); 211 vpos.showTreeForThis();
258 } 212 }
259 213
260 #endif 214 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/VisiblePosition.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698