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 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
903 m_idleSpellCheckCallback->setNeedsInvocation(); | 903 m_idleSpellCheckCallback->setNeedsInvocation(); |
904 } | 904 } |
905 | 905 |
906 void SpellChecker::removeSpellingMarkers() { | 906 void SpellChecker::removeSpellingMarkers() { |
907 frame().document()->markers().removeMarkers( | 907 frame().document()->markers().removeMarkers( |
908 DocumentMarker::MisspellingMarkers()); | 908 DocumentMarker::MisspellingMarkers()); |
909 } | 909 } |
910 | 910 |
911 void SpellChecker::removeSpellingMarkersUnderWords( | 911 void SpellChecker::removeSpellingMarkersUnderWords( |
912 const Vector<String>& words) { | 912 const Vector<String>& words) { |
913 MarkerRemoverPredicate removerPredicate(words); | |
914 | |
915 DocumentMarkerController& markerController = frame().document()->markers(); | 913 DocumentMarkerController& markerController = frame().document()->markers(); |
916 markerController.removeMarkers(removerPredicate); | 914 markerController.removeSpellingMarkersForWords(words); |
917 markerController.repaintMarkers(); | 915 markerController.repaintMarkers(); |
918 } | 916 } |
919 | 917 |
920 void SpellChecker::spellCheckAfterBlur() { | 918 void SpellChecker::spellCheckAfterBlur() { |
921 if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled()) | 919 if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled()) |
922 return; | 920 return; |
923 | 921 |
924 // TODO(yosin): We should hoist updateStyleAndLayoutIgnorePendingStylesheets | 922 // TODO(yosin): We should hoist updateStyleAndLayoutIgnorePendingStylesheets |
925 // to caller. See http://crbug.com/590369 for more details. | 923 // to caller. See http://crbug.com/590369 for more details. |
926 // TODO(xiaochengh): In the long term we should use idle time spell checker to | 924 // TODO(xiaochengh): In the long term we should use idle time spell checker to |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1176 if (!input.isFocusedElementInDocument()) | 1174 if (!input.isFocusedElementInDocument()) |
1177 return false; | 1175 return false; |
1178 } | 1176 } |
1179 } | 1177 } |
1180 HTMLElement* element = | 1178 HTMLElement* element = |
1181 Traversal<HTMLElement>::firstAncestorOrSelf(*position.anchorNode()); | 1179 Traversal<HTMLElement>::firstAncestorOrSelf(*position.anchorNode()); |
1182 return element && element->isSpellCheckingEnabled(); | 1180 return element && element->isSpellCheckingEnabled(); |
1183 } | 1181 } |
1184 | 1182 |
1185 } // namespace blink | 1183 } // namespace blink |
OLD | NEW |