@@ -51,61 +51,61 @@ template<> struct IsDeprecatedWeakRefSmartPointerException<WebCore::DocumentMark
51
51
52
52
namespace WebCore {
53
53
54
- // A range of a node within a document that is "marked", such as the range of a misspelled word.
55
- // It optionally includes a description that could be displayed in the user interface.
56
- class DocumentMarker : public CanMakeWeakPtr<DocumentMarker> {
57
- public:
58
- enum class Type : uint32_t {
59
- Spelling = 1 << 0 ,
60
- Grammar = 1 << 1 ,
61
- TextMatch = 1 << 2 ,
62
- // Text has been modified by spell correction, reversion of spell correction or other type of substitution.
63
- // On some platforms, this prevents the text from being autocorrected again. On post Snow Leopard Mac OS X,
64
- // if a Replacement marker contains non-empty description, a reversion UI will be shown.
65
- Replacement = 1 << 3 ,
66
- // Renderer needs to add underline indicating that the text has been modified by spell
67
- // correction. Text with Replacement marker doesn't necessarily has CorrectionIndicator
68
- // marker. For instance, after some text has been corrected, it will have both Replacement
69
- // and CorrectionIndicator. However, if user further modifies such text, we would remove
70
- // CorrectionIndicator marker, but retain Replacement marker.
71
- CorrectionIndicator = 1 << 4 ,
72
- // Correction suggestion has been offered, but got rejected by user.
73
- RejectedCorrection = 1 << 5 ,
74
- // Text has been modified by autocorrection. The description of this marker is the original text before autocorrection.
75
- Autocorrected = 1 << 6 ,
76
- // On some platforms, this prevents the text from being spellchecked again.
77
- SpellCheckingExemption = 1 << 7 ,
78
- // This marker indicates user has deleted an autocorrection starting at the end of the
79
- // range that bears this marker. In some platforms, if the user later inserts the same original
80
- // word again at this position, it will not be autocorrected again. The description of this
81
- // marker is the original word before autocorrection was applied.
82
- DeletedAutocorrection = 1 << 8 ,
83
- // This marker indicates that the range of text spanned by the marker is entered by voice dictation,
84
- // and it has alternative text.
85
- DictationAlternatives = 1 << 9 ,
54
+ enum class DocumentMarkerType : uint32_t {
55
+ Spelling = 1 << 0 ,
56
+ Grammar = 1 << 1 ,
57
+ TextMatch = 1 << 2 ,
58
+ // Text has been modified by spell correction, reversion of spell correction or other type of substitution.
59
+ // On some platforms, this prevents the text from being autocorrected again. On post Snow Leopard Mac OS X,
60
+ // if a Replacement marker contains non-empty description, a reversion UI will be shown.
61
+ Replacement = 1 << 3 ,
62
+ // Renderer needs to add underline indicating that the text has been modified by spell
63
+ // correction. Text with Replacement marker doesn't necessarily has CorrectionIndicator
64
+ // marker. For instance, after some text has been corrected, it will have both Replacement
65
+ // and CorrectionIndicator. However, if user further modifies such text, we would remove
66
+ // CorrectionIndicator marker, but retain Replacement marker.
67
+ CorrectionIndicator = 1 << 4 ,
68
+ // Correction suggestion has been offered, but got rejected by user.
69
+ RejectedCorrection = 1 << 5 ,
70
+ // Text has been modified by autocorrection. The description of this marker is the original text before autocorrection.
71
+ Autocorrected = 1 << 6 ,
72
+ // On some platforms, this prevents the text from being spellchecked again.
73
+ SpellCheckingExemption = 1 << 7 ,
74
+ // This marker indicates user has deleted an autocorrection starting at the end of the
75
+ // range that bears this marker. In some platforms, if the user later inserts the same original
76
+ // word again at this position, it will not be autocorrected again. The description of this
77
+ // marker is the original word before autocorrection was applied.
78
+ DeletedAutocorrection = 1 << 8 ,
79
+ // This marker indicates that the range of text spanned by the marker is entered by voice dictation,
80
+ // and it has alternative text.
81
+ DictationAlternatives = 1 << 9 ,
86
82
#if ENABLE(TELEPHONE_NUMBER_DETECTION)
87
- TelephoneNumber = 1 << 10 ,
83
+ TelephoneNumber = 1 << 10 ,
88
84
#endif
89
85
#if PLATFORM(IOS_FAMILY)
90
- // FIXME: iOS should share the same dictation mark system with the other platforms.
91
- DictationPhraseWithAlternatives = 1 << 11 ,
92
- DictationResult = 1 << 12 ,
86
+ // FIXME: iOS should share the same dictation mark system with the other platforms.
87
+ DictationPhraseWithAlternatives = 1 << 11 ,
88
+ DictationResult = 1 << 12 ,
93
89
#endif
94
- // This marker indicates that the user has selected a text candidate.
95
- AcceptedCandidate = 1 << 13 ,
96
- // This marker indicates that the user has initiated a drag with this content.
97
- DraggedContent = 1 << 14 ,
90
+ // This marker indicates that the user has selected a text candidate.
91
+ AcceptedCandidate = 1 << 13 ,
92
+ // This marker indicates that the user has initiated a drag with this content.
93
+ DraggedContent = 1 << 14 ,
98
94
#if ENABLE(PLATFORM_DRIVEN_TEXT_CHECKING)
99
- // This marker maintains state for the platform text checker.
100
- PlatformTextChecking = 1 << 15 ,
95
+ // This marker maintains state for the platform text checker.
96
+ PlatformTextChecking = 1 << 15 ,
101
97
#endif
102
98
#if ENABLE(WRITING_TOOLS)
103
- WritingToolsTextSuggestion = 1 << 16 ,
99
+ WritingToolsTextSuggestion = 1 << 16 ,
104
100
#endif
105
- TransparentContent = 1 << 17 ,
106
- };
101
+ TransparentContent = 1 << 17 ,
102
+ };
107
103
108
- static constexpr OptionSet<Type> allMarkers ();
104
+ // A range of a node within a document that is "marked", such as the range of a misspelled word.
105
+ // It optionally includes a description that could be displayed in the user interface.
106
+ class DocumentMarker : public CanMakeWeakPtr<DocumentMarker> {
107
+ public:
108
+ static constexpr OptionSet<DocumentMarkerType> allMarkers ();
109
109
110
110
struct DictationData {
111
111
DictationContext context;
@@ -159,9 +159,9 @@ class DocumentMarker : public CanMakeWeakPtr<DocumentMarker> {
159
159
, TransparentContentData // TransparentContent
160
160
>;
161
161
162
- DocumentMarker (Type , OffsetRange, Data&& = { });
162
+ DocumentMarker (DocumentMarkerType , OffsetRange, Data&& = { });
163
163
164
- Type type () const { return m_type; }
164
+ DocumentMarkerType type () const { return m_type; }
165
165
unsigned startOffset () const { return m_range.start ; }
166
166
unsigned endOffset () const { return m_range.end ; }
167
167
@@ -177,44 +177,44 @@ class DocumentMarker : public CanMakeWeakPtr<DocumentMarker> {
177
177
void shiftOffsets (int delta);
178
178
179
179
private:
180
- Type m_type;
180
+ DocumentMarkerType m_type;
181
181
OffsetRange m_range;
182
182
Data m_data;
183
183
};
184
184
185
- constexpr auto DocumentMarker::allMarkers () -> OptionSet<Type >
185
+ constexpr auto DocumentMarker::allMarkers () -> OptionSet<DocumentMarkerType >
186
186
{
187
187
return {
188
- Type ::AcceptedCandidate,
189
- Type ::Autocorrected,
190
- Type ::CorrectionIndicator,
191
- Type ::DeletedAutocorrection,
192
- Type ::DictationAlternatives,
193
- Type ::DraggedContent,
194
- Type ::Grammar,
195
- Type ::RejectedCorrection,
196
- Type ::Replacement,
197
- Type ::SpellCheckingExemption,
198
- Type ::Spelling,
199
- Type ::TextMatch,
188
+ DocumentMarkerType ::AcceptedCandidate,
189
+ DocumentMarkerType ::Autocorrected,
190
+ DocumentMarkerType ::CorrectionIndicator,
191
+ DocumentMarkerType ::DeletedAutocorrection,
192
+ DocumentMarkerType ::DictationAlternatives,
193
+ DocumentMarkerType ::DraggedContent,
194
+ DocumentMarkerType ::Grammar,
195
+ DocumentMarkerType ::RejectedCorrection,
196
+ DocumentMarkerType ::Replacement,
197
+ DocumentMarkerType ::SpellCheckingExemption,
198
+ DocumentMarkerType ::Spelling,
199
+ DocumentMarkerType ::TextMatch,
200
200
#if ENABLE(TELEPHONE_NUMBER_DETECTION)
201
- Type ::TelephoneNumber,
201
+ DocumentMarkerType ::TelephoneNumber,
202
202
#endif
203
203
#if PLATFORM(IOS_FAMILY)
204
- Type ::DictationPhraseWithAlternatives,
205
- Type ::DictationResult,
204
+ DocumentMarkerType ::DictationPhraseWithAlternatives,
205
+ DocumentMarkerType ::DictationResult,
206
206
#endif
207
207
#if ENABLE(PLATFORM_DRIVEN_TEXT_CHECKING)
208
- Type ::PlatformTextChecking,
208
+ DocumentMarkerType ::PlatformTextChecking,
209
209
#endif
210
210
#if ENABLE(WRITING_TOOLS)
211
- Type ::WritingToolsTextSuggestion,
211
+ DocumentMarkerType ::WritingToolsTextSuggestion,
212
212
#endif
213
- Type ::TransparentContent,
213
+ DocumentMarkerType ::TransparentContent,
214
214
};
215
215
}
216
216
217
- inline DocumentMarker::DocumentMarker (Type type, OffsetRange range, Data&& data)
217
+ inline DocumentMarker::DocumentMarker (DocumentMarkerType type, OffsetRange range, Data&& data)
218
218
: m_type (type)
219
219
, m_range (range)
220
220
, m_data (WTFMove (data))
0 commit comments