| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2005 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 } | 178 } |
| 179 | 179 |
| 180 // Insert the character at the leftmost candidate. | 180 // Insert the character at the leftmost candidate. |
| 181 startPosition = mostBackwardCaretPosition(startPosition); | 181 startPosition = mostBackwardCaretPosition(startPosition); |
| 182 | 182 |
| 183 // It is possible for the node that contains startPosition to contain only u
nrendered whitespace, | 183 // It is possible for the node that contains startPosition to contain only u
nrendered whitespace, |
| 184 // and so deleteInsignificantText could remove it. Save the position before
the node in case that happens. | 184 // and so deleteInsignificantText could remove it. Save the position before
the node in case that happens. |
| 185 DCHECK(startPosition.computeContainerNode()) << startPosition; | 185 DCHECK(startPosition.computeContainerNode()) << startPosition; |
| 186 Position positionBeforeStartNode(Position::inParentBeforeNode(*startPosition
.computeContainerNode())); | 186 Position positionBeforeStartNode(Position::inParentBeforeNode(*startPosition
.computeContainerNode())); |
| 187 deleteInsignificantText(startPosition, mostForwardCaretPosition(startPositio
n)); | 187 deleteInsignificantText(startPosition, mostForwardCaretPosition(startPositio
n)); |
| 188 if (!startPosition.inShadowIncludingDocument()) | 188 if (!startPosition.isConnected()) |
| 189 startPosition = positionBeforeStartNode; | 189 startPosition = positionBeforeStartNode; |
| 190 if (!isVisuallyEquivalentCandidate(startPosition)) | 190 if (!isVisuallyEquivalentCandidate(startPosition)) |
| 191 startPosition = mostForwardCaretPosition(startPosition); | 191 startPosition = mostForwardCaretPosition(startPosition); |
| 192 | 192 |
| 193 startPosition = positionAvoidingSpecialElementBoundary(startPosition, editin
gState); | 193 startPosition = positionAvoidingSpecialElementBoundary(startPosition, editin
gState); |
| 194 if (editingState->isAborted()) | 194 if (editingState->isAborted()) |
| 195 return; | 195 return; |
| 196 | 196 |
| 197 Position endPosition; | 197 Position endPosition; |
| 198 | 198 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 } | 285 } |
| 286 } | 286 } |
| 287 if (editingState->isAborted()) | 287 if (editingState->isAborted()) |
| 288 return Position(); | 288 return Position(); |
| 289 | 289 |
| 290 // return the position following the new tab | 290 // return the position following the new tab |
| 291 return Position::lastPositionInNode(spanElement); | 291 return Position::lastPositionInNode(spanElement); |
| 292 } | 292 } |
| 293 | 293 |
| 294 } // namespace blink | 294 } // namespace blink |
| OLD | NEW |