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

Side by Side Diff: third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp

Issue 2441693004: Make editingIgnoresContents() as global function (Closed)
Patch Set: 2016-10-21T14:45:18 Created 4 years, 1 month 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, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 toHTMLTextFormControlElement(element); 206 toHTMLTextFormControlElement(element);
207 parent = textControl; 207 parent = textControl;
208 element = textControl->innerEditorElement(); 208 element = textControl->innerEditorElement();
209 if (!element) 209 if (!element)
210 return; 210 return;
211 isTextField = isHTMLInputElement(*textControl) && 211 isTextField = isHTMLInputElement(*textControl) &&
212 toHTMLInputElement(*textControl).isTextField(); 212 toHTMLInputElement(*textControl).isTextField();
213 } 213 }
214 214
215 if (isTextField || !parent->isAlreadySpellChecked()) { 215 if (isTextField || !parent->isAlreadySpellChecked()) {
216 if (EditingStrategy::editingIgnoresContent(element)) 216 if (editingIgnoresContent(element))
217 return; 217 return;
218 // We always recheck textfields because markers are removed from them on 218 // We always recheck textfields because markers are removed from them on
219 // blur. 219 // blur.
220 const VisibleSelection selection = createVisibleSelection( 220 const VisibleSelection selection = createVisibleSelection(
221 SelectionInDOMTree::Builder().selectAllChildren(*element).build()); 221 SelectionInDOMTree::Builder().selectAllChildren(*element).build());
222 markMisspellingsAndBadGrammar(selection); 222 markMisspellingsAndBadGrammar(selection);
223 if (!isTextField) 223 if (!isTextField)
224 parent->setAlreadySpellChecked(true); 224 parent->setAlreadySpellChecked(true);
225 } 225 }
226 } 226 }
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after
1130 startOfNextParagraph(createVisiblePosition(paragraphEnd)); 1130 startOfNextParagraph(createVisiblePosition(paragraphEnd));
1131 paragraphStart = newParagraphStart.toParentAnchoredPosition(); 1131 paragraphStart = newParagraphStart.toParentAnchoredPosition();
1132 paragraphEnd = endOfParagraph(newParagraphStart).toParentAnchoredPosition(); 1132 paragraphEnd = endOfParagraph(newParagraphStart).toParentAnchoredPosition();
1133 firstIteration = false; 1133 firstIteration = false;
1134 totalLengthProcessed += currentLength; 1134 totalLengthProcessed += currentLength;
1135 } 1135 }
1136 return std::make_pair(firstFoundItem, firstFoundOffset); 1136 return std::make_pair(firstFoundItem, firstFoundOffset);
1137 } 1137 }
1138 1138
1139 } // namespace blink 1139 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698