OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights |
7 * reserved. | 7 * reserved. |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
10 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 public SynchronousMutationObserver { | 48 public SynchronousMutationObserver { |
49 WTF_MAKE_NONCOPYABLE(DocumentMarkerController); | 49 WTF_MAKE_NONCOPYABLE(DocumentMarkerController); |
50 USING_GARBAGE_COLLECTED_MIXIN(DocumentMarkerController); | 50 USING_GARBAGE_COLLECTED_MIXIN(DocumentMarkerController); |
51 | 51 |
52 public: | 52 public: |
53 explicit DocumentMarkerController(Document&); | 53 explicit DocumentMarkerController(Document&); |
54 | 54 |
55 void clear(); | 55 void clear(); |
56 void addMarker(Node*, DocumentMarker*); | 56 void addMarker(Node*, DocumentMarker*); |
57 | 57 |
58 void addSpellingMarker(const Position& start, | 58 void addSpellingMarker(const EphemeralRange&, |
59 const Position& end, | |
60 const String& description = emptyString); | 59 const String& description = emptyString); |
61 void addGrammarMarker(const Position& start, | 60 void addGrammarMarker(const EphemeralRange&, |
62 const Position& end, | |
63 const String& description = emptyString); | 61 const String& description = emptyString); |
64 void addTextMatchMarker(const EphemeralRange&, bool activeMatch); | 62 void addTextMatchMarker(const EphemeralRange&, bool activeMatch); |
65 void addCompositionMarker(const Position& start, | 63 void addCompositionMarker(const EphemeralRange&, |
66 const Position& end, | |
67 Color underlineColor, | 64 Color underlineColor, |
68 bool thick, | 65 bool thick, |
69 Color backgroundColor); | 66 Color backgroundColor); |
70 | 67 |
71 void copyMarkers(Node* srcNode, | 68 void copyMarkers(Node* srcNode, |
72 unsigned startOffset, | 69 unsigned startOffset, |
73 int length, | 70 int length, |
74 Node* dstNode, | 71 Node* dstNode, |
75 int delta); | 72 int delta); |
76 | 73 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 128 |
132 // SynchronousMutationObserver | 129 // SynchronousMutationObserver |
133 void didUpdateCharacterData(CharacterData*, | 130 void didUpdateCharacterData(CharacterData*, |
134 unsigned offset, | 131 unsigned offset, |
135 unsigned oldLength, | 132 unsigned oldLength, |
136 unsigned newLength) final; | 133 unsigned newLength) final; |
137 | 134 |
138 private: | 135 private: |
139 using MarkerMap = HeapHashMap<WeakMember<Node>, Member<DocumentMarkerList>>; | 136 using MarkerMap = HeapHashMap<WeakMember<Node>, Member<DocumentMarkerList>>; |
140 | 137 |
141 void addGrammarOrSpellingMarker(const Position& start, | 138 void addGrammarOrSpellingMarker(const EphemeralRange&, |
142 const Position& end, | |
143 DocumentMarker::MarkerType, | 139 DocumentMarker::MarkerType, |
144 const String& description); | 140 const String& description); |
145 DocumentMarkerList* createMarkerListOfType(DocumentMarker::MarkerType); | 141 DocumentMarkerList* createMarkerListOfType(DocumentMarker::MarkerType); |
146 HeapVector<Member<DocumentMarkerList>> getMarkerListsForNode( | 142 HeapVector<Member<DocumentMarkerList>> getMarkerListsForNode( |
147 Node*, | 143 Node*, |
148 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); | 144 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); |
149 MarkerMap& markerMapForType(DocumentMarker::MarkerType); | 145 MarkerMap& markerMapForType(DocumentMarker::MarkerType); |
150 const MarkerMap& markerMapForType(DocumentMarker::MarkerType) const; | 146 const MarkerMap& markerMapForType(DocumentMarker::MarkerType) const; |
151 void removeMarkers(TextIterator&, | 147 void removeMarkers(TextIterator&, |
152 DocumentMarker::MarkerTypes, | 148 DocumentMarker::MarkerTypes, |
153 RemovePartiallyOverlappingMarkerOrNot); | 149 RemovePartiallyOverlappingMarkerOrNot); |
154 | 150 |
155 MarkerMap m_spelling; | 151 MarkerMap m_spelling; |
156 MarkerMap m_grammar; | 152 MarkerMap m_grammar; |
157 MarkerMap m_textMatches; | 153 MarkerMap m_textMatches; |
158 MarkerMap m_compositions; | 154 MarkerMap m_compositions; |
159 | 155 |
160 const Member<const Document> m_document; | 156 const Member<const Document> m_document; |
161 }; | 157 }; |
162 | 158 |
163 } // namespace blink | 159 } // namespace blink |
164 | 160 |
165 #ifndef NDEBUG | 161 #ifndef NDEBUG |
166 void showDocumentMarkers(const blink::DocumentMarkerController*); | 162 void showDocumentMarkers(const blink::DocumentMarkerController*); |
167 #endif | 163 #endif |
168 | 164 |
169 #endif // DocumentMarkerController_h | 165 #endif // DocumentMarkerController_h |
OLD | NEW |