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

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

Issue 2406163004: Simplify the usage of PositionWithAffinity (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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 base.document()->updateStyleAndLayoutIgnorePendingStylesheets(); 90 base.document()->updateStyleAndLayoutIgnorePendingStylesheets();
91 if (extent.isNotNull()) 91 if (extent.isNotNull())
92 extent.document()->updateStyleAndLayoutIgnorePendingStylesheets(); 92 extent.document()->updateStyleAndLayoutIgnorePendingStylesheets();
93 return VisibleSelection::create(base, extent, affinity, isDirectional); 93 return VisibleSelection::create(base, extent, affinity, isDirectional);
94 } 94 }
95 95
96 VisibleSelection createVisibleSelectionDeprecated( 96 VisibleSelection createVisibleSelectionDeprecated(
97 const PositionWithAffinity& pos, 97 const PositionWithAffinity& pos,
98 bool isDirectional) { 98 bool isDirectional) {
99 if (pos.isNotNull()) 99 if (pos.isNotNull())
100 pos.position().document()->updateStyleAndLayoutIgnorePendingStylesheets(); 100 pos.document()->updateStyleAndLayoutIgnorePendingStylesheets();
101 return VisibleSelection::create(pos.position(), pos.position(), 101 return VisibleSelection::create(pos.position(), pos.position(),
102 pos.affinity(), isDirectional); 102 pos.affinity(), isDirectional);
103 } 103 }
104 104
105 VisibleSelection createVisibleSelectionDeprecated(const VisiblePosition& pos, 105 VisibleSelection createVisibleSelectionDeprecated(const VisiblePosition& pos,
106 bool isDirectional) { 106 bool isDirectional) {
107 if (pos.isNotNull()) 107 if (pos.isNotNull())
108 pos.deepEquivalent() 108 pos.deepEquivalent()
109 .document() 109 .document()
110 ->updateStyleAndLayoutIgnorePendingStylesheets(); 110 ->updateStyleAndLayoutIgnorePendingStylesheets();
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 if (extent.isNotNull()) 158 if (extent.isNotNull())
159 extent.document()->updateStyleAndLayoutIgnorePendingStylesheets(); 159 extent.document()->updateStyleAndLayoutIgnorePendingStylesheets();
160 return VisibleSelectionInFlatTree::create(base, extent, affinity, 160 return VisibleSelectionInFlatTree::create(base, extent, affinity,
161 isDirectional); 161 isDirectional);
162 } 162 }
163 163
164 VisibleSelectionInFlatTree createVisibleSelectionDeprecated( 164 VisibleSelectionInFlatTree createVisibleSelectionDeprecated(
165 const PositionInFlatTreeWithAffinity& pos, 165 const PositionInFlatTreeWithAffinity& pos,
166 bool isDirectional) { 166 bool isDirectional) {
167 if (pos.isNotNull()) 167 if (pos.isNotNull())
168 pos.position().document()->updateStyleAndLayoutIgnorePendingStylesheets(); 168 pos.document()->updateStyleAndLayoutIgnorePendingStylesheets();
169 return VisibleSelectionInFlatTree::create(pos.position(), pos.position(), 169 return VisibleSelectionInFlatTree::create(pos.position(), pos.position(),
170 pos.affinity(), isDirectional); 170 pos.affinity(), isDirectional);
171 } 171 }
172 172
173 VisibleSelectionInFlatTree createVisibleSelectionDeprecated( 173 VisibleSelectionInFlatTree createVisibleSelectionDeprecated(
174 const VisiblePositionInFlatTree& pos, 174 const VisiblePositionInFlatTree& pos,
175 bool isDirectional) { 175 bool isDirectional) {
176 if (pos.isNotNull()) 176 if (pos.isNotNull())
177 pos.deepEquivalent() 177 pos.deepEquivalent()
178 .document() 178 .document()
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
1131 1131
1132 void showTree(const blink::VisibleSelectionInFlatTree& sel) { 1132 void showTree(const blink::VisibleSelectionInFlatTree& sel) {
1133 sel.showTreeForThis(); 1133 sel.showTreeForThis();
1134 } 1134 }
1135 1135
1136 void showTree(const blink::VisibleSelectionInFlatTree* sel) { 1136 void showTree(const blink::VisibleSelectionInFlatTree* sel) {
1137 if (sel) 1137 if (sel)
1138 sel->showTreeForThis(); 1138 sel->showTreeForThis();
1139 } 1139 }
1140 #endif 1140 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/VisiblePosition.cpp ('k') | third_party/WebKit/Source/core/editing/VisibleUnits.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698