| Index: third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h
|
| diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h
|
| index 060c6b305b1149c465c58af5e5a460c015493c06..8bcf1a07c617a9a7b9a7658e9a65da3c80f3d806 100644
|
| --- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h
|
| +++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h
|
| @@ -40,16 +40,14 @@
|
|
|
| namespace blink {
|
|
|
| +class DocumentMarkerList;
|
| class Node;
|
| -class RenderedDocumentMarker;
|
| -class Text;
|
|
|
| class MarkerRemoverPredicate final {
|
| public:
|
| explicit MarkerRemoverPredicate(const Vector<String>& words);
|
| bool operator()(const DocumentMarker&, const Text&) const;
|
|
|
| - private:
|
| Vector<String> m_words;
|
| };
|
|
|
| @@ -63,6 +61,7 @@ class CORE_EXPORT DocumentMarkerController final
|
| explicit DocumentMarkerController(Document&);
|
|
|
| void clear();
|
| + void addMarker(Node*, DocumentMarker*);
|
| void addMarker(const Position& start,
|
| const Position& end,
|
| DocumentMarker::MarkerType,
|
| @@ -113,7 +112,7 @@ class CORE_EXPORT DocumentMarkerController final
|
| // Returns true if markers within a range defined by a node, |startOffset| and
|
| // |endOffset| are found.
|
| bool setMarkersActive(Node*, unsigned startOffset, unsigned endOffset, bool);
|
| - bool hasMarkers(Node* node) const { return m_markers.contains(node); }
|
| + bool hasMarkers(Node*) const;
|
|
|
| DocumentMarkerVector markersFor(
|
| Node*,
|
| @@ -122,9 +121,9 @@ class CORE_EXPORT DocumentMarkerController final
|
| DocumentMarker::MarkerTypes);
|
| DocumentMarkerVector markers();
|
| Vector<IntRect> renderedRectsForMarkers(DocumentMarker::MarkerType);
|
| - void updateMarkerRenderedRectIfNeeded(const Node&, RenderedDocumentMarker&);
|
| +
|
| void invalidateRectsForAllMarkers();
|
| - void invalidateRectsForMarkersInNode(const Node&);
|
| + void invalidateRectsForMarkersInNode(Node&);
|
|
|
| DECLARE_TRACE();
|
|
|
| @@ -139,23 +138,23 @@ class CORE_EXPORT DocumentMarkerController final
|
| unsigned newLength) final;
|
|
|
| private:
|
| - void addMarker(Node*, const DocumentMarker&);
|
| -
|
| - using MarkerList = HeapVector<Member<RenderedDocumentMarker>>;
|
| - using MarkerLists =
|
| - HeapVector<Member<MarkerList>, DocumentMarker::MarkerTypeIndexesCount>;
|
| - using MarkerMap = HeapHashMap<WeakMember<const Node>, Member<MarkerLists>>;
|
| - void mergeOverlapping(MarkerList*, RenderedDocumentMarker*);
|
| - bool possiblyHasMarkers(DocumentMarker::MarkerTypes);
|
| - void removeMarkersFromList(MarkerMap::iterator, DocumentMarker::MarkerTypes);
|
| + using MarkerMap = HeapHashMap<WeakMember<Node>, Member<DocumentMarkerList>>;
|
| +
|
| + DocumentMarkerList* createMarkerListOfType(DocumentMarker::MarkerType);
|
| + HeapVector<Member<DocumentMarkerList>> getMarkerListsForNode(
|
| + Node*,
|
| + DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers());
|
| + MarkerMap& markerMapForType(DocumentMarker::MarkerType);
|
| + const MarkerMap& markerMapForType(DocumentMarker::MarkerType) const;
|
| void removeMarkers(TextIterator&,
|
| DocumentMarker::MarkerTypes,
|
| RemovePartiallyOverlappingMarkerOrNot);
|
|
|
| - MarkerMap m_markers;
|
| - // Provide a quick way to determine whether a particular marker type is absent
|
| - // without going through the map.
|
| - DocumentMarker::MarkerTypes m_possiblyExistingMarkerTypes;
|
| + MarkerMap m_spelling;
|
| + MarkerMap m_grammar;
|
| + MarkerMap m_textMatches;
|
| + MarkerMap m_compositions;
|
| +
|
| const Member<const Document> m_document;
|
| };
|
|
|
|
|