| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
| 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 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1321 RenderedPosition renderedPosition((createVisiblePosition(position)))
; | 1321 RenderedPosition renderedPosition((createVisiblePosition(position)))
; |
| 1322 root = renderedPosition.rootBox(); | 1322 root = renderedPosition.rootBox(); |
| 1323 if (!root) | 1323 if (!root) |
| 1324 return createVisiblePosition(position); | 1324 return createVisiblePosition(position); |
| 1325 } | 1325 } |
| 1326 } | 1326 } |
| 1327 | 1327 |
| 1328 if (root) { | 1328 if (root) { |
| 1329 // FIXME: Can be wrong for multi-column layout and with transforms. | 1329 // FIXME: Can be wrong for multi-column layout and with transforms. |
| 1330 LayoutPoint pointInLine = absoluteLineDirectionPointToLocalPointInBlock(
root, lineDirectionPoint); | 1330 LayoutPoint pointInLine = absoluteLineDirectionPointToLocalPointInBlock(
root, lineDirectionPoint); |
| 1331 LineLayoutItem lineLayoutItem = root->closestLeafChildForPoint(pointInLi
ne, isEditablePosition(p))->getLineLayoutItem(); | 1331 LineLayoutItem lineLayoutItem = root->closestLeafChildForPoint(pointInLi
ne, isEditablePosition(p, ContentIsEditable, DoNotUpdateStyle))->getLineLayoutIt
em(); |
| 1332 Node* node = lineLayoutItem.node(); | 1332 Node* node = lineLayoutItem.node(); |
| 1333 if (node && editingIgnoresContent(node)) | 1333 if (node && editingIgnoresContent(node)) |
| 1334 return createVisiblePosition(Position::inParentBeforeNode(*node)); | 1334 return createVisiblePosition(Position::inParentBeforeNode(*node)); |
| 1335 return createVisiblePosition(lineLayoutItem.positionForPoint(pointInLine
)); | 1335 return createVisiblePosition(lineLayoutItem.positionForPoint(pointInLine
)); |
| 1336 } | 1336 } |
| 1337 | 1337 |
| 1338 // Could not find a previous line. This means we must already be on the firs
t line. | 1338 // Could not find a previous line. This means we must already be on the firs
t line. |
| 1339 // Move to the start of the content in this block, which effectively moves u
s | 1339 // Move to the start of the content in this block, which effectively moves u
s |
| 1340 // to the start of the line we're on. | 1340 // to the start of the line we're on. |
| 1341 Element* rootElement = node->hasEditableStyle(editableType) ? node->rootEdit
ableElement(editableType) : node->document().documentElement(); | 1341 Element* rootElement = node->hasEditableStyle(editableType) ? node->rootEdit
ableElement(editableType) : node->document().documentElement(); |
| (...skipping 1909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3251 { | 3251 { |
| 3252 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule); | 3252 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule); |
| 3253 } | 3253 } |
| 3254 | 3254 |
| 3255 VisiblePositionInFlatTree previousPositionOf(const VisiblePositionInFlatTree& vi
siblePosition, EditingBoundaryCrossingRule rule) | 3255 VisiblePositionInFlatTree previousPositionOf(const VisiblePositionInFlatTree& vi
siblePosition, EditingBoundaryCrossingRule rule) |
| 3256 { | 3256 { |
| 3257 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>(visiblePositio
n, rule); | 3257 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>(visiblePositio
n, rule); |
| 3258 } | 3258 } |
| 3259 | 3259 |
| 3260 } // namespace blink | 3260 } // namespace blink |
| OLD | NEW |