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

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

Issue 2830233002: [DMC #1.914] Rename DocumentMarkerController::RemoveMarkers() to RemoveMarkersForNode() (Closed)
Patch Set: Rebase, remove dep Created 3 years, 8 months 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
« no previous file with comments | « third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 781
782 void SpellChecker::RemoveSpellingAndGrammarMarkers(const HTMLElement& element, 782 void SpellChecker::RemoveSpellingAndGrammarMarkers(const HTMLElement& element,
783 ElementsType elements_type) { 783 ElementsType elements_type) {
784 // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets 784 // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets
785 // needs to be audited. See http://crbug.com/590369 for more details. 785 // needs to be audited. See http://crbug.com/590369 for more details.
786 GetFrame().GetDocument()->UpdateStyleAndLayoutTreeForNode(&element); 786 GetFrame().GetDocument()->UpdateStyleAndLayoutTreeForNode(&element);
787 787
788 DocumentMarker::MarkerTypes marker_types(DocumentMarker::kSpelling); 788 DocumentMarker::MarkerTypes marker_types(DocumentMarker::kSpelling);
789 marker_types.Add(DocumentMarker::kGrammar); 789 marker_types.Add(DocumentMarker::kGrammar);
790 for (Node& node : NodeTraversal::InclusiveDescendantsOf(element)) { 790 for (Node& node : NodeTraversal::InclusiveDescendantsOf(element)) {
791 if (elements_type == ElementsType::kAll || !HasEditableStyle(node)) 791 if (elements_type == ElementsType::kAll || !HasEditableStyle(node)) {
792 GetFrame().GetDocument()->Markers().RemoveMarkers(&node, marker_types); 792 GetFrame().GetDocument()->Markers().RemoveMarkersForNode(&node,
793 marker_types);
794 }
793 } 795 }
794 } 796 }
795 797
796 void SpellChecker::ReplaceMisspelledRange(const String& text) { 798 void SpellChecker::ReplaceMisspelledRange(const String& text) {
797 EphemeralRange caret_range = GetFrame() 799 EphemeralRange caret_range = GetFrame()
798 .Selection() 800 .Selection()
799 .ComputeVisibleSelectionInDOMTree() 801 .ComputeVisibleSelectionInDOMTree()
800 .ToNormalizedEphemeralRange(); 802 .ToNormalizedEphemeralRange();
801 if (caret_range.IsNull()) 803 if (caret_range.IsNull())
802 return; 804 return;
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
1197 if (!input.IsFocusedElementInDocument()) 1199 if (!input.IsFocusedElementInDocument())
1198 return false; 1200 return false;
1199 } 1201 }
1200 } 1202 }
1201 HTMLElement* element = 1203 HTMLElement* element =
1202 Traversal<HTMLElement>::FirstAncestorOrSelf(*position.AnchorNode()); 1204 Traversal<HTMLElement>::FirstAncestorOrSelf(*position.AnchorNode());
1203 return element && element->IsSpellCheckingEnabled(); 1205 return element && element->IsSpellCheckingEnabled();
1204 } 1206 }
1205 1207
1206 } // namespace blink 1208 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698