| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 startPosition = positionBeforeStartNode; | 184 startPosition = positionBeforeStartNode; |
| 185 if (!isVisuallyEquivalentCandidate(startPosition)) | 185 if (!isVisuallyEquivalentCandidate(startPosition)) |
| 186 startPosition = mostForwardCaretPosition(startPosition); | 186 startPosition = mostForwardCaretPosition(startPosition); |
| 187 | 187 |
| 188 startPosition = positionAvoidingSpecialElementBoundary(startPosition, editin
gState); | 188 startPosition = positionAvoidingSpecialElementBoundary(startPosition, editin
gState); |
| 189 if (editingState->isAborted()) | 189 if (editingState->isAborted()) |
| 190 return; | 190 return; |
| 191 | 191 |
| 192 Position endPosition; | 192 Position endPosition; |
| 193 | 193 |
| 194 if (m_text == "\t") { | 194 if (m_text == "\t" && isRichlyEditablePosition(startPosition)) { |
| 195 endPosition = insertTab(startPosition, editingState); | 195 endPosition = insertTab(startPosition, editingState); |
| 196 if (editingState->isAborted()) | 196 if (editingState->isAborted()) |
| 197 return; | 197 return; |
| 198 // TODO(yosin) We should use |PositionMoveType::Character| for | 198 // TODO(yosin) We should use |PositionMoveType::Character| for |
| 199 // |previousPositionOf()|. | 199 // |previousPositionOf()|. |
| 200 startPosition = previousPositionOf(endPosition, PositionMoveType::Charac
ter); | 200 startPosition = previousPositionOf(endPosition, PositionMoveType::Charac
ter); |
| 201 if (placeholder.isNotNull()) | 201 if (placeholder.isNotNull()) |
| 202 removePlaceholderAt(placeholder); | 202 removePlaceholderAt(placeholder); |
| 203 } else { | 203 } else { |
| 204 // Make sure the document is set up to receive m_text | 204 // Make sure the document is set up to receive m_text |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 } | 282 } |
| 283 } | 283 } |
| 284 if (editingState->isAborted()) | 284 if (editingState->isAborted()) |
| 285 return Position(); | 285 return Position(); |
| 286 | 286 |
| 287 // return the position following the new tab | 287 // return the position following the new tab |
| 288 return lastPositionInNode(spanElement.get()); | 288 return lastPositionInNode(spanElement.get()); |
| 289 } | 289 } |
| 290 | 290 |
| 291 } // namespace blink | 291 } // namespace blink |
| OLD | NEW |