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

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

Issue 2962473002: Make Position::LastPositionInNode() to take const Node& instead of Node* (Closed)
Patch Set: 2017-06-26T14:00:00 Created 3 years, 5 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
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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 531
532 const EphemeralRange& inserted_range = cmd.InsertedRange(); 532 const EphemeralRange& inserted_range = cmd.InsertedRange();
533 if (inserted_range.IsNull()) 533 if (inserted_range.IsNull())
534 return; 534 return;
535 535
536 Node* node = cmd.EndingSelection().RootEditableElement(); 536 Node* node = cmd.EndingSelection().RootEditableElement();
537 if (!node) 537 if (!node)
538 return; 538 return;
539 539
540 EphemeralRange paragraph_range(Position::FirstPositionInNode(*node), 540 EphemeralRange paragraph_range(Position::FirstPositionInNode(*node),
541 Position::LastPositionInNode(node)); 541 Position::LastPositionInNode(*node));
542 TextCheckingParagraph text_to_check(inserted_range, paragraph_range); 542 TextCheckingParagraph text_to_check(inserted_range, paragraph_range);
543 ChunkAndMarkAllMisspellings(text_to_check); 543 ChunkAndMarkAllMisspellings(text_to_check);
544 } 544 }
545 545
546 void SpellChecker::ChunkAndMarkAllMisspellings( 546 void SpellChecker::ChunkAndMarkAllMisspellings(
547 const TextCheckingParagraph& full_paragraph_to_check) { 547 const TextCheckingParagraph& full_paragraph_to_check) {
548 if (full_paragraph_to_check.IsEmpty()) 548 if (full_paragraph_to_check.IsEmpty())
549 return; 549 return;
550 const EphemeralRange& paragraph_range = 550 const EphemeralRange& paragraph_range =
551 full_paragraph_to_check.ParagraphRange(); 551 full_paragraph_to_check.ParagraphRange();
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
1301 if (!input.IsFocusedElementInDocument()) 1301 if (!input.IsFocusedElementInDocument())
1302 return false; 1302 return false;
1303 } 1303 }
1304 } 1304 }
1305 HTMLElement* element = 1305 HTMLElement* element =
1306 Traversal<HTMLElement>::FirstAncestorOrSelf(*position.AnchorNode()); 1306 Traversal<HTMLElement>::FirstAncestorOrSelf(*position.AnchorNode());
1307 return element && element->IsSpellCheckingEnabled(); 1307 return element && element->IsSpellCheckingEnabled();
1308 } 1308 }
1309 1309
1310 } // namespace blink 1310 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698