OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004 Apple Computer, 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 enum EWordSide { RightWordIfOnBoundary = false, LeftWordIfOnBoundary = true }; | 44 enum EWordSide { RightWordIfOnBoundary = false, LeftWordIfOnBoundary = true }; |
45 | 45 |
46 // Position | 46 // Position |
47 // mostForward/BackwardCaretPosition are used for moving back and forth between | 47 // mostForward/BackwardCaretPosition are used for moving back and forth between |
48 // visually equivalent candidates. | 48 // visually equivalent candidates. |
49 // For example, for the text node "foo bar" where whitespace is | 49 // For example, for the text node "foo bar" where whitespace is |
50 // collapsible, there are two candidates that map to the VisiblePosition | 50 // collapsible, there are two candidates that map to the VisiblePosition |
51 // between 'b' and the space, after first space and before last space. | 51 // between 'b' and the space, after first space and before last space. |
52 // | 52 // |
53 // mostForwardCaretPosition returns the left candidate and also returs | 53 // mostBackwardCaretPosition returns the left candidate and also returs |
54 // [boundary, 0] for any of the positions from [boundary, 0] to the first | 54 // [boundary, 0] for any of the positions from [boundary, 0] to the first |
55 // candidate in boundary, where | 55 // candidate in boundary, where |
56 // endsOfNodeAreVisuallyDistinctPositions(boundary) is true. | 56 // endsOfNodeAreVisuallyDistinctPositions(boundary) is true. |
57 // | 57 // |
58 // mostBackwardCaretPosition() returns the right one and also returns the | 58 // mostForwardCaretPosition() returns the right one and also returns the |
59 // last position in the last atomic node in boundary for all of the positions | 59 // last position in the last atomic node in boundary for all of the positions |
60 // in boundary after the last candidate, where | 60 // in boundary after the last candidate, where |
61 // endsOfNodeAreVisuallyDistinctPositions(boundary). | 61 // endsOfNodeAreVisuallyDistinctPositions(boundary). |
62 // FIXME: This function should never be called when the line box tree is dirty. | 62 // FIXME: This function should never be called when the line box tree is dirty. |
63 // See https://bugs.webkit.org/show_bug.cgi?id=97264 | 63 // See https://bugs.webkit.org/show_bug.cgi?id=97264 |
| 64 CORE_EXPORT Position mostBackwardCaretPosition(const Position &, EditingBoundary
CrossingRule = CannotCrossEditingBoundary); |
| 65 CORE_EXPORT PositionInComposedTree mostBackwardCaretPosition(const PositionInCom
posedTree &, EditingBoundaryCrossingRule = CannotCrossEditingBoundary); |
64 CORE_EXPORT Position mostForwardCaretPosition(const Position &, EditingBoundaryC
rossingRule = CannotCrossEditingBoundary); | 66 CORE_EXPORT Position mostForwardCaretPosition(const Position &, EditingBoundaryC
rossingRule = CannotCrossEditingBoundary); |
65 CORE_EXPORT PositionInComposedTree mostForwardCaretPosition(const PositionInComp
osedTree &, EditingBoundaryCrossingRule = CannotCrossEditingBoundary); | 67 CORE_EXPORT PositionInComposedTree mostForwardCaretPosition(const PositionInComp
osedTree &, EditingBoundaryCrossingRule = CannotCrossEditingBoundary); |
66 CORE_EXPORT Position mostBackwardCaretPosition(const Position &, EditingBoundary
CrossingRule = CannotCrossEditingBoundary); | |
67 CORE_EXPORT PositionInComposedTree mostBackwardCaretPosition(const PositionInCom
posedTree &, EditingBoundaryCrossingRule = CannotCrossEditingBoundary); | |
68 | 68 |
69 // words | 69 // words |
70 CORE_EXPORT VisiblePosition startOfWord(const VisiblePosition &, EWordSide = Rig
htWordIfOnBoundary); | 70 CORE_EXPORT VisiblePosition startOfWord(const VisiblePosition &, EWordSide = Rig
htWordIfOnBoundary); |
71 CORE_EXPORT VisiblePosition endOfWord(const VisiblePosition &, EWordSide = Right
WordIfOnBoundary); | 71 CORE_EXPORT VisiblePosition endOfWord(const VisiblePosition &, EWordSide = Right
WordIfOnBoundary); |
72 VisiblePosition previousWordPosition(const VisiblePosition &); | 72 VisiblePosition previousWordPosition(const VisiblePosition &); |
73 VisiblePosition nextWordPosition(const VisiblePosition &); | 73 VisiblePosition nextWordPosition(const VisiblePosition &); |
74 VisiblePosition rightWordPosition(const VisiblePosition&, bool skipsSpaceWhenMov
ingRight); | 74 VisiblePosition rightWordPosition(const VisiblePosition&, bool skipsSpaceWhenMov
ingRight); |
75 VisiblePosition leftWordPosition(const VisiblePosition&, bool skipsSpaceWhenMovi
ngRight); | 75 VisiblePosition leftWordPosition(const VisiblePosition&, bool skipsSpaceWhenMovi
ngRight); |
76 | 76 |
77 // sentences | 77 // sentences |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 // Returns a hit-tested VisiblePosition for the given point in contents-space | 133 // Returns a hit-tested VisiblePosition for the given point in contents-space |
134 // coordinates. | 134 // coordinates. |
135 CORE_EXPORT VisiblePosition visiblePositionForContentsPoint(const IntPoint&, Loc
alFrame*); | 135 CORE_EXPORT VisiblePosition visiblePositionForContentsPoint(const IntPoint&, Loc
alFrame*); |
136 | 136 |
137 CORE_EXPORT bool rendersInDifferentPosition(const Position&, const Position&); | 137 CORE_EXPORT bool rendersInDifferentPosition(const Position&, const Position&); |
138 | 138 |
139 } // namespace blink | 139 } // namespace blink |
140 | 140 |
141 #endif // VisibleUnits_h | 141 #endif // VisibleUnits_h |
OLD | NEW |