| 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 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 for (size_t i = 0; i < markers.size(); ++i) { | 1012 for (size_t i = 0; i < markers.size(); ++i) { |
| 1013 DocumentMarker* marker = markers[i]; | 1013 DocumentMarker* marker = markers[i]; |
| 1014 if (marker->startOffset() <= startOffset && | 1014 if (marker->startOffset() <= startOffset && |
| 1015 endOffset <= marker->endOffset() && marker->type() == markerType) | 1015 endOffset <= marker->endOffset() && marker->type() == markerType) |
| 1016 return true; | 1016 return true; |
| 1017 } | 1017 } |
| 1018 | 1018 |
| 1019 return false; | 1019 return false; |
| 1020 } | 1020 } |
| 1021 | 1021 |
| 1022 // TODO(editing-dev): No one uses this function. Remove it. | |
| 1023 bool SpellChecker::selectionStartHasSpellingMarkerFor(int from, | |
| 1024 int length) const { | |
| 1025 return selectionStartHasMarkerFor(DocumentMarker::Spelling, from, length); | |
| 1026 } | |
| 1027 | |
| 1028 void SpellChecker::removeMarkers(const EphemeralRange& range, | 1022 void SpellChecker::removeMarkers(const EphemeralRange& range, |
| 1029 DocumentMarker::MarkerTypes markerTypes) { | 1023 DocumentMarker::MarkerTypes markerTypes) { |
| 1030 DCHECK(!frame().document()->needsLayoutTreeUpdate()); | 1024 DCHECK(!frame().document()->needsLayoutTreeUpdate()); |
| 1031 | 1025 |
| 1032 if (range.isNull()) | 1026 if (range.isNull()) |
| 1033 return; | 1027 return; |
| 1034 | 1028 |
| 1035 frame().document()->markers().removeMarkers(range, markerTypes); | 1029 frame().document()->markers().removeMarkers(range, markerTypes); |
| 1036 } | 1030 } |
| 1037 | 1031 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1191 if (!input.isFocusedElementInDocument()) | 1185 if (!input.isFocusedElementInDocument()) |
| 1192 return false; | 1186 return false; |
| 1193 } | 1187 } |
| 1194 } | 1188 } |
| 1195 HTMLElement* element = | 1189 HTMLElement* element = |
| 1196 Traversal<HTMLElement>::firstAncestorOrSelf(*position.anchorNode()); | 1190 Traversal<HTMLElement>::firstAncestorOrSelf(*position.anchorNode()); |
| 1197 return element && element->isSpellCheckingEnabled(); | 1191 return element && element->isSpellCheckingEnabled(); |
| 1198 } | 1192 } |
| 1199 | 1193 |
| 1200 } // namespace blink | 1194 } // namespace blink |
| OLD | NEW |