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

Side by Side Diff: Source/core/editing/Editor.h

Issue 21694005: Spell check whole content of an editable element when it gets focused. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: change alerts to logs (tests) Created 7 years, 4 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) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 207
208 bool shouldBeginEditing(Range*); 208 bool shouldBeginEditing(Range*);
209 bool shouldEndEditing(Range*); 209 bool shouldEndEditing(Range*);
210 210
211 void clearUndoRedoOperations(); 211 void clearUndoRedoOperations();
212 bool canUndo(); 212 bool canUndo();
213 void undo(); 213 void undo();
214 bool canRedo(); 214 bool canRedo();
215 void redo(); 215 void redo();
216 216
217 void didBeginEditing(); 217 void didBeginEditing(Element*);
218 void didEndEditing(); 218 void didEndEditing();
219 219
220 void setBaseWritingDirection(WritingDirection); 220 void setBaseWritingDirection(WritingDirection);
221 221
222 // smartInsertDeleteEnabled and selectTrailingWhitespaceEnabled are 222 // smartInsertDeleteEnabled and selectTrailingWhitespaceEnabled are
223 // mutually exclusive, meaning that enabling one will disable the other. 223 // mutually exclusive, meaning that enabling one will disable the other.
224 bool smartInsertDeleteEnabled(); 224 bool smartInsertDeleteEnabled();
225 bool isSelectTrailingWhitespaceEnabled(); 225 bool isSelectTrailingWhitespaceEnabled();
226 226
227 bool setSelectionOffsets(int selectionStart, int selectionEnd); 227 bool setSelectionOffsets(int selectionStart, int selectionEnd);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 274
275 void respondToChangedSelection(const VisibleSelection& oldSelection, FrameSe lection::SetSelectionOptions); 275 void respondToChangedSelection(const VisibleSelection& oldSelection, FrameSe lection::SetSelectionOptions);
276 bool shouldChangeSelection(const VisibleSelection& oldSelection, const Visib leSelection& newSelection, EAffinity, bool stillSelecting) const; 276 bool shouldChangeSelection(const VisibleSelection& oldSelection, const Visib leSelection& newSelection, EAffinity, bool stillSelecting) const;
277 277
278 void spellCheckAfterBlur(); 278 void spellCheckAfterBlur();
279 void spellCheckOldSelection(const VisibleSelection& oldSelection, const Visi bleSelection& newAdjacentWords, const VisibleSelection& newSelectedSentence); 279 void spellCheckOldSelection(const VisibleSelection& oldSelection, const Visi bleSelection& newAdjacentWords, const VisibleSelection& newSelectedSentence);
280 280
281 bool markedTextMatchesAreHighlighted() const; 281 bool markedTextMatchesAreHighlighted() const;
282 void setMarkedTextMatchesAreHighlighted(bool); 282 void setMarkedTextMatchesAreHighlighted(bool);
283 283
284 void textFieldDidBeginEditing(Element*); 284 void textAreaOrTextFieldDidBeginEditing(Element*);
285 void textFieldDidEndEditing(Element*); 285 void textFieldDidEndEditing(Element*);
286 void textDidChangeInTextField(Element*); 286 void textDidChangeInTextField(Element*);
287 bool doTextFieldCommandFromEvent(Element*, KeyboardEvent*); 287 bool doTextFieldCommandFromEvent(Element*, KeyboardEvent*);
288 WritingDirection baseWritingDirectionForSelectionStart() const; 288 WritingDirection baseWritingDirectionForSelectionStart() const;
289 289
290 void replaceSelectionWithFragment(PassRefPtr<DocumentFragment>, bool selectR eplacement, bool smartReplace, bool matchStyle); 290 void replaceSelectionWithFragment(PassRefPtr<DocumentFragment>, bool selectR eplacement, bool smartReplace, bool matchStyle);
291 void replaceSelectionWithText(const String&, bool selectReplacement, bool sm artReplace); 291 void replaceSelectionWithText(const String&, bool selectReplacement, bool sm artReplace);
292 bool selectionStartHasMarkerFor(DocumentMarker::MarkerType, int from, int le ngth) const; 292 bool selectionStartHasMarkerFor(DocumentMarker::MarkerType, int from, int le ngth) const;
293 void updateMarkersForWordsAffectedByEditing(bool onlyHandleWordsContainingSe lection); 293 void updateMarkersForWordsAffectedByEditing(bool onlyHandleWordsContainingSe lection);
294 294
295 void simplifyMarkup(Node* startNode, Node* endNode); 295 void simplifyMarkup(Node* startNode, Node* endNode);
296 296
297 void deviceScaleFactorChanged(); 297 void deviceScaleFactorChanged();
298 298
299 EditorParagraphSeparator defaultParagraphSeparator() const { return m_defaul tParagraphSeparator; } 299 EditorParagraphSeparator defaultParagraphSeparator() const { return m_defaul tParagraphSeparator; }
300 void setDefaultParagraphSeparator(EditorParagraphSeparator separator) { m_de faultParagraphSeparator = separator; } 300 void setDefaultParagraphSeparator(EditorParagraphSeparator separator) { m_de faultParagraphSeparator = separator; }
301 301
302 class RevealSelectionScope { 302 class RevealSelectionScope {
303 WTF_MAKE_NONCOPYABLE(RevealSelectionScope); 303 WTF_MAKE_NONCOPYABLE(RevealSelectionScope);
304 public: 304 public:
305 RevealSelectionScope(Editor*); 305 RevealSelectionScope(Editor*);
306 ~RevealSelectionScope(); 306 ~RevealSelectionScope();
307 private: 307 private:
308 Editor* m_editor; 308 Editor* m_editor;
309 }; 309 };
310 friend class RevealSelectionScope; 310 friend class RevealSelectionScope;
311 311
312 // Spell checks whole contents of a editable element (<input="text"/>, <text area> or contenteditable)
313 // This gets called when any editable element gets focused.
tony 2013/08/22 18:44:34 I would remove this comment. We don't normally inc
314 void elementDidBeginEditing(Element*);
315
312 private: 316 private:
313 RefPtr<CompositeEditCommand> m_lastEditCommand; 317 RefPtr<CompositeEditCommand> m_lastEditCommand;
314 RefPtr<Node> m_removedAnchor; 318 RefPtr<Node> m_removedAnchor;
315 int m_preventRevealSelection; 319 int m_preventRevealSelection;
316 bool m_shouldStartNewKillRingSequence; 320 bool m_shouldStartNewKillRingSequence;
317 bool m_shouldStyleWithCSS; 321 bool m_shouldStyleWithCSS;
318 OwnPtr<KillRing> m_killRing; 322 OwnPtr<KillRing> m_killRing;
319 const OwnPtr<SpellCheckRequester> m_spellCheckRequester; 323 const OwnPtr<SpellCheckRequester> m_spellCheckRequester;
320 VisibleSelection m_mark; 324 VisibleSelection m_mark;
321 bool m_areMarkedTextMatchesHighlighted; 325 bool m_areMarkedTextMatchesHighlighted;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 363
360 inline bool Editor::markedTextMatchesAreHighlighted() const 364 inline bool Editor::markedTextMatchesAreHighlighted() const
361 { 365 {
362 return m_areMarkedTextMatchesHighlighted; 366 return m_areMarkedTextMatchesHighlighted;
363 } 367 }
364 368
365 369
366 } // namespace WebCore 370 } // namespace WebCore
367 371
368 #endif // Editor_h 372 #endif // Editor_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698