Changeset 53565 in webkit


Ignore:
Timestamp:
Jan 20, 2010 2:21:59 PM (14 years ago)
Author:
mitz@apple.com
Message:

<rdar://problem/6579204> Exception thrown when opening a <select> pop-up that
uses a web font
https://bugs.webkit.org/show_bug.cgi?id=23911

Reviewed by Darin Adler.

  • platform/mac/PopupMenuMac.mm:

(WebCore::PopupMenu::populate): Use the (bold) system font if an NSFont cannot
be obtained.

Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r53564 r53565  
     12010-01-20  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        <rdar://problem/6579204> Exception thrown when opening a <select> pop-up that
     6        uses a web font
     7        https://bugs.webkit.org/show_bug.cgi?id=23911
     8
     9        * platform/mac/PopupMenuMac.mm:
     10        (WebCore::PopupMenu::populate): Use the (bold) system font if an NSFont cannot
     11        be obtained.
     12
    1132010-01-19  Nikolas Zimmermann  <nzimmermann@rim.com>
    214
  • trunk/WebCore/platform/mac/PopupMenuMac.mm

    r52673 r53565  
    8282            PopupMenuStyle style = client()->itemStyle(i);
    8383            NSMutableDictionary* attributes = [[NSMutableDictionary alloc] init];
    84             if (style.font() != Font())
    85                 [attributes setObject:style.font().primaryFont()->getNSFont() forKey:NSFontAttributeName];
     84            if (style.font() != Font()) {
     85                NSFont *font = style.font().primaryFont()->getNSFont();
     86                if (!font) {
     87                    CGFloat size = style.font().primaryFont()->platformData().size();
     88                    font = style.font().weight() < FontWeightBold ? [NSFont systemFontOfSize:size] : [NSFont boldSystemFontOfSize:size];
     89                }
     90                [attributes setObject:font forKey:NSFontAttributeName];
     91            }
    8692            // FIXME: Add support for styling the foreground and background colors.
    8793            // FIXME: Find a way to customize text color when an item is highlighted.
Note: See TracChangeset for help on using the changeset viewer.