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

Side by Side Diff: Source/core/editing/TextCheckingHelper.cpp

Issue 908303002: Fix the range returned by findFirstMisspelling Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | 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 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 262
263 // Compute range of misspelled word 263 // Compute range of misspelled word
264 Position misspellingStart = m_start; 264 Position misspellingStart = m_start;
265 Position misspellingEnd = m_end; 265 Position misspellingEnd = m_end;
266 TextIterator::subrange(misspellingStart, misspellingEnd, current ChunkOffset + misspellingLocation, misspellingLength); 266 TextIterator::subrange(misspellingStart, misspellingEnd, current ChunkOffset + misspellingLocation, misspellingLength);
267 267
268 // Remember first-encountered misspelling and its offset. 268 // Remember first-encountered misspelling and its offset.
269 if (!firstMisspelling) { 269 if (!firstMisspelling) {
270 firstMisspellingOffset = currentChunkOffset + misspellingLoc ation; 270 firstMisspellingOffset = currentChunkOffset + misspellingLoc ation;
271 firstMisspelling = it.substring(misspellingLocation, misspel lingLength); 271 firstMisspelling = it.substring(misspellingLocation, misspel lingLength);
272 firstMisspellingRange = Range::create(misspellingStart.conta inerNode()->document(), m_start, m_end); 272 firstMisspellingRange = Range::create(misspellingStart.conta inerNode()->document(), misspellingStart, misspellingEnd);
yosin_UTC9 2015/05/21 02:28:49 It seems current code is correct, since |misspelli
273 } 273 }
274 274
275 // Store marker for misspelled word. 275 // Store marker for misspelled word.
276 misspellingStart.containerNode()->document().markers().addMarker (misspellingStart, misspellingEnd, DocumentMarker::Spelling); 276 misspellingStart.containerNode()->document().markers().addMarker (misspellingStart, misspellingEnd, DocumentMarker::Spelling);
277 277
278 // Bail out if we're marking only the first misspelling, and not all instances. 278 // Bail out if we're marking only the first misspelling, and not all instances.
279 if (!markAll) 279 if (!markAll)
280 break; 280 break;
281 } 281 }
282 } 282 }
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 return false; 565 return false;
566 566
567 const Settings* settings = frame->settings(); 567 const Settings* settings = frame->settings();
568 if (!settings) 568 if (!settings)
569 return false; 569 return false;
570 570
571 return settings->unifiedTextCheckerEnabled(); 571 return settings->unifiedTextCheckerEnabled();
572 } 572 }
573 573
574 } 574 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698