Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: Source/core/editing/VisibleUnits.h

Issue 1303173002: Move computeInlineBoxPosition() to VisibleUnits.{cpp,h} from Position.{cpp,h} and VisiblePosition.h (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-21T13:45:14 Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/editing/VisiblePosition.h ('k') | Source/core/editing/VisibleUnits.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 21 matching lines...) Expand all
32 #include "platform/text/TextDirection.h" 32 #include "platform/text/TextDirection.h"
33 33
34 namespace blink { 34 namespace blink {
35 35
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 InlineBox;
42 class LocalFrame; 43 class LocalFrame;
43 44
44 enum EWordSide { RightWordIfOnBoundary = false, LeftWordIfOnBoundary = true }; 45 enum EWordSide { RightWordIfOnBoundary = false, LeftWordIfOnBoundary = true };
45 46
47 struct InlineBoxPosition {
48 InlineBox* inlineBox;
49 int offsetInBox;
50
51 InlineBoxPosition()
52 : inlineBox(nullptr), offsetInBox(0)
53 {
54 }
55
56 InlineBoxPosition(InlineBox* inlineBox, int offsetInBox)
57 : inlineBox(inlineBox), offsetInBox(offsetInBox)
58 {
59 }
60 };
61
46 // Position 62 // Position
47 // mostForward/BackwardCaretPosition are used for moving back and forth between 63 // mostForward/BackwardCaretPosition are used for moving back and forth between
48 // visually equivalent candidates. 64 // visually equivalent candidates.
49 // For example, for the text node "foo bar" where whitespace is 65 // For example, for the text node "foo bar" where whitespace is
50 // collapsible, there are two candidates that map to the VisiblePosition 66 // collapsible, there are two candidates that map to the VisiblePosition
51 // between 'b' and the space, after first space and before last space. 67 // between 'b' and the space, after first space and before last space.
52 // 68 //
53 // mostForwardCaretPosition returns the left candidate and also returs 69 // mostForwardCaretPosition returns the left candidate and also returs
54 // [boundary, 0] for any of the positions from [boundary, 0] to the first 70 // [boundary, 0] for any of the positions from [boundary, 0] to the first
55 // candidate in boundary, where 71 // candidate in boundary, where
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 VisiblePosition startOfDocument(const VisiblePosition &); 135 VisiblePosition startOfDocument(const VisiblePosition &);
120 VisiblePosition endOfDocument(const VisiblePosition &); 136 VisiblePosition endOfDocument(const VisiblePosition &);
121 bool isStartOfDocument(const VisiblePosition &); 137 bool isStartOfDocument(const VisiblePosition &);
122 bool isEndOfDocument(const VisiblePosition &); 138 bool isEndOfDocument(const VisiblePosition &);
123 139
124 // editable content 140 // editable content
125 VisiblePosition startOfEditableContent(const VisiblePosition&); 141 VisiblePosition startOfEditableContent(const VisiblePosition&);
126 VisiblePosition endOfEditableContent(const VisiblePosition&); 142 VisiblePosition endOfEditableContent(const VisiblePosition&);
127 bool isEndOfEditableOrNonEditableContent(const VisiblePosition&); 143 bool isEndOfEditableOrNonEditableContent(const VisiblePosition&);
128 144
145 CORE_EXPORT InlineBoxPosition computeInlineBoxPosition(const Position&, TextAffi nity);
146 CORE_EXPORT InlineBoxPosition computeInlineBoxPosition(const Position&, TextAffi nity, TextDirection primaryDirection);
147 CORE_EXPORT InlineBoxPosition computeInlineBoxPosition(const PositionInComposedT ree&, TextAffinity);
148 CORE_EXPORT InlineBoxPosition computeInlineBoxPosition(const PositionInComposedT ree&, TextAffinity, TextDirection primaryDirection);
149 CORE_EXPORT InlineBoxPosition computeInlineBoxPosition(const VisiblePosition&);
150
129 // Rect is local to the returned layoutObject 151 // Rect is local to the returned layoutObject
130 LayoutRect localCaretRectOfPosition(const PositionWithAffinity&, LayoutObject*&) ; 152 LayoutRect localCaretRectOfPosition(const PositionWithAffinity&, LayoutObject*&) ;
131 bool hasRenderedNonAnonymousDescendantsWithHeight(LayoutObject*); 153 bool hasRenderedNonAnonymousDescendantsWithHeight(LayoutObject*);
132 154
133 // Returns a hit-tested VisiblePosition for the given point in contents-space 155 // Returns a hit-tested VisiblePosition for the given point in contents-space
134 // coordinates. 156 // coordinates.
135 CORE_EXPORT VisiblePosition visiblePositionForContentsPoint(const IntPoint&, Loc alFrame*); 157 CORE_EXPORT VisiblePosition visiblePositionForContentsPoint(const IntPoint&, Loc alFrame*);
136 158
137 CORE_EXPORT bool rendersInDifferentPosition(const Position&, const Position&); 159 CORE_EXPORT bool rendersInDifferentPosition(const Position&, const Position&);
138 160
139 } // namespace blink 161 } // namespace blink
140 162
141 #endif // VisibleUnits_h 163 #endif // VisibleUnits_h
OLDNEW
« no previous file with comments | « Source/core/editing/VisiblePosition.h ('k') | Source/core/editing/VisibleUnits.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698