[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

mitz at apple.com mitz at apple.com
Thu Feb 4 21:22:04 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit e8fd00fdcff57d9227138826bb765a81f0f8ca4a
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jan 20 22:21:59 2010 +0000

    <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.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53565 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 162f9a8..e7990f7 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-01-20  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Darin Adler.
+
+        <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
+
+        * platform/mac/PopupMenuMac.mm:
+        (WebCore::PopupMenu::populate): Use the (bold) system font if an NSFont cannot
+        be obtained.
+
 2010-01-19  Nikolas Zimmermann  <nzimmermann at rim.com>
 
         Reviewed by Alexey Proskuryakov. 
diff --git a/WebCore/platform/mac/PopupMenuMac.mm b/WebCore/platform/mac/PopupMenuMac.mm
index 73fcfb9..c30b774 100644
--- a/WebCore/platform/mac/PopupMenuMac.mm
+++ b/WebCore/platform/mac/PopupMenuMac.mm
@@ -81,8 +81,14 @@ void PopupMenu::populate()
         else {
             PopupMenuStyle style = client()->itemStyle(i);
             NSMutableDictionary* attributes = [[NSMutableDictionary alloc] init];
-            if (style.font() != Font())
-                [attributes setObject:style.font().primaryFont()->getNSFont() forKey:NSFontAttributeName];
+            if (style.font() != Font()) {
+                NSFont *font = style.font().primaryFont()->getNSFont();
+                if (!font) {
+                    CGFloat size = style.font().primaryFont()->platformData().size();
+                    font = style.font().weight() < FontWeightBold ? [NSFont systemFontOfSize:size] : [NSFont boldSystemFontOfSize:size];
+                }
+                [attributes setObject:font forKey:NSFontAttributeName];
+            }
             // FIXME: Add support for styling the foreground and background colors.
             // FIXME: Find a way to customize text color when an item is highlighted.
             NSAttributedString* string = [[NSAttributedString alloc] initWithString:client()->itemText(i) attributes:attributes];

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list