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

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

Issue 1860883002: Introduce DCHECK() in expandToParagraphBoundary() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 misspelling.length = misspellingLength; 90 misspelling.length = misspellingLength;
91 results.append(misspelling); 91 results.append(misspelling);
92 } 92 }
93 93
94 wordStart = wordEnd; 94 wordStart = wordEnd;
95 } 95 }
96 } 96 }
97 97
98 static EphemeralRange expandToParagraphBoundary(const EphemeralRange& range) 98 static EphemeralRange expandToParagraphBoundary(const EphemeralRange& range)
99 { 99 {
100 return EphemeralRange(startOfParagraph(createVisiblePosition(range.startPosi tion())).deepEquivalent(), endOfParagraph(createVisiblePosition(range.endPositio n())).deepEquivalent()); 100 const VisiblePosition& start = createVisiblePosition(range.startPosition());
101 DCHECK(start.isNotNull()) << range.startPosition();
102 const VisiblePosition& paragraphStart = startOfParagraph(start);
103 DCHECK(paragraphStart.isNotNull()) << range.startPosition();
104
105 const VisiblePosition& end = createVisiblePosition(range.endPosition());
106 DCHECK(end.isNotNull()) << range.endPosition();
107 const VisiblePosition& paragraphEnd = endOfParagraph(end);
108 DCHECK(paragraphEnd.isNotNull()) << range.endPosition();
109
110 return EphemeralRange(paragraphStart.deepEquivalent(), paragraphEnd.deepEqui valent());
101 } 111 }
102 112
103 TextCheckingParagraph::TextCheckingParagraph(const EphemeralRange& checkingRange ) 113 TextCheckingParagraph::TextCheckingParagraph(const EphemeralRange& checkingRange )
104 : m_checkingRange(checkingRange) 114 : m_checkingRange(checkingRange)
105 , m_checkingStart(-1) 115 , m_checkingStart(-1)
106 , m_checkingEnd(-1) 116 , m_checkingEnd(-1)
107 , m_checkingLength(-1) 117 , m_checkingLength(-1)
108 { 118 {
109 } 119 }
110 120
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 return false; 574 return false;
565 575
566 const Settings* settings = frame->settings(); 576 const Settings* settings = frame->settings();
567 if (!settings) 577 if (!settings)
568 return false; 578 return false;
569 579
570 return settings->unifiedTextCheckerEnabled(); 580 return settings->unifiedTextCheckerEnabled();
571 } 581 }
572 582
573 } // namespace blink 583 } // namespace blink
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