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

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

Issue 2773883003: Add CompositionMarkerList in preparation for DocumentMarkerController refactor (Closed)
Patch Set: Make requested changes, refactor tests Created 3 years, 9 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 * This file is part of the DOM implementation for WebCore. 2 * This file is part of the DOM implementation for WebCore.
3 * 3 *
4 * Copyright (C) 2006 Apple Computer, Inc. 4 * Copyright (C) 2006 Apple Computer, Inc.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 const String& description() const; 154 const String& description() const;
155 bool activeMatch() const; 155 bool activeMatch() const;
156 Color underlineColor() const; 156 Color underlineColor() const;
157 bool thick() const; 157 bool thick() const;
158 Color backgroundColor() const; 158 Color backgroundColor() const;
159 DocumentMarkerDetails* details() const; 159 DocumentMarkerDetails* details() const;
160 160
161 void setActiveMatch(bool); 161 void setActiveMatch(bool);
162 void clearDetails() { m_details.clear(); } 162 void clearDetails() { m_details.clear(); }
163 163
164 // Offset modifications are done by DocumentMarkerController. 164 struct ShiftMarkerResult {
165 // Other classes should not call following setters. 165 unsigned newStartOffset;
166 unsigned newEndOffset;
167 bool shouldRemoveMarker;
168 };
169
170 ShiftMarkerResult getShiftedMarkerPosition(unsigned offset,
Xiaocheng 2017/03/25 00:05:35 I think we should add unit test for this function.
171 unsigned oldLength,
172 unsigned newLength) const;
173
174 // Offset modifications are done by DocumentMarkerController and subclasses of
175 // DocumentMarkerList. Other classes should not call following setters.
166 void setStartOffset(unsigned offset) { m_startOffset = offset; } 176 void setStartOffset(unsigned offset) { m_startOffset = offset; }
167 void setEndOffset(unsigned offset) { m_endOffset = offset; } 177 void setEndOffset(unsigned offset) { m_endOffset = offset; }
168 void shiftOffsets(int delta); 178 void shiftOffsets(int delta);
169 179
170 bool operator==(const DocumentMarker& o) const { 180 bool operator==(const DocumentMarker& o) const {
171 return type() == o.type() && startOffset() == o.startOffset() && 181 return type() == o.type() && startOffset() == o.startOffset() &&
172 endOffset() == o.endOffset(); 182 endOffset() == o.endOffset();
173 } 183 }
174 184
175 bool operator!=(const DocumentMarker& o) const { return !(*this == o); } 185 bool operator!=(const DocumentMarker& o) const { return !(*this == o); }
(...skipping 21 matching lines...) Expand all
197 virtual bool isDescription() const { return false; } 207 virtual bool isDescription() const { return false; }
198 virtual bool isTextMatch() const { return false; } 208 virtual bool isTextMatch() const { return false; }
199 virtual bool isComposition() const { return false; } 209 virtual bool isComposition() const { return false; }
200 210
201 DEFINE_INLINE_VIRTUAL_TRACE() {} 211 DEFINE_INLINE_VIRTUAL_TRACE() {}
202 }; 212 };
203 213
204 } // namespace blink 214 } // namespace blink
205 215
206 #endif // DocumentMarker_h 216 #endif // DocumentMarker_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698