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

Side by Side Diff: Source/core/dom/DocumentMarkerController.h

Issue 23703016: [blink] Use functions for AllMarkers and MisspellingMarkers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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) 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 reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 8 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 void detach(); 50 void detach();
51 void addMarker(Range*, DocumentMarker::MarkerType); 51 void addMarker(Range*, DocumentMarker::MarkerType);
52 void addMarker(Range*, DocumentMarker::MarkerType, const String& description ); 52 void addMarker(Range*, DocumentMarker::MarkerType, const String& description );
53 void addMarker(Range*, DocumentMarker::MarkerType, const String& description , uint32_t hash); 53 void addMarker(Range*, DocumentMarker::MarkerType, const String& description , uint32_t hash);
54 void addMarkerToNode(Node*, unsigned startOffset, unsigned length, DocumentM arker::MarkerType); 54 void addMarkerToNode(Node*, unsigned startOffset, unsigned length, DocumentM arker::MarkerType);
55 void addMarkerToNode(Node*, unsigned startOffset, unsigned length, DocumentM arker::MarkerType, PassRefPtr<DocumentMarkerDetails>); 55 void addMarkerToNode(Node*, unsigned startOffset, unsigned length, DocumentM arker::MarkerType, PassRefPtr<DocumentMarkerDetails>);
56 void addTextMatchMarker(const Range*, bool activeMatch); 56 void addTextMatchMarker(const Range*, bool activeMatch);
57 57
58 void copyMarkers(Node* srcNode, unsigned startOffset, int length, Node* dstN ode, int delta); 58 void copyMarkers(Node* srcNode, unsigned startOffset, int length, Node* dstN ode, int delta);
59 bool hasMarkers(Range*, DocumentMarker::MarkerTypes = DocumentMarker::AllMar kers()); 59 bool hasMarkers(Range*, DocumentMarker::MarkerTypes = DocumentMarker::allMar kers());
60 60
61 // When a marker partially overlaps with range, if removePartiallyOverlappin gMarkers is true, we completely 61 // When a marker partially overlaps with range, if removePartiallyOverlappin gMarkers is true, we completely
62 // remove the marker. If the argument is false, we will adjust the span of t he marker so that it retains 62 // remove the marker. If the argument is false, we will adjust the span of t he marker so that it retains
63 // the portion that is outside of the range. 63 // the portion that is outside of the range.
64 enum RemovePartiallyOverlappingMarkerOrNot { DoNotRemovePartiallyOverlapping Marker, RemovePartiallyOverlappingMarker }; 64 enum RemovePartiallyOverlappingMarkerOrNot { DoNotRemovePartiallyOverlapping Marker, RemovePartiallyOverlappingMarker };
65 void removeMarkers(Range*, DocumentMarker::MarkerTypes = DocumentMarker::All Markers(), RemovePartiallyOverlappingMarkerOrNot = DoNotRemovePartiallyOverlappi ngMarker); 65 void removeMarkers(Range*, DocumentMarker::MarkerTypes = DocumentMarker::all Markers(), RemovePartiallyOverlappingMarkerOrNot = DoNotRemovePartiallyOverlappi ngMarker);
66 void removeMarkers(Node*, unsigned startOffset, int length, DocumentMarker:: MarkerTypes = DocumentMarker::AllMarkers(), RemovePartiallyOverlappingMarkerOrN ot = DoNotRemovePartiallyOverlappingMarker); 66 void removeMarkers(Node*, unsigned startOffset, int length, DocumentMarker:: MarkerTypes = DocumentMarker::allMarkers(), RemovePartiallyOverlappingMarkerOrN ot = DoNotRemovePartiallyOverlappingMarker);
67 67
68 void removeMarkers(DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers( )); 68 void removeMarkers(DocumentMarker::MarkerTypes = DocumentMarker::allMarkers( ));
69 void removeMarkers(Node*, DocumentMarker::MarkerTypes = DocumentMarker::AllM arkers()); 69 void removeMarkers(Node*, DocumentMarker::MarkerTypes = DocumentMarker::allM arkers());
70 void repaintMarkers(DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers ()); 70 void repaintMarkers(DocumentMarker::MarkerTypes = DocumentMarker::allMarkers ());
71 void invalidateRenderedRectsForMarkersInRect(const LayoutRect&); 71 void invalidateRenderedRectsForMarkersInRect(const LayoutRect&);
72 void shiftMarkers(Node*, unsigned startOffset, int delta); 72 void shiftMarkers(Node*, unsigned startOffset, int delta);
73 void setMarkersActive(Range*, bool); 73 void setMarkersActive(Range*, bool);
74 void setMarkersActive(Node*, unsigned startOffset, unsigned endOffset, bool) ; 74 void setMarkersActive(Node*, unsigned startOffset, unsigned endOffset, bool) ;
75 75
76 DocumentMarker* markerContainingPoint(const LayoutPoint&, DocumentMarker::Ma rkerType); 76 DocumentMarker* markerContainingPoint(const LayoutPoint&, DocumentMarker::Ma rkerType);
77 Vector<DocumentMarker*> markersFor(Node*, DocumentMarker::MarkerTypes = Docu mentMarker::AllMarkers()); 77 Vector<DocumentMarker*> markersFor(Node*, DocumentMarker::MarkerTypes = Docu mentMarker::allMarkers());
78 Vector<DocumentMarker*> markersInRange(Range*, DocumentMarker::MarkerTypes); 78 Vector<DocumentMarker*> markersInRange(Range*, DocumentMarker::MarkerTypes);
79 Vector<DocumentMarker*> markers(); 79 Vector<DocumentMarker*> markers();
80 Vector<IntRect> renderedRectsForMarkers(DocumentMarker::MarkerType); 80 Vector<IntRect> renderedRectsForMarkers(DocumentMarker::MarkerType);
81 81
82 #ifndef NDEBUG 82 #ifndef NDEBUG
83 void showMarkers() const; 83 void showMarkers() const;
84 #endif 84 #endif
85 85
86 private: 86 private:
87 void addMarker(Node*, const DocumentMarker&); 87 void addMarker(Node*, const DocumentMarker&);
88 88
89 typedef Vector<RenderedDocumentMarker> MarkerList; 89 typedef Vector<RenderedDocumentMarker> MarkerList;
90 typedef HashMap<RefPtr<Node>, OwnPtr<MarkerList> > MarkerMap; 90 typedef HashMap<RefPtr<Node>, OwnPtr<MarkerList> > MarkerMap;
91 bool possiblyHasMarkers(DocumentMarker::MarkerTypes); 91 bool possiblyHasMarkers(DocumentMarker::MarkerTypes);
92 void removeMarkersFromList(MarkerMap::iterator, DocumentMarker::MarkerTypes) ; 92 void removeMarkersFromList(MarkerMap::iterator, DocumentMarker::MarkerTypes) ;
93 93
94 MarkerMap m_markers; 94 MarkerMap m_markers;
95 // Provide a quick way to determine whether a particular marker type is abse nt without going through the map. 95 // Provide a quick way to determine whether a particular marker type is abse nt without going through the map.
96 DocumentMarker::MarkerTypes m_possiblyExistingMarkerTypes; 96 DocumentMarker::MarkerTypes m_possiblyExistingMarkerTypes;
97 }; 97 };
98 98
99 } // namespace WebCore 99 } // namespace WebCore
100 100
101 #ifndef NDEBUG 101 #ifndef NDEBUG
102 void showDocumentMarkers(const WebCore::DocumentMarkerController*); 102 void showDocumentMarkers(const WebCore::DocumentMarkerController*);
103 #endif 103 #endif
104 104
105 #endif // DocumentMarkerController_h 105 #endif // DocumentMarkerController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698