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

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

Issue 20572005: Allow selection to skip over contenteditable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 7 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 | Annotate | Revision Log
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 EAffinity affinity() const { ASSERT(m_affinity == UPSTREAM || m_affinity == DOWNSTREAM); return m_affinity; } 65 EAffinity affinity() const { ASSERT(m_affinity == UPSTREAM || m_affinity == DOWNSTREAM); return m_affinity; }
66 void setAffinity(EAffinity affinity) { m_affinity = affinity; } 66 void setAffinity(EAffinity affinity) { m_affinity = affinity; }
67 67
68 // FIXME: Change the following functions' parameter from a boolean to StayIn EditableContent. 68 // FIXME: Change the following functions' parameter from a boolean to StayIn EditableContent.
69 69
70 // next() and previous() will increment/decrement by a character cluster. 70 // next() and previous() will increment/decrement by a character cluster.
71 VisiblePosition next(EditingBoundaryCrossingRule = CanCrossEditingBoundary) const; 71 VisiblePosition next(EditingBoundaryCrossingRule = CanCrossEditingBoundary) const;
72 VisiblePosition previous(EditingBoundaryCrossingRule = CanCrossEditingBounda ry) const; 72 VisiblePosition previous(EditingBoundaryCrossingRule = CanCrossEditingBounda ry) const;
73 VisiblePosition honorEditingBoundaryAtOrBefore(const VisiblePosition&) const ; 73 VisiblePosition honorEditingBoundaryAtOrBefore(const VisiblePosition&) const ;
74 VisiblePosition honorEditingBoundaryAtOrAfter(const VisiblePosition&) const; 74 VisiblePosition honorEditingBoundaryAtOrAfter(const VisiblePosition&) const;
75 VisiblePosition skipToStartOfEditingBoundary(const VisiblePosition&) const;
76 VisiblePosition skipToEndOfEditingBoundary(const VisiblePosition&) const;
75 77
76 VisiblePosition left(bool stayInEditableContent = false) const; 78 VisiblePosition left(bool stayInEditableContent = false) const;
77 VisiblePosition right(bool stayInEditableContent = false) const; 79 VisiblePosition right(bool stayInEditableContent = false) const;
78 80
79 UChar32 characterAfter() const; 81 UChar32 characterAfter() const;
80 UChar32 characterBefore() const { return previous().characterAfter(); } 82 UChar32 characterBefore() const { return previous().characterAfter(); }
81 83
82 // FIXME: This does not handle [table, 0] correctly. 84 // FIXME: This does not handle [table, 0] correctly.
83 Element* rootEditableElement() const { return m_deepPosition.isNotNull() ? m _deepPosition.deprecatedNode()->rootEditableElement() : 0; } 85 Element* rootEditableElement() const { return m_deepPosition.isNotNull() ? m _deepPosition.deprecatedNode()->rootEditableElement() : 0; }
84 86
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 143
142 } // namespace WebCore 144 } // namespace WebCore
143 145
144 #ifndef NDEBUG 146 #ifndef NDEBUG
145 // Outside the WebCore namespace for ease of invocation from gdb. 147 // Outside the WebCore namespace for ease of invocation from gdb.
146 void showTree(const WebCore::VisiblePosition*); 148 void showTree(const WebCore::VisiblePosition*);
147 void showTree(const WebCore::VisiblePosition&); 149 void showTree(const WebCore::VisiblePosition&);
148 #endif 150 #endif
149 151
150 #endif // VisiblePosition_h 152 #endif // VisiblePosition_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698