| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 style->GetFont().PrimaryFont()->PlatformData(); | 94 style->GetFont().PrimaryFont()->PlatformData(); |
| 95 fontPlatformData.text_size_ *= fontScale; | 95 fontPlatformData.text_size_ *= fontScale; |
| 96 NSFont* font = toNSFont(fontPlatformData.CtFont()); | 96 NSFont* font = toNSFont(fontPlatformData.CtFont()); |
| 97 // If the platform font can't be loaded, or the size is incorrect comparing | 97 // If the platform font can't be loaded, or the size is incorrect comparing |
| 98 // to the computed style, it's likely that the site is using a web font. | 98 // to the computed style, it's likely that the site is using a web font. |
| 99 // For now, just use the default font instead. | 99 // For now, just use the default font instead. |
| 100 // TODO(rsesek): Change the font activation flags to allow other processes | 100 // TODO(rsesek): Change the font activation flags to allow other processes |
| 101 // to use the font. | 101 // to use the font. |
| 102 // TODO(shuchen): Support scaling the font as necessary according to CSS | 102 // TODO(shuchen): Support scaling the font as necessary according to CSS |
| 103 // transforms, not just pinch-zoom. | 103 // transforms, not just pinch-zoom. |
| 104 if (!font || | 104 if (!font || floor(fontPlatformData.size()) != |
| 105 floor(fontPlatformData.size()) != | 105 floor([[font fontDescriptor] pointSize])) { |
| 106 floor([[font fontDescriptor] pointSize])) { | |
| 107 font = [NSFont systemFontOfSize:style->GetFont() | 106 font = [NSFont systemFontOfSize:style->GetFont() |
| 108 .GetFontDescription() | 107 .GetFontDescription() |
| 109 .ComputedSize() * | 108 .ComputedSize() * |
| 110 fontScale]; | 109 fontScale]; |
| 111 } | 110 } |
| 112 [attrs setObject:font forKey:NSFontAttributeName]; | 111 [attrs setObject:font forKey:NSFontAttributeName]; |
| 113 | 112 |
| 114 if (style->VisitedDependentColor(CSSPropertyColor).Alpha()) | 113 if (style->VisitedDependentColor(CSSPropertyColor).Alpha()) |
| 115 [attrs setObject:NsColor(style->VisitedDependentColor(CSSPropertyColor)) | 114 [attrs setObject:NsColor(style->VisitedDependentColor(CSSPropertyColor)) |
| 116 forKey:NSForegroundColorAttributeName]; | 115 forKey:NSForegroundColorAttributeName]; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 return nil; | 210 return nil; |
| 212 | 211 |
| 213 NSAttributedString* result = attributedSubstringFromRange( | 212 NSAttributedString* result = attributedSubstringFromRange( |
| 214 ephemeral_range, frame->GetPage()->GetVisualViewport().Scale()); | 213 ephemeral_range, frame->GetPage()->GetVisualViewport().Scale()); |
| 215 if (baseline_point) | 214 if (baseline_point) |
| 216 *baseline_point = getBaselinePoint(frame->View(), ephemeral_range, result); | 215 *baseline_point = getBaselinePoint(frame->View(), ephemeral_range, result); |
| 217 return result; | 216 return result; |
| 218 } | 217 } |
| 219 | 218 |
| 220 } // namespace blink | 219 } // namespace blink |
| OLD | NEW |