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

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

Issue 2694043004: Selection API: anchorNode, anchorOffset, focusNode, focusOffset, isCollapsed, and type should be ba… (Closed)
Patch Set: . Created 3 years, 10 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 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 bool isNone() const { return getSelectionType() == NoSelection; } 109 bool isNone() const { return getSelectionType() == NoSelection; }
110 bool isCaret() const { return getSelectionType() == CaretSelection; } 110 bool isCaret() const { return getSelectionType() == CaretSelection; }
111 bool isRange() const { return getSelectionType() == RangeSelection; } 111 bool isRange() const { return getSelectionType() == RangeSelection; }
112 bool isNonOrphanedRange() const { 112 bool isNonOrphanedRange() const {
113 return isRange() && !start().isOrphan() && !end().isOrphan(); 113 return isRange() && !start().isOrphan() && !end().isOrphan();
114 } 114 }
115 bool isNonOrphanedCaretOrRange() const { 115 bool isNonOrphanedCaretOrRange() const {
116 return !isNone() && !start().isOrphan() && !end().isOrphan(); 116 return !isNone() && !start().isOrphan() && !end().isOrphan();
117 } 117 }
118 118
119 // True if base() <= extent().
119 bool isBaseFirst() const { return m_baseIsFirst; } 120 bool isBaseFirst() const { return m_baseIsFirst; }
120 bool isDirectional() const { return m_isDirectional; } 121 bool isDirectional() const { return m_isDirectional; }
121 void setIsDirectional(bool isDirectional) { m_isDirectional = isDirectional; } 122 void setIsDirectional(bool isDirectional) { m_isDirectional = isDirectional; }
122 123
123 void appendTrailingWhitespace(); 124 void appendTrailingWhitespace();
124 125
125 // TODO(yosin) Most callers probably don't want these functions, but 126 // TODO(yosin) Most callers probably don't want these functions, but
126 // are using them for historical reasons. |toNormalizedEphemeralRange()| 127 // are using them for historical reasons. |toNormalizedEphemeralRange()|
127 // contracts the range around text, and moves the caret most backward 128 // contracts the range around text, and moves the caret most backward
128 // visually equivalent position before returning the range/positions. 129 // visually equivalent position before returning the range/positions.
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 219
219 #ifndef NDEBUG 220 #ifndef NDEBUG
220 // Outside the WebCore namespace for ease of invocation from gdb. 221 // Outside the WebCore namespace for ease of invocation from gdb.
221 void showTree(const blink::VisibleSelection&); 222 void showTree(const blink::VisibleSelection&);
222 void showTree(const blink::VisibleSelection*); 223 void showTree(const blink::VisibleSelection*);
223 void showTree(const blink::VisibleSelectionInFlatTree&); 224 void showTree(const blink::VisibleSelectionInFlatTree&);
224 void showTree(const blink::VisibleSelectionInFlatTree*); 225 void showTree(const blink::VisibleSelectionInFlatTree*);
225 #endif 226 #endif
226 227
227 #endif // VisibleSelection_h 228 #endif // VisibleSelection_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698