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 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1615 | 1615 |
1616 VisiblePosition endOfEditableContent(const VisiblePosition& visiblePosition) | 1616 VisiblePosition endOfEditableContent(const VisiblePosition& visiblePosition) |
1617 { | 1617 { |
1618 ContainerNode* highestRoot = highestEditableRoot(visiblePosition.deepEquival
ent()); | 1618 ContainerNode* highestRoot = highestEditableRoot(visiblePosition.deepEquival
ent()); |
1619 if (!highestRoot) | 1619 if (!highestRoot) |
1620 return VisiblePosition(); | 1620 return VisiblePosition(); |
1621 | 1621 |
1622 return createVisiblePosition(lastPositionInNode(highestRoot)); | 1622 return createVisiblePosition(lastPositionInNode(highestRoot)); |
1623 } | 1623 } |
1624 | 1624 |
1625 bool isEndOfEditableOrNonEditableContent(const VisiblePosition& p) | 1625 template <typename Strategy> |
| 1626 static bool isEndOfEditableOrNonEditableContentAlgorithm(const VisiblePositionTe
mplate<Strategy>& p) |
1626 { | 1627 { |
1627 return p.isNotNull() && nextPositionOf(p).isNull(); | 1628 return p.isNotNull() && nextPositionOf(p).isNull(); |
1628 } | 1629 } |
1629 | 1630 |
| 1631 bool isEndOfEditableOrNonEditableContent(const VisiblePosition& position) |
| 1632 { |
| 1633 return isEndOfEditableOrNonEditableContentAlgorithm<EditingStrategy>(positio
n); |
| 1634 } |
| 1635 |
| 1636 bool isEndOfEditableOrNonEditableContent(const VisiblePositionInComposedTree& po
sition) |
| 1637 { |
| 1638 return isEndOfEditableOrNonEditableContentAlgorithm<EditingInComposedTreeStr
ategy>(position); |
| 1639 } |
| 1640 |
1630 VisiblePosition leftBoundaryOfLine(const VisiblePosition& c, TextDirection direc
tion) | 1641 VisiblePosition leftBoundaryOfLine(const VisiblePosition& c, TextDirection direc
tion) |
1631 { | 1642 { |
1632 return direction == LTR ? logicalStartOfLine(c) : logicalEndOfLine(c); | 1643 return direction == LTR ? logicalStartOfLine(c) : logicalEndOfLine(c); |
1633 } | 1644 } |
1634 | 1645 |
1635 VisiblePosition rightBoundaryOfLine(const VisiblePosition& c, TextDirection dire
ction) | 1646 VisiblePosition rightBoundaryOfLine(const VisiblePosition& c, TextDirection dire
ction) |
1636 { | 1647 { |
1637 return direction == LTR ? logicalEndOfLine(c) : logicalStartOfLine(c); | 1648 return direction == LTR ? logicalEndOfLine(c) : logicalStartOfLine(c); |
1638 } | 1649 } |
1639 | 1650 |
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3003 return honorEditingBoundaryAtOrBefore(prev, visiblePosition.deepEquivale
nt()); | 3014 return honorEditingBoundaryAtOrBefore(prev, visiblePosition.deepEquivale
nt()); |
3004 case CanSkipOverEditingBoundary: | 3015 case CanSkipOverEditingBoundary: |
3005 return skipToStartOfEditingBoundary(prev, visiblePosition.deepEquivalent
()); | 3016 return skipToStartOfEditingBoundary(prev, visiblePosition.deepEquivalent
()); |
3006 } | 3017 } |
3007 | 3018 |
3008 ASSERT_NOT_REACHED(); | 3019 ASSERT_NOT_REACHED(); |
3009 return honorEditingBoundaryAtOrBefore(prev, visiblePosition.deepEquivalent()
); | 3020 return honorEditingBoundaryAtOrBefore(prev, visiblePosition.deepEquivalent()
); |
3010 } | 3021 } |
3011 | 3022 |
3012 } // namespace blink | 3023 } // namespace blink |
OLD | NEW |