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 25 matching lines...) Expand all Loading... |
36 class LayoutRect; | 36 class LayoutRect; |
37 class LayoutUnit; | 37 class LayoutUnit; |
38 class LayoutObject; | 38 class LayoutObject; |
39 class Node; | 39 class Node; |
40 class VisiblePosition; | 40 class VisiblePosition; |
41 class IntPoint; | 41 class IntPoint; |
42 class LocalFrame; | 42 class LocalFrame; |
43 | 43 |
44 enum EWordSide { RightWordIfOnBoundary = false, LeftWordIfOnBoundary = true }; | 44 enum EWordSide { RightWordIfOnBoundary = false, LeftWordIfOnBoundary = true }; |
45 | 45 |
| 46 // Position |
| 47 // mostForward/BackwardCaretPosition are used for moving back and forth between |
| 48 // visually equivalent candidates. |
| 49 // For example, for the text node "foo bar" where whitespace is |
| 50 // collapsible, there are two candidates that map to the VisiblePosition |
| 51 // between 'b' and the space, after first space and before last space. |
| 52 // |
| 53 // mostForwardCaretPosition returns the left candidate and also returs |
| 54 // [boundary, 0] for any of the positions from [boundary, 0] to the first |
| 55 // candidate in boundary, where |
| 56 // endsOfNodeAreVisuallyDistinctPositions(boundary) is true. |
| 57 // |
| 58 // mostBackwardCaretPosition() returns the right one and also returns the |
| 59 // last position in the last atomic node in boundary for all of the positions |
| 60 // in boundary after the last candidate, where |
| 61 // endsOfNodeAreVisuallyDistinctPositions(boundary). |
| 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 |
| 64 CORE_EXPORT Position mostForwardCaretPosition(const Position &, EditingBoundaryC
rossingRule = CannotCrossEditingBoundary); |
| 65 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 |
46 // words | 69 // words |
47 CORE_EXPORT VisiblePosition startOfWord(const VisiblePosition &, EWordSide = Rig
htWordIfOnBoundary); | 70 CORE_EXPORT VisiblePosition startOfWord(const VisiblePosition &, EWordSide = Rig
htWordIfOnBoundary); |
48 CORE_EXPORT VisiblePosition endOfWord(const VisiblePosition &, EWordSide = Right
WordIfOnBoundary); | 71 CORE_EXPORT VisiblePosition endOfWord(const VisiblePosition &, EWordSide = Right
WordIfOnBoundary); |
49 VisiblePosition previousWordPosition(const VisiblePosition &); | 72 VisiblePosition previousWordPosition(const VisiblePosition &); |
50 VisiblePosition nextWordPosition(const VisiblePosition &); | 73 VisiblePosition nextWordPosition(const VisiblePosition &); |
51 VisiblePosition rightWordPosition(const VisiblePosition&, bool skipsSpaceWhenMov
ingRight); | 74 VisiblePosition rightWordPosition(const VisiblePosition&, bool skipsSpaceWhenMov
ingRight); |
52 VisiblePosition leftWordPosition(const VisiblePosition&, bool skipsSpaceWhenMovi
ngRight); | 75 VisiblePosition leftWordPosition(const VisiblePosition&, bool skipsSpaceWhenMovi
ngRight); |
53 | 76 |
54 // sentences | 77 // sentences |
55 CORE_EXPORT VisiblePosition startOfSentence(const VisiblePosition &); | 78 CORE_EXPORT VisiblePosition startOfSentence(const VisiblePosition &); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 131 |
109 // Returns a hit-tested VisiblePosition for the given point in contents-space | 132 // Returns a hit-tested VisiblePosition for the given point in contents-space |
110 // coordinates. | 133 // coordinates. |
111 CORE_EXPORT VisiblePosition visiblePositionForContentsPoint(const IntPoint&, Loc
alFrame*); | 134 CORE_EXPORT VisiblePosition visiblePositionForContentsPoint(const IntPoint&, Loc
alFrame*); |
112 | 135 |
113 CORE_EXPORT bool rendersInDifferentPosition(const Position&, const Position&); | 136 CORE_EXPORT bool rendersInDifferentPosition(const Position&, const Position&); |
114 | 137 |
115 } // namespace blink | 138 } // namespace blink |
116 | 139 |
117 #endif // VisibleUnits_h | 140 #endif // VisibleUnits_h |
OLD | NEW |