| OLD | NEW | 
|---|
| 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  Loading... | 
| 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  Loading... | 
| 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 | 
| OLD | NEW | 
|---|