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

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

Issue 22417002: Rename ASSERT_NO_EXCEPTION_STATE and IGNORE_EXCEPTION_STATE (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/WebRange.cpp ('k') | Source/web/tests/CustomEventTest.cpp » ('j') | 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) 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 NSMutableAttributedString* string = [[NSMutableAttributedString alloc] init] ; 68 NSMutableAttributedString* string = [[NSMutableAttributedString alloc] init] ;
69 NSMutableDictionary* attrs = [NSMutableDictionary dictionary]; 69 NSMutableDictionary* attrs = [NSMutableDictionary dictionary];
70 70
71 unsigned position = 0; 71 unsigned position = 0;
72 for (TextIterator it(range.get()); !it.atEnd() && [string length] < length; it.advance()) { 72 for (TextIterator it(range.get()); !it.atEnd() && [string length] < length; it.advance()) {
73 unsigned numCharacters = it.length(); 73 unsigned numCharacters = it.length();
74 if (!numCharacters) 74 if (!numCharacters)
75 continue; 75 continue;
76 76
77 Node* container = it.range()->startContainer(IGNORE_EXCEPTION_STATE); 77 Node* container = it.range()->startContainer(IGNORE_EXCEPTION);
78 RenderObject* renderer = container->renderer(); 78 RenderObject* renderer = container->renderer();
79 ASSERT(renderer); 79 ASSERT(renderer);
80 if (!renderer) 80 if (!renderer)
81 continue; 81 continue;
82 82
83 RenderStyle* style = renderer->style(); 83 RenderStyle* style = renderer->style();
84 NSFont* font = style->font().primaryFont()->getNSFont(); 84 NSFont* font = style->font().primaryFont()->getNSFont();
85 // If the platform font can't be loaded, it's likely that the site is 85 // If the platform font can't be loaded, it's likely that the site is
86 // using a web font. For now, just use the default font instead. 86 // using a web font. For now, just use the default font instead.
87 // TODO(rsesek): Change the font activation flags to allow other process es 87 // TODO(rsesek): Change the font activation flags to allow other process es
(...skipping 18 matching lines...) Expand all
106 length:characters.size()] autorelease ]; 106 length:characters.size()] autorelease ];
107 [string replaceCharactersInRange:NSMakeRange(position, 0) 107 [string replaceCharactersInRange:NSMakeRange(position, 0)
108 withString:substring]; 108 withString:substring];
109 [string setAttributes:attrs range:NSMakeRange(position, numCharacters)]; 109 [string setAttributes:attrs range:NSMakeRange(position, numCharacters)];
110 position += numCharacters; 110 position += numCharacters;
111 } 111 }
112 return [string autorelease]; 112 return [string autorelease];
113 } 113 }
114 114
115 } // namespace WebKit 115 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/web/WebRange.cpp ('k') | Source/web/tests/CustomEventTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698