Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/markers/DocumentMarker.h |
| diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.h b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.h |
| index dbcfdf2964555be13aa50b7551bf2305f37a6fd8..491ea4e401f73541d6721743efb620fe2e5ed623 100644 |
| --- a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.h |
| +++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.h |
| @@ -161,8 +161,18 @@ class CORE_EXPORT DocumentMarker : public GarbageCollected<DocumentMarker> { |
| void setActiveMatch(bool); |
| void clearDetails() { m_details.clear(); } |
| - // Offset modifications are done by DocumentMarkerController. |
| - // Other classes should not call following setters. |
| + struct ShiftMarkerResult { |
| + unsigned newStartOffset; |
| + unsigned newEndOffset; |
| + bool shouldRemoveMarker; |
| + }; |
| + |
| + ShiftMarkerResult getShiftedMarkerPosition(unsigned offset, |
|
Xiaocheng
2017/03/25 00:05:35
I think we should add unit test for this function.
|
| + unsigned oldLength, |
| + unsigned newLength) const; |
| + |
| + // Offset modifications are done by DocumentMarkerController and subclasses of |
| + // DocumentMarkerList. Other classes should not call following setters. |
| void setStartOffset(unsigned offset) { m_startOffset = offset; } |
| void setEndOffset(unsigned offset) { m_endOffset = offset; } |
| void shiftOffsets(int delta); |