OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2009 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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 if (isNull()) | 476 if (isNull()) |
477 return true; | 477 return true; |
478 // TODO(yosin) We should use |Strategy::lastOffsetForEditing()| instead of | 478 // TODO(yosin) We should use |Strategy::lastOffsetForEditing()| instead of |
479 // DOM tree version. | 479 // DOM tree version. |
480 return !Strategy::parent(*anchorNode()) && m_offset >= EditingStrategy::last
OffsetForEditing(anchorNode()); | 480 return !Strategy::parent(*anchorNode()) && m_offset >= EditingStrategy::last
OffsetForEditing(anchorNode()); |
481 } | 481 } |
482 | 482 |
483 template <typename Strategy> | 483 template <typename Strategy> |
484 PositionAlgorithm<Strategy> PositionAlgorithm<Strategy>::upstream(EditingBoundar
yCrossingRule rule) const | 484 PositionAlgorithm<Strategy> PositionAlgorithm<Strategy>::upstream(EditingBoundar
yCrossingRule rule) const |
485 { | 485 { |
486 return mostForwardCaretPosition(*this, rule); | 486 return mostBackwardCaretPosition(*this, rule); |
487 } | 487 } |
488 | 488 |
489 template <typename Strategy> | 489 template <typename Strategy> |
490 PositionAlgorithm<Strategy> PositionAlgorithm<Strategy>::downstream(EditingBound
aryCrossingRule rule) const | 490 PositionAlgorithm<Strategy> PositionAlgorithm<Strategy>::downstream(EditingBound
aryCrossingRule rule) const |
491 { | 491 { |
492 return mostBackwardCaretPosition(*this, rule); | 492 return mostForwardCaretPosition(*this, rule); |
493 } | 493 } |
494 | 494 |
495 // TODO(yosin) We should move |isVisuallyEquivalentCandidate()| to | 495 // TODO(yosin) We should move |isVisuallyEquivalentCandidate()| to |
496 // "VisibleUnits.cpp" to reduce |LayoutObject| dependency in "Position.cpp". | 496 // "VisibleUnits.cpp" to reduce |LayoutObject| dependency in "Position.cpp". |
497 template <typename Strategy> | 497 template <typename Strategy> |
498 static bool isVisuallyEquivalentCandidateAlgorithm(const PositionAlgorithm<Strat
egy>& position) | 498 static bool isVisuallyEquivalentCandidateAlgorithm(const PositionAlgorithm<Strat
egy>& position) |
499 { | 499 { |
500 Node* const anchorNode = position.anchorNode(); | 500 Node* const anchorNode = position.anchorNode(); |
501 if (!anchorNode) | 501 if (!anchorNode) |
502 return false; | 502 return false; |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1025 | 1025 |
1026 void showTree(const blink::Position* pos) | 1026 void showTree(const blink::Position* pos) |
1027 { | 1027 { |
1028 if (pos) | 1028 if (pos) |
1029 pos->showTreeForThis(); | 1029 pos->showTreeForThis(); |
1030 else | 1030 else |
1031 fprintf(stderr, "Cannot showTree for (nil)\n"); | 1031 fprintf(stderr, "Cannot showTree for (nil)\n"); |
1032 } | 1032 } |
1033 | 1033 |
1034 #endif | 1034 #endif |
OLD | NEW |