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

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

Issue 2082503003: ASSERT -> DCHECK conversions in core/editing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 return RenderedPosition(); 152 return RenderedPosition();
153 153
154 InlineBox* box = m_inlineBox; 154 InlineBox* box = m_inlineBox;
155 do { 155 do {
156 InlineBox* prev = box->prevLeafChildIgnoringLineBreak(); 156 InlineBox* prev = box->prevLeafChildIgnoringLineBreak();
157 if (!prev || prev->bidiLevel() < bidiLevelOfRun) 157 if (!prev || prev->bidiLevel() < bidiLevelOfRun)
158 return RenderedPosition(LineLayoutAPIShim::layoutObjectFrom(box->get LineLayoutItem()), box, box->caretLeftmostOffset()); 158 return RenderedPosition(LineLayoutAPIShim::layoutObjectFrom(box->get LineLayoutItem()), box, box->caretLeftmostOffset());
159 box = prev; 159 box = prev;
160 } while (box); 160 } while (box);
161 161
162 ASSERT_NOT_REACHED(); 162 NOTREACHED();
163 return RenderedPosition(); 163 return RenderedPosition();
164 } 164 }
165 165
166 RenderedPosition RenderedPosition::rightBoundaryOfBidiRun(unsigned char bidiLeve lOfRun) 166 RenderedPosition RenderedPosition::rightBoundaryOfBidiRun(unsigned char bidiLeve lOfRun)
167 { 167 {
168 if (!m_inlineBox || bidiLevelOfRun > m_inlineBox->bidiLevel()) 168 if (!m_inlineBox || bidiLevelOfRun > m_inlineBox->bidiLevel())
169 return RenderedPosition(); 169 return RenderedPosition();
170 170
171 InlineBox* box = m_inlineBox; 171 InlineBox* box = m_inlineBox;
172 do { 172 do {
173 InlineBox* next = box->nextLeafChildIgnoringLineBreak(); 173 InlineBox* next = box->nextLeafChildIgnoringLineBreak();
174 if (!next || next->bidiLevel() < bidiLevelOfRun) 174 if (!next || next->bidiLevel() < bidiLevelOfRun)
175 return RenderedPosition(LineLayoutAPIShim::layoutObjectFrom(box->get LineLayoutItem()), box, box->caretRightmostOffset()); 175 return RenderedPosition(LineLayoutAPIShim::layoutObjectFrom(box->get LineLayoutItem()), box, box->caretRightmostOffset());
176 box = next; 176 box = next;
177 } while (box); 177 } while (box);
178 178
179 ASSERT_NOT_REACHED(); 179 NOTREACHED();
180 return RenderedPosition(); 180 return RenderedPosition();
181 } 181 }
182 182
183 bool RenderedPosition::atLeftBoundaryOfBidiRun(ShouldMatchBidiLevel shouldMatchB idiLevel, unsigned char bidiLevelOfRun) const 183 bool RenderedPosition::atLeftBoundaryOfBidiRun(ShouldMatchBidiLevel shouldMatchB idiLevel, unsigned char bidiLevelOfRun) const
184 { 184 {
185 if (!m_inlineBox) 185 if (!m_inlineBox)
186 return false; 186 return false;
187 187
188 if (atLeftmostOffsetInBox()) { 188 if (atLeftmostOffsetInBox()) {
189 if (shouldMatchBidiLevel == IgnoreBidiLevel) 189 if (shouldMatchBidiLevel == IgnoreBidiLevel)
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 bool layoutObjectContainsPosition(LayoutObject* target, const Position& position ) 285 bool layoutObjectContainsPosition(LayoutObject* target, const Position& position )
286 { 286 {
287 for (LayoutObject* layoutObject = layoutObjectFromPosition(position); layout Object && layoutObject->node(); layoutObject = layoutObject->parent()) { 287 for (LayoutObject* layoutObject = layoutObjectFromPosition(position); layout Object && layoutObject->node(); layoutObject = layoutObject->parent()) {
288 if (layoutObject == target) 288 if (layoutObject == target)
289 return true; 289 return true;
290 } 290 }
291 return false; 291 return false;
292 } 292 }
293 293
294 } // namespace blink 294 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/Position.cpp ('k') | third_party/WebKit/Source/core/editing/VisibleSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698