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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 PositionInComposedTree VisibleSelection::startInComposedTree() const | 209 PositionInComposedTree VisibleSelection::startInComposedTree() const |
210 { | 210 { |
211 return m_startInComposedTree; | 211 return m_startInComposedTree; |
212 } | 212 } |
213 | 213 |
214 PositionInComposedTree VisibleSelection::endInComposedTree() const | 214 PositionInComposedTree VisibleSelection::endInComposedTree() const |
215 { | 215 { |
216 return m_endInComposedTree; | 216 return m_endInComposedTree; |
217 } | 217 } |
218 | 218 |
219 PassRefPtrWillBeRawPtr<Range> VisibleSelection::firstRange() const | 219 PassRefPtrWillBeRawPtr<Range> firstRangeOf(const VisibleSelection& selection) |
220 { | 220 { |
221 if (isNone()) | 221 if (selection.isNone()) |
222 return nullptr; | 222 return nullptr; |
223 Position start = m_start.parentAnchoredEquivalent(); | 223 Position start = selection.start().parentAnchoredEquivalent(); |
224 Position end = m_end.parentAnchoredEquivalent(); | 224 Position end = selection.end().parentAnchoredEquivalent(); |
225 return Range::create(*start.document(), start, end); | 225 return Range::create(*start.document(), start, end); |
226 } | 226 } |
227 | 227 |
228 bool VisibleSelection::intersectsNode(Node* node) const | 228 bool VisibleSelection::intersectsNode(Node* node) const |
229 { | 229 { |
230 if (isNone()) | 230 if (isNone()) |
231 return false; | 231 return false; |
232 Position start = m_start.parentAnchoredEquivalent(); | 232 Position start = m_start.parentAnchoredEquivalent(); |
233 Position end = m_end.parentAnchoredEquivalent(); | 233 Position end = m_end.parentAnchoredEquivalent(); |
234 TrackExceptionState exceptionState; | 234 TrackExceptionState exceptionState; |
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1244 sel.showTreeForThis(); | 1244 sel.showTreeForThis(); |
1245 } | 1245 } |
1246 | 1246 |
1247 void showTree(const blink::VisibleSelection* sel) | 1247 void showTree(const blink::VisibleSelection* sel) |
1248 { | 1248 { |
1249 if (sel) | 1249 if (sel) |
1250 sel->showTreeForThis(); | 1250 sel->showTreeForThis(); |
1251 } | 1251 } |
1252 | 1252 |
1253 #endif | 1253 #endif |
OLD | NEW |