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

Side by Side Diff: third_party/WebKit/Source/core/editing/Position.h

Issue 1756763002: 2016-03-02T18:53:01 LayoutPosition Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-04-25T19:02:18 Created 4 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2008 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 17 matching lines...) Expand all
28 28
29 #include "core/CoreExport.h" 29 #include "core/CoreExport.h"
30 #include "core/dom/ContainerNode.h" 30 #include "core/dom/ContainerNode.h"
31 #include "core/editing/EditingBoundary.h" 31 #include "core/editing/EditingBoundary.h"
32 #include "core/editing/EditingStrategy.h" 32 #include "core/editing/EditingStrategy.h"
33 #include "platform/heap/Handle.h" 33 #include "platform/heap/Handle.h"
34 #include "platform/text/TextDirection.h" 34 #include "platform/text/TextDirection.h"
35 #include "wtf/Assertions.h" 35 #include "wtf/Assertions.h"
36 #include "wtf/PassRefPtr.h" 36 #include "wtf/PassRefPtr.h"
37 #include "wtf/RefPtr.h" 37 #include "wtf/RefPtr.h"
38 #include <iosfwd>
38 39
39 namespace blink { 40 namespace blink {
40 41
41 class Element; 42 class Element;
42 class Node; 43 class Node;
43 class LayoutObject; 44 class LayoutObject;
44 class Text; 45 class Text;
45 enum class TextAffinity; 46 enum class TextAffinity;
46 class TreeScope; 47 class TreeScope;
47 48
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 static PositionTemplate<Strategy> afterNode(Node* anchorNode); 167 static PositionTemplate<Strategy> afterNode(Node* anchorNode);
167 static PositionTemplate<Strategy> inParentBeforeNode(const Node& anchorNode) ; 168 static PositionTemplate<Strategy> inParentBeforeNode(const Node& anchorNode) ;
168 static PositionTemplate<Strategy> inParentAfterNode(const Node& anchorNode); 169 static PositionTemplate<Strategy> inParentAfterNode(const Node& anchorNode);
169 static int lastOffsetInNode(Node* anchorNode); 170 static int lastOffsetInNode(Node* anchorNode);
170 static PositionTemplate<Strategy> firstPositionInNode(Node* anchorNode); 171 static PositionTemplate<Strategy> firstPositionInNode(Node* anchorNode);
171 static PositionTemplate<Strategy> lastPositionInNode(Node* anchorNode); 172 static PositionTemplate<Strategy> lastPositionInNode(Node* anchorNode);
172 static int minOffsetForNode(Node* anchorNode, int offset); 173 static int minOffsetForNode(Node* anchorNode, int offset);
173 static bool offsetIsBeforeLastNodeOffset(int offset, Node* anchorNode); 174 static bool offsetIsBeforeLastNodeOffset(int offset, Node* anchorNode);
174 static PositionTemplate<Strategy> firstPositionInOrBeforeNode(Node* anchorNo de); 175 static PositionTemplate<Strategy> firstPositionInOrBeforeNode(Node* anchorNo de);
175 static PositionTemplate<Strategy> lastPositionInOrAfterNode(Node* anchorNode ); 176 static PositionTemplate<Strategy> lastPositionInOrAfterNode(Node* anchorNode );
177 static PositionTemplate<Strategy> normalize(const PositionTemplate<Strategy> &);
176 178
177 void debugPosition(const char* msg = "") const; 179 void debugPosition(const char* msg = "") const;
178 180
179 #ifndef NDEBUG 181 #ifndef NDEBUG
180 void formatForDebugger(char* buffer, unsigned length) const; 182 void formatForDebugger(char* buffer, unsigned length) const;
181 void showAnchorTypeAndOffset() const;
182 void showTreeForThis() const; 183 void showTreeForThis() const;
183 void showTreeForThisInFlatTree() const; 184 void showTreeForThisInFlatTree() const;
184 #endif 185 #endif
185 186
186 DEFINE_INLINE_TRACE() 187 DEFINE_INLINE_TRACE()
187 { 188 {
188 visitor->trace(m_anchorNode); 189 visitor->trace(m_anchorNode);
189 } 190 }
190 191
191 private: 192 private:
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 405
405 } // namespace blink 406 } // namespace blink
406 407
407 #ifndef NDEBUG 408 #ifndef NDEBUG
408 // Outside the WebCore namespace for ease of invocation from gdb. 409 // Outside the WebCore namespace for ease of invocation from gdb.
409 void showTree(const blink::Position&); 410 void showTree(const blink::Position&);
410 void showTree(const blink::Position*); 411 void showTree(const blink::Position*);
411 #endif 412 #endif
412 413
413 #endif // Position_h 414 #endif // Position_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/LayoutTreeTraversal.cpp ('k') | third_party/WebKit/Source/core/editing/Position.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698