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

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

Issue 1312213008: Move member function rootEditableElement() out from VisiblePosition class (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-31T17:55:42 Include VisiblePosition.h Created 5 years, 3 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, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 bool isNull() const { return m_deepPosition.isNull(); } 87 bool isNull() const { return m_deepPosition.isNull(); }
88 bool isNotNull() const { return m_deepPosition.isNotNull(); } 88 bool isNotNull() const { return m_deepPosition.isNotNull(); }
89 bool isOrphan() const { return m_deepPosition.isOrphan(); } 89 bool isOrphan() const { return m_deepPosition.isOrphan(); }
90 90
91 Position deepEquivalent() const { return m_deepPosition; } 91 Position deepEquivalent() const { return m_deepPosition; }
92 Position toParentAnchoredPosition() const { return deepEquivalent().parentAn choredEquivalent(); } 92 Position toParentAnchoredPosition() const { return deepEquivalent().parentAn choredEquivalent(); }
93 PositionWithAffinity toPositionWithAffinity() const { return PositionWithAff inity(m_deepPosition, m_affinity); } 93 PositionWithAffinity toPositionWithAffinity() const { return PositionWithAff inity(m_deepPosition, m_affinity); }
94 TextAffinity affinity() const { return m_affinity; } 94 TextAffinity affinity() const { return m_affinity; }
95 95
96 // TODO(yosin) This does not handle [table, 0] correctly.
97 Element* rootEditableElement() const { return m_deepPosition.isNotNull() ? m _deepPosition.anchorNode()->rootEditableElement() : 0; }
98
99 DECLARE_TRACE(); 96 DECLARE_TRACE();
100 97
101 #ifndef NDEBUG 98 #ifndef NDEBUG
102 void debugPosition(const char* msg = "") const; 99 void debugPosition(const char* msg = "") const;
103 void formatForDebugger(char* buffer, unsigned length) const; 100 void formatForDebugger(char* buffer, unsigned length) const;
104 void showTreeForThis() const; 101 void showTreeForThis() const;
105 #endif 102 #endif
106 103
107 private: 104 private:
108 template<typename Strategy> 105 template<typename Strategy>
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 147
151 } // namespace blink 148 } // namespace blink
152 149
153 #ifndef NDEBUG 150 #ifndef NDEBUG
154 // Outside the WebCore namespace for ease of invocation from gdb. 151 // Outside the WebCore namespace for ease of invocation from gdb.
155 void showTree(const blink::VisiblePosition*); 152 void showTree(const blink::VisiblePosition*);
156 void showTree(const blink::VisiblePosition&); 153 void showTree(const blink::VisiblePosition&);
157 #endif 154 #endif
158 155
159 #endif // VisiblePosition_h 156 #endif // VisiblePosition_h
OLDNEW
« no previous file with comments | « Source/core/editing/EditingUtilities.cpp ('k') | Source/core/editing/commands/InsertListCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698