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 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1319 RenderedPosition renderedPosition((createVisiblePosition(position)))
; | 1319 RenderedPosition renderedPosition((createVisiblePosition(position)))
; |
1320 root = renderedPosition.rootBox(); | 1320 root = renderedPosition.rootBox(); |
1321 if (!root) | 1321 if (!root) |
1322 return createVisiblePosition(position); | 1322 return createVisiblePosition(position); |
1323 } | 1323 } |
1324 } | 1324 } |
1325 | 1325 |
1326 if (root) { | 1326 if (root) { |
1327 // FIXME: Can be wrong for multi-column layout and with transforms. | 1327 // FIXME: Can be wrong for multi-column layout and with transforms. |
1328 LayoutPoint pointInLine = absoluteLineDirectionPointToLocalPointInBlock(
root, lineDirectionPoint); | 1328 LayoutPoint pointInLine = absoluteLineDirectionPointToLocalPointInBlock(
root, lineDirectionPoint); |
1329 LineLayoutItem lineLayoutItem = root->closestLeafChildForPoint(pointInLi
ne, isEditablePosition(p, ContentIsEditable, DoNotUpdateStyle))->getLineLayoutIt
em(); | 1329 LineLayoutItem lineLayoutItem = root->closestLeafChildForPoint(pointInLi
ne, isEditablePosition(p))->getLineLayoutItem(); |
1330 Node* node = lineLayoutItem.node(); | 1330 Node* node = lineLayoutItem.node(); |
1331 if (node && editingIgnoresContent(node)) | 1331 if (node && editingIgnoresContent(node)) |
1332 return VisiblePosition::inParentBeforeNode(*node); | 1332 return VisiblePosition::inParentBeforeNode(*node); |
1333 return createVisiblePosition(lineLayoutItem.positionForPoint(pointInLine
)); | 1333 return createVisiblePosition(lineLayoutItem.positionForPoint(pointInLine
)); |
1334 } | 1334 } |
1335 | 1335 |
1336 // Could not find a previous line. This means we must already be on the firs
t line. | 1336 // Could not find a previous line. This means we must already be on the firs
t line. |
1337 // Move to the start of the content in this block, which effectively moves u
s | 1337 // Move to the start of the content in this block, which effectively moves u
s |
1338 // to the start of the line we're on. | 1338 // to the start of the line we're on. |
1339 Element* rootElement = node->hasEditableStyle(editableType) ? node->rootEdit
ableElement(editableType) : node->document().documentElement(); | 1339 Element* rootElement = node->hasEditableStyle(editableType) ? node->rootEdit
ableElement(editableType) : node->document().documentElement(); |
(...skipping 1911 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 |