Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 984 return false; | 984 return false; |
| 985 } | 985 } |
| 986 | 986 |
| 987 bool SpellChecker::selectionStartHasSpellingMarkerFor(int from, | 987 bool SpellChecker::selectionStartHasSpellingMarkerFor(int from, |
| 988 int length) const { | 988 int length) const { |
| 989 return selectionStartHasMarkerFor(DocumentMarker::Spelling, from, length); | 989 return selectionStartHasMarkerFor(DocumentMarker::Spelling, from, length); |
| 990 } | 990 } |
| 991 | 991 |
| 992 void SpellChecker::removeMarkers(const VisibleSelection& selection, | 992 void SpellChecker::removeMarkers(const VisibleSelection& selection, |
| 993 DocumentMarker::MarkerTypes markerTypes) { | 993 DocumentMarker::MarkerTypes markerTypes) { |
| 994 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets | |
| 995 // needs to be audited. See http://crbug.com/590369 for more details. | |
| 996 frame().document()->updateStyleAndLayoutIgnorePendingStylesheets(); | |
| 997 | |
| 994 const EphemeralRange range = selection.toNormalizedEphemeralRange(); | 998 const EphemeralRange range = selection.toNormalizedEphemeralRange(); |
|
yosin_UTC9
2016/10/14 08:13:00
s/const EphemeralRange/const EphemeralRange&/
Xiaocheng
2016/10/14 08:35:14
Done.
| |
| 995 if (range.isNull()) | 999 if (range.isNull()) |
| 996 return; | 1000 return; |
| 997 | 1001 |
| 998 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets | |
| 999 // needs to be audited. See http://crbug.com/590369 for more details. | |
| 1000 frame().document()->updateStyleAndLayoutIgnorePendingStylesheets(); | |
| 1001 | |
| 1002 frame().document()->markers().removeMarkers(range, markerTypes); | 1002 frame().document()->markers().removeMarkers(range, markerTypes); |
| 1003 } | 1003 } |
| 1004 | 1004 |
| 1005 void SpellChecker::cancelCheck() { | 1005 void SpellChecker::cancelCheck() { |
| 1006 m_spellCheckRequester->cancelCheck(); | 1006 m_spellCheckRequester->cancelCheck(); |
| 1007 } | 1007 } |
| 1008 | 1008 |
| 1009 void SpellChecker::requestTextChecking(const Element& element) { | 1009 void SpellChecker::requestTextChecking(const Element& element) { |
| 1010 if (!element.isSpellCheckingEnabled()) | 1010 if (!element.isSpellCheckingEnabled()) |
| 1011 return; | 1011 return; |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1137 startOfNextParagraph(createVisiblePosition(paragraphEnd)); | 1137 startOfNextParagraph(createVisiblePosition(paragraphEnd)); |
| 1138 paragraphStart = newParagraphStart.toParentAnchoredPosition(); | 1138 paragraphStart = newParagraphStart.toParentAnchoredPosition(); |
| 1139 paragraphEnd = endOfParagraph(newParagraphStart).toParentAnchoredPosition(); | 1139 paragraphEnd = endOfParagraph(newParagraphStart).toParentAnchoredPosition(); |
| 1140 firstIteration = false; | 1140 firstIteration = false; |
| 1141 totalLengthProcessed += currentLength; | 1141 totalLengthProcessed += currentLength; |
| 1142 } | 1142 } |
| 1143 return std::make_pair(firstFoundItem, firstFoundOffset); | 1143 return std::make_pair(firstFoundItem, firstFoundOffset); |
| 1144 } | 1144 } |
| 1145 | 1145 |
| 1146 } // namespace blink | 1146 } // namespace blink |
| OLD | NEW |