| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 if (comparePositions(position, firstPositionInNode(highestRoot)) == -1 && hi
ghestRoot->rendererIsEditable()) | 261 if (comparePositions(position, firstPositionInNode(highestRoot)) == -1 && hi
ghestRoot->rendererIsEditable()) |
| 262 return VisiblePosition(firstPositionInNode(highestRoot)); | 262 return VisiblePosition(firstPositionInNode(highestRoot)); |
| 263 | 263 |
| 264 Position p = position; | 264 Position p = position; |
| 265 | 265 |
| 266 if (position.deprecatedNode()->treeScope() != highestRoot->treeScope()) { | 266 if (position.deprecatedNode()->treeScope() != highestRoot->treeScope()) { |
| 267 Node* shadowAncestor = highestRoot->treeScope().ancestorInThisScope(p.de
precatedNode()); | 267 Node* shadowAncestor = highestRoot->treeScope().ancestorInThisScope(p.de
precatedNode()); |
| 268 if (!shadowAncestor) | 268 if (!shadowAncestor) |
| 269 return VisiblePosition(); | 269 return VisiblePosition(); |
| 270 | 270 |
| 271 p = positionAfterNode(shadowAncestor); | 271 p = positionAfterNode(*shadowAncestor); |
| 272 } | 272 } |
| 273 | 273 |
| 274 while (p.deprecatedNode() && !isEditablePosition(p) && p.deprecatedNode()->i
sDescendantOf(highestRoot)) | 274 while (p.deprecatedNode() && !isEditablePosition(p) && p.deprecatedNode()->i
sDescendantOf(highestRoot)) |
| 275 p = isAtomicNode(p.deprecatedNode()) ? positionInParentAfterNode(*p.depr
ecatedNode()) : nextVisuallyDistinctCandidate(p); | 275 p = isAtomicNode(p.deprecatedNode()) ? positionInParentAfterNode(*p.depr
ecatedNode()) : nextVisuallyDistinctCandidate(p); |
| 276 | 276 |
| 277 if (p.deprecatedNode() && p.deprecatedNode() != highestRoot && !p.deprecated
Node()->isDescendantOf(highestRoot)) | 277 if (p.deprecatedNode() && p.deprecatedNode() != highestRoot && !p.deprecated
Node()->isDescendantOf(highestRoot)) |
| 278 return VisiblePosition(); | 278 return VisiblePosition(); |
| 279 | 279 |
| 280 return VisiblePosition(p); | 280 return VisiblePosition(p); |
| 281 } | 281 } |
| (...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1114 // if the selection starts just before a paragraph break, skip over it | 1114 // if the selection starts just before a paragraph break, skip over it |
| 1115 if (isEndOfParagraph(visiblePosition)) | 1115 if (isEndOfParagraph(visiblePosition)) |
| 1116 return visiblePosition.next().deepEquivalent().downstream(); | 1116 return visiblePosition.next().deepEquivalent().downstream(); |
| 1117 | 1117 |
| 1118 // otherwise, make sure to be at the start of the first selected node, | 1118 // otherwise, make sure to be at the start of the first selected node, |
| 1119 // instead of possibly at the end of the last node before the selection | 1119 // instead of possibly at the end of the last node before the selection |
| 1120 return visiblePosition.deepEquivalent().downstream(); | 1120 return visiblePosition.deepEquivalent().downstream(); |
| 1121 } | 1121 } |
| 1122 | 1122 |
| 1123 } // namespace WebCore | 1123 } // namespace WebCore |
| OLD | NEW |