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 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 idle_spell_check_callback_->SetNeedsInvocation(); | 922 idle_spell_check_callback_->SetNeedsInvocation(); |
923 } | 923 } |
924 | 924 |
925 void SpellChecker::RemoveSpellingMarkers() { | 925 void SpellChecker::RemoveSpellingMarkers() { |
926 GetFrame().GetDocument()->Markers().RemoveAllMarkers( | 926 GetFrame().GetDocument()->Markers().RemoveAllMarkers( |
927 DocumentMarker::MisspellingMarkers()); | 927 DocumentMarker::MisspellingMarkers()); |
928 } | 928 } |
929 | 929 |
930 void SpellChecker::RemoveSpellingMarkersUnderWords( | 930 void SpellChecker::RemoveSpellingMarkersUnderWords( |
931 const Vector<String>& words) { | 931 const Vector<String>& words) { |
932 MarkerRemoverPredicate remover_predicate(words); | |
933 | |
934 DocumentMarkerController& marker_controller = | 932 DocumentMarkerController& marker_controller = |
935 GetFrame().GetDocument()->Markers(); | 933 GetFrame().GetDocument()->Markers(); |
936 marker_controller.RemoveMarkers(remover_predicate); | 934 marker_controller.RemoveSpellingMarkersUnderWords(words); |
937 marker_controller.RepaintMarkers(); | 935 marker_controller.RepaintMarkers(); |
938 } | 936 } |
939 | 937 |
940 void SpellChecker::SpellCheckAfterBlur() { | 938 void SpellChecker::SpellCheckAfterBlur() { |
941 if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled()) | 939 if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled()) |
942 return; | 940 return; |
943 | 941 |
944 // TODO(editing-dev): Hoist updateStyleAndLayoutIgnorePendingStylesheets | 942 // TODO(editing-dev): Hoist updateStyleAndLayoutIgnorePendingStylesheets |
945 // to caller. See http://crbug.com/590369 for more details. | 943 // to caller. See http://crbug.com/590369 for more details. |
946 // In the long term we should use idle time spell checker to | 944 // In the long term we should use idle time spell checker to |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1200 if (!input.IsFocusedElementInDocument()) | 1198 if (!input.IsFocusedElementInDocument()) |
1201 return false; | 1199 return false; |
1202 } | 1200 } |
1203 } | 1201 } |
1204 HTMLElement* element = | 1202 HTMLElement* element = |
1205 Traversal<HTMLElement>::FirstAncestorOrSelf(*position.AnchorNode()); | 1203 Traversal<HTMLElement>::FirstAncestorOrSelf(*position.AnchorNode()); |
1206 return element && element->IsSpellCheckingEnabled(); | 1204 return element && element->IsSpellCheckingEnabled(); |
1207 } | 1205 } |
1208 | 1206 |
1209 } // namespace blink | 1207 } // namespace blink |
OLD | NEW |