| 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 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1395 return Position(); | 1395 return Position(); |
| 1396 | 1396 |
| 1397 const Position& prev = previousCharacterPosition(position, affinity); | 1397 const Position& prev = previousCharacterPosition(position, affinity); |
| 1398 if (prev == position) | 1398 if (prev == position) |
| 1399 return Position(); | 1399 return Position(); |
| 1400 const Node* const anchorNode = prev.anchorNode(); | 1400 const Node* const anchorNode = prev.anchorNode(); |
| 1401 if (!anchorNode || !anchorNode->isTextNode()) | 1401 if (!anchorNode || !anchorNode->isTextNode()) |
| 1402 return Position(); | 1402 return Position(); |
| 1403 if (enclosingBlockFlowElement(*anchorNode) != enclosingBlockFlowElement(*pos
ition.anchorNode())) | 1403 if (enclosingBlockFlowElement(*anchorNode) != enclosingBlockFlowElement(*pos
ition.anchorNode())) |
| 1404 return Position(); | 1404 return Position(); |
| 1405 if (!anchorNode->isTextNode()) | 1405 if (option == NotConsiderNonCollapsibleWhitespace && anchorNode->layoutObjec
t() && !anchorNode->layoutObject()->style()->collapseWhiteSpace()) |
| 1406 return Position(); | 1406 return Position(); |
| 1407 const String& string = toText(anchorNode)->data(); | 1407 const String& string = toText(anchorNode)->data(); |
| 1408 const UChar previousCharacter = string[prev.computeOffsetInContainerNode()]; | 1408 const UChar previousCharacter = string[prev.computeOffsetInContainerNode()]; |
| 1409 const bool isSpace = option == ConsiderNonCollapsibleWhitespace ? (isSpaceOr
Newline(previousCharacter) || previousCharacter == noBreakSpaceCharacter) : isCo
llapsibleWhitespace(previousCharacter); | 1409 const bool isSpace = option == ConsiderNonCollapsibleWhitespace ? (isSpaceOr
Newline(previousCharacter) || previousCharacter == noBreakSpaceCharacter) : isCo
llapsibleWhitespace(previousCharacter); |
| 1410 if (!isSpace || !isEditablePosition(prev)) | 1410 if (!isSpace || !isEditablePosition(prev)) |
| 1411 return Position(); | 1411 return Position(); |
| 1412 return prev; | 1412 return prev; |
| 1413 } | 1413 } |
| 1414 | 1414 |
| 1415 // This assumes that it starts in editable content. | 1415 // This assumes that it starts in editable content. |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1700 // instead of possibly at the end of the last node before the selection | 1700 // instead of possibly at the end of the last node before the selection |
| 1701 return mostForwardCaretPosition(visiblePosition.deepEquivalent()); | 1701 return mostForwardCaretPosition(visiblePosition.deepEquivalent()); |
| 1702 } | 1702 } |
| 1703 | 1703 |
| 1704 bool isTextSecurityNode(const Node* node) | 1704 bool isTextSecurityNode(const Node* node) |
| 1705 { | 1705 { |
| 1706 return node && node->layoutObject() && node->layoutObject()->style()->textSe
curity() != TSNONE; | 1706 return node && node->layoutObject() && node->layoutObject()->style()->textSe
curity() != TSNONE; |
| 1707 } | 1707 } |
| 1708 | 1708 |
| 1709 } // namespace blink | 1709 } // namespace blink |
| OLD | NEW |