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 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1336 } | 1336 } |
1337 | 1337 |
1338 VisiblePosition previousLinePosition(const VisiblePosition& visiblePosition, Lay
outUnit lineDirectionPoint, EditableType editableType) | 1338 VisiblePosition previousLinePosition(const VisiblePosition& visiblePosition, Lay
outUnit lineDirectionPoint, EditableType editableType) |
1339 { | 1339 { |
1340 Position p = visiblePosition.deepEquivalent(); | 1340 Position p = visiblePosition.deepEquivalent(); |
1341 Node* node = p.anchorNode(); | 1341 Node* node = p.anchorNode(); |
1342 | 1342 |
1343 if (!node) | 1343 if (!node) |
1344 return VisiblePosition(); | 1344 return VisiblePosition(); |
1345 | 1345 |
1346 node->document().updateStyleAndLayoutIgnorePendingStylesheets(); | 1346 DCHECK(!node->document().needsLayoutTreeUpdate()); |
1347 | 1347 |
1348 LayoutObject* layoutObject = node->layoutObject(); | 1348 LayoutObject* layoutObject = node->layoutObject(); |
1349 if (!layoutObject) | 1349 if (!layoutObject) |
1350 return VisiblePosition(); | 1350 return VisiblePosition(); |
1351 | 1351 |
1352 RootInlineBox* root = 0; | 1352 RootInlineBox* root = 0; |
1353 InlineBox* box = computeInlineBoxPosition(visiblePosition).inlineBox; | 1353 InlineBox* box = computeInlineBoxPosition(visiblePosition).inlineBox; |
1354 if (box) { | 1354 if (box) { |
1355 root = box->root().prevRootBox(); | 1355 root = box->root().prevRootBox(); |
1356 // We want to skip zero height boxes. | 1356 // We want to skip zero height boxes. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1389 } | 1389 } |
1390 | 1390 |
1391 VisiblePosition nextLinePosition(const VisiblePosition& visiblePosition, LayoutU
nit lineDirectionPoint, EditableType editableType) | 1391 VisiblePosition nextLinePosition(const VisiblePosition& visiblePosition, LayoutU
nit lineDirectionPoint, EditableType editableType) |
1392 { | 1392 { |
1393 Position p = visiblePosition.deepEquivalent(); | 1393 Position p = visiblePosition.deepEquivalent(); |
1394 Node* node = p.anchorNode(); | 1394 Node* node = p.anchorNode(); |
1395 | 1395 |
1396 if (!node) | 1396 if (!node) |
1397 return VisiblePosition(); | 1397 return VisiblePosition(); |
1398 | 1398 |
1399 node->document().updateStyleAndLayoutIgnorePendingStylesheets(); | 1399 DCHECK(!node->document().needsLayoutTreeUpdate()); |
1400 | 1400 |
1401 LayoutObject* layoutObject = node->layoutObject(); | 1401 LayoutObject* layoutObject = node->layoutObject(); |
1402 if (!layoutObject) | 1402 if (!layoutObject) |
1403 return VisiblePosition(); | 1403 return VisiblePosition(); |
1404 | 1404 |
1405 RootInlineBox* root = 0; | 1405 RootInlineBox* root = 0; |
1406 InlineBox* box = computeInlineBoxPosition(visiblePosition).inlineBox; | 1406 InlineBox* box = computeInlineBoxPosition(visiblePosition).inlineBox; |
1407 if (box) { | 1407 if (box) { |
1408 root = box->root().nextRootBox(); | 1408 root = box->root().nextRootBox(); |
1409 // We want to skip zero height boxes. | 1409 // We want to skip zero height boxes. |
(...skipping 1909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3319 { | 3319 { |
3320 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule); | 3320 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule); |
3321 } | 3321 } |
3322 | 3322 |
3323 VisiblePositionInFlatTree previousPositionOf(const VisiblePositionInFlatTree& vi
siblePosition, EditingBoundaryCrossingRule rule) | 3323 VisiblePositionInFlatTree previousPositionOf(const VisiblePositionInFlatTree& vi
siblePosition, EditingBoundaryCrossingRule rule) |
3324 { | 3324 { |
3325 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>(visiblePositio
n, rule); | 3325 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>(visiblePositio
n, rule); |
3326 } | 3326 } |
3327 | 3327 |
3328 } // namespace blink | 3328 } // namespace blink |
OLD | NEW |