| OLD | NEW |
| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 template <typename Strategy> | 68 template <typename Strategy> |
| 69 VisibleSelectionTemplate<Strategy> VisibleSelectionTemplate<Strategy>::create( | 69 VisibleSelectionTemplate<Strategy> VisibleSelectionTemplate<Strategy>::create( |
| 70 const PositionTemplate<Strategy>& base, | 70 const PositionTemplate<Strategy>& base, |
| 71 const PositionTemplate<Strategy>& extent, | 71 const PositionTemplate<Strategy>& extent, |
| 72 TextAffinity affinity, | 72 TextAffinity affinity, |
| 73 bool isDirectional) { | 73 bool isDirectional) { |
| 74 return VisibleSelectionTemplate(base, extent, affinity, isDirectional); | 74 return VisibleSelectionTemplate(base, extent, affinity, isDirectional); |
| 75 } | 75 } |
| 76 | 76 |
| 77 VisibleSelection createVisibleSelectionDeprecated(const Position& pos, | |
| 78 TextAffinity affinity, | |
| 79 bool isDirectional) { | |
| 80 if (pos.isNotNull()) | |
| 81 pos.document()->updateStyleAndLayoutIgnorePendingStylesheets(); | |
| 82 return VisibleSelection::create(pos, pos, affinity, isDirectional); | |
| 83 } | |
| 84 | |
| 85 VisibleSelection createVisibleSelectionDeprecated(const Position& base, | |
| 86 const Position& extent, | |
| 87 TextAffinity affinity, | |
| 88 bool isDirectional) { | |
| 89 if (base.isNotNull()) | |
| 90 base.document()->updateStyleAndLayoutIgnorePendingStylesheets(); | |
| 91 if (extent.isNotNull()) | |
| 92 extent.document()->updateStyleAndLayoutIgnorePendingStylesheets(); | |
| 93 return VisibleSelection::create(base, extent, affinity, isDirectional); | |
| 94 } | |
| 95 | |
| 96 VisibleSelection createVisibleSelectionDeprecated( | |
| 97 const PositionWithAffinity& pos, | |
| 98 bool isDirectional) { | |
| 99 if (pos.isNotNull()) | |
| 100 pos.document()->updateStyleAndLayoutIgnorePendingStylesheets(); | |
| 101 return VisibleSelection::create(pos.position(), pos.position(), | |
| 102 pos.affinity(), isDirectional); | |
| 103 } | |
| 104 | |
| 105 VisibleSelection createVisibleSelectionDeprecated(const VisiblePosition& pos, | |
| 106 bool isDirectional) { | |
| 107 if (pos.isNotNull()) | |
| 108 pos.deepEquivalent() | |
| 109 .document() | |
| 110 ->updateStyleAndLayoutIgnorePendingStylesheets(); | |
| 111 return VisibleSelection::create(pos.deepEquivalent(), pos.deepEquivalent(), | |
| 112 pos.affinity(), isDirectional); | |
| 113 } | |
| 114 | |
| 115 VisibleSelection createVisibleSelectionDeprecated(const VisiblePosition& base, | |
| 116 const VisiblePosition& extent, | |
| 117 bool isDirectional) { | |
| 118 if (base.isNotNull()) | |
| 119 base.deepEquivalent() | |
| 120 .document() | |
| 121 ->updateStyleAndLayoutIgnorePendingStylesheets(); | |
| 122 if (extent.isNotNull()) | |
| 123 extent.deepEquivalent() | |
| 124 .document() | |
| 125 ->updateStyleAndLayoutIgnorePendingStylesheets(); | |
| 126 return VisibleSelection::create(base.deepEquivalent(), | |
| 127 extent.deepEquivalent(), base.affinity(), | |
| 128 isDirectional); | |
| 129 } | |
| 130 | |
| 131 VisibleSelection createVisibleSelectionDeprecated(const EphemeralRange& range, | |
| 132 TextAffinity affinity, | |
| 133 bool isDirectional) { | |
| 134 if (range.isNotNull()) | |
| 135 range.startPosition() | |
| 136 .document() | |
| 137 ->updateStyleAndLayoutIgnorePendingStylesheets(); | |
| 138 return VisibleSelection::create(range.startPosition(), range.endPosition(), | |
| 139 affinity, isDirectional); | |
| 140 } | |
| 141 | |
| 142 VisibleSelectionInFlatTree createVisibleSelectionDeprecated( | |
| 143 const PositionInFlatTree& pos, | |
| 144 TextAffinity affinity, | |
| 145 bool isDirectional) { | |
| 146 if (pos.isNotNull()) | |
| 147 pos.document()->updateStyleAndLayoutIgnorePendingStylesheets(); | |
| 148 return VisibleSelectionInFlatTree::create(pos, pos, affinity, isDirectional); | |
| 149 } | |
| 150 | |
| 151 VisibleSelectionInFlatTree createVisibleSelectionDeprecated( | |
| 152 const PositionInFlatTree& base, | |
| 153 const PositionInFlatTree& extent, | |
| 154 TextAffinity affinity, | |
| 155 bool isDirectional) { | |
| 156 if (base.isNotNull()) | |
| 157 base.document()->updateStyleAndLayoutIgnorePendingStylesheets(); | |
| 158 if (extent.isNotNull()) | |
| 159 extent.document()->updateStyleAndLayoutIgnorePendingStylesheets(); | |
| 160 return VisibleSelectionInFlatTree::create(base, extent, affinity, | |
| 161 isDirectional); | |
| 162 } | |
| 163 | |
| 164 VisibleSelectionInFlatTree createVisibleSelectionDeprecated( | |
| 165 const PositionInFlatTreeWithAffinity& pos, | |
| 166 bool isDirectional) { | |
| 167 if (pos.isNotNull()) | |
| 168 pos.document()->updateStyleAndLayoutIgnorePendingStylesheets(); | |
| 169 return VisibleSelectionInFlatTree::create(pos.position(), pos.position(), | |
| 170 pos.affinity(), isDirectional); | |
| 171 } | |
| 172 | |
| 173 VisibleSelectionInFlatTree createVisibleSelectionDeprecated( | |
| 174 const VisiblePositionInFlatTree& pos, | |
| 175 bool isDirectional) { | |
| 176 if (pos.isNotNull()) | |
| 177 pos.deepEquivalent() | |
| 178 .document() | |
| 179 ->updateStyleAndLayoutIgnorePendingStylesheets(); | |
| 180 return VisibleSelectionInFlatTree::create(pos.deepEquivalent(), | |
| 181 pos.deepEquivalent(), | |
| 182 pos.affinity(), isDirectional); | |
| 183 } | |
| 184 | |
| 185 VisibleSelectionInFlatTree createVisibleSelectionDeprecated( | |
| 186 const VisiblePositionInFlatTree& base, | |
| 187 const VisiblePositionInFlatTree& extent, | |
| 188 bool isDirectional) { | |
| 189 if (base.isNotNull()) | |
| 190 base.deepEquivalent() | |
| 191 .document() | |
| 192 ->updateStyleAndLayoutIgnorePendingStylesheets(); | |
| 193 if (extent.isNotNull()) | |
| 194 extent.deepEquivalent() | |
| 195 .document() | |
| 196 ->updateStyleAndLayoutIgnorePendingStylesheets(); | |
| 197 return VisibleSelectionInFlatTree::create(base.deepEquivalent(), | |
| 198 extent.deepEquivalent(), | |
| 199 base.affinity(), isDirectional); | |
| 200 } | |
| 201 | |
| 202 VisibleSelectionInFlatTree createVisibleSelectionDeprecated( | |
| 203 const EphemeralRangeInFlatTree& range, | |
| 204 TextAffinity affinity, | |
| 205 bool isDirectional) { | |
| 206 if (range.isNotNull()) | |
| 207 range.startPosition() | |
| 208 .document() | |
| 209 ->updateStyleAndLayoutIgnorePendingStylesheets(); | |
| 210 return VisibleSelectionInFlatTree::create( | |
| 211 range.startPosition(), range.endPosition(), affinity, isDirectional); | |
| 212 } | |
| 213 | |
| 214 VisibleSelection createVisibleSelection(const Position& pos, | 77 VisibleSelection createVisibleSelection(const Position& pos, |
| 215 TextAffinity affinity, | 78 TextAffinity affinity, |
| 216 bool isDirectional) { | 79 bool isDirectional) { |
| 217 DCHECK(!needsLayoutTreeUpdate(pos)); | 80 DCHECK(!needsLayoutTreeUpdate(pos)); |
| 218 return VisibleSelection::create(pos, pos, affinity, isDirectional); | 81 return VisibleSelection::create(pos, pos, affinity, isDirectional); |
| 219 } | 82 } |
| 220 | 83 |
| 221 VisibleSelection createVisibleSelection(const Position& base, | 84 VisibleSelection createVisibleSelection(const Position& base, |
| 222 const Position& extent, | 85 const Position& extent, |
| 223 TextAffinity affinity, | 86 TextAffinity affinity, |
| (...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1131 | 994 |
| 1132 void showTree(const blink::VisibleSelectionInFlatTree& sel) { | 995 void showTree(const blink::VisibleSelectionInFlatTree& sel) { |
| 1133 sel.showTreeForThis(); | 996 sel.showTreeForThis(); |
| 1134 } | 997 } |
| 1135 | 998 |
| 1136 void showTree(const blink::VisibleSelectionInFlatTree* sel) { | 999 void showTree(const blink::VisibleSelectionInFlatTree* sel) { |
| 1137 if (sel) | 1000 if (sel) |
| 1138 sel->showTreeForThis(); | 1001 sel->showTreeForThis(); |
| 1139 } | 1002 } |
| 1140 #endif | 1003 #endif |
| OLD | NEW |