| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 91 |
| 92 if (style->visitedDependentColor(CSSPropertyColor).alpha()) | 92 if (style->visitedDependentColor(CSSPropertyColor).alpha()) |
| 93 [attrs setObject:nsColor(style->visitedDependentColor(CSSPropertyCol
or)) forKey:NSForegroundColorAttributeName]; | 93 [attrs setObject:nsColor(style->visitedDependentColor(CSSPropertyCol
or)) forKey:NSForegroundColorAttributeName]; |
| 94 else | 94 else |
| 95 [attrs removeObjectForKey:NSForegroundColorAttributeName]; | 95 [attrs removeObjectForKey:NSForegroundColorAttributeName]; |
| 96 if (style->visitedDependentColor(CSSPropertyBackgroundColor).alpha()) | 96 if (style->visitedDependentColor(CSSPropertyBackgroundColor).alpha()) |
| 97 [attrs setObject:nsColor(style->visitedDependentColor(CSSPropertyBac
kgroundColor)) forKey:NSBackgroundColorAttributeName]; | 97 [attrs setObject:nsColor(style->visitedDependentColor(CSSPropertyBac
kgroundColor)) forKey:NSBackgroundColorAttributeName]; |
| 98 else | 98 else |
| 99 [attrs removeObjectForKey:NSBackgroundColorAttributeName]; | 99 [attrs removeObjectForKey:NSBackgroundColorAttributeName]; |
| 100 | 100 |
| 101 Vector<UChar> characters; | 101 ForwardsTextBuffer characters; |
| 102 it.copyTextTo(characters); | 102 it.copyTextTo(&characters); |
| 103 NSString* substring = | 103 NSString* substring = |
| 104 [[[NSString alloc] initWithCharacters:characters.data() | 104 [[[NSString alloc] initWithCharacters:characters.data() |
| 105 length:characters.size()] autorelease
]; | 105 length:characters.size()] autorelease
]; |
| 106 [string replaceCharactersInRange:NSMakeRange(position, 0) | 106 [string replaceCharactersInRange:NSMakeRange(position, 0) |
| 107 withString:substring]; | 107 withString:substring]; |
| 108 [string setAttributes:attrs range:NSMakeRange(position, numCharacters)]; | 108 [string setAttributes:attrs range:NSMakeRange(position, numCharacters)]; |
| 109 position += numCharacters; | 109 position += numCharacters; |
| 110 } | 110 } |
| 111 return [string autorelease]; | 111 return [string autorelease]; |
| 112 } | 112 } |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |