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

Side by Side Diff: third_party/WebKit/Source/web/mac/WebSubstringUtil.mm

Issue 1839643009: RELEASE_ASSERT -> CHECK and ASSERT -> DCHECK in web. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Return DCHECK_IS_ON checks. 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 size_t length = range.endPosition().computeOffsetInContainerNode() - range.s tartPosition().computeOffsetInContainerNode(); 65 size_t length = range.endPosition().computeOffsetInContainerNode() - range.s tartPosition().computeOffsetInContainerNode();
66 66
67 unsigned position = 0; 67 unsigned position = 0;
68 for (TextIterator it(range.startPosition(), range.endPosition()); !it.atEnd( ) && [string length] < length; it.advance()) { 68 for (TextIterator it(range.startPosition(), range.endPosition()); !it.atEnd( ) && [string length] < length; it.advance()) {
69 unsigned numCharacters = it.length(); 69 unsigned numCharacters = it.length();
70 if (!numCharacters) 70 if (!numCharacters)
71 continue; 71 continue;
72 72
73 Node* container = it.currentContainer(); 73 Node* container = it.currentContainer();
74 LayoutObject* layoutObject = container->layoutObject(); 74 LayoutObject* layoutObject = container->layoutObject();
75 ASSERT(layoutObject); 75 DCHECK(layoutObject);
76 if (!layoutObject) 76 if (!layoutObject)
77 continue; 77 continue;
78 78
79 const ComputedStyle* style = layoutObject->style(); 79 const ComputedStyle* style = layoutObject->style();
80 const FontPlatformData& fontPlatformData = style->font().primaryFont()-> platformData(); 80 const FontPlatformData& fontPlatformData = style->font().primaryFont()-> platformData();
81 NSFont* font = toNSFont(fontPlatformData.ctFont()); 81 NSFont* font = toNSFont(fontPlatformData.ctFont());
82 // If the platform font can't be loaded, or the size is incorrect compar ing 82 // If the platform font can't be loaded, or the size is incorrect compar ing
83 // to the computed style, it's likely that the site is using a web font. 83 // to the computed style, it's likely that the site is using a web font.
84 // For now, just use the default font instead. 84 // For now, just use the default font instead.
85 // TODO(rsesek): Change the font activation flags to allow other process es 85 // TODO(rsesek): Change the font activation flags to allow other process es
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 if (ephemeralRange.isNull()) 170 if (ephemeralRange.isNull())
171 return nil; 171 return nil;
172 172
173 NSAttributedString* result = attributedSubstringFromRange(ephemeralRange); 173 NSAttributedString* result = attributedSubstringFromRange(ephemeralRange);
174 if (baselinePoint) 174 if (baselinePoint)
175 *baselinePoint = getBaselinePoint(frame->view(), ephemeralRange, result) ; 175 *baselinePoint = getBaselinePoint(frame->view(), ephemeralRange, result) ;
176 return result; 176 return result;
177 } 177 }
178 178
179 } // namespace blink 179 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698