Title: [92939] branches/safari-534.51-branch/Source/WebKit2

Diff

Modified: branches/safari-534.51-branch/Source/WebKit2/ChangeLog (92938 => 92939)


--- branches/safari-534.51-branch/Source/WebKit2/ChangeLog	2011-08-12 06:08:50 UTC (rev 92938)
+++ branches/safari-534.51-branch/Source/WebKit2/ChangeLog	2011-08-12 06:10:02 UTC (rev 92939)
@@ -1,5 +1,22 @@
 2011-08-11  Lucas Forschler  <[email protected]>
 
+    Merged 91961
+
+    2011-07-28  Anders Carlsson  <[email protected]>
+
+            Crash when trying to encode FontInfo with a null font attribute descriptor
+            https://bugs.webkit.org/show_bug.cgi?id=65350
+            <rdar://problem/9520670>
+
+            * Shared/FontInfo.cpp:
+            (WebKit::FontInfo::encode):
+            Encode a boolean specifying whether there's a fontAttributeDictionary member variable.
+
+            (WebKit::FontInfo::decode):
+            Don't try to decode the fontAttributeDictionary member variable if none has been encoded.
+
+2011-08-11  Lucas Forschler  <[email protected]>
+
     Merged 91939
 
     2011-07-26  Chris Fleizach  <[email protected]>

Modified: branches/safari-534.51-branch/Source/WebKit2/Shared/FontInfo.cpp (92938 => 92939)


--- branches/safari-534.51-branch/Source/WebKit2/Shared/FontInfo.cpp	2011-08-12 06:08:50 UTC (rev 92938)
+++ branches/safari-534.51-branch/Source/WebKit2/Shared/FontInfo.cpp	2011-08-12 06:10:02 UTC (rev 92939)
@@ -37,13 +37,22 @@
 void FontInfo::encode(CoreIPC::ArgumentEncoder* encoder) const
 {
 #if PLATFORM(MAC)
-    CoreIPC::encode(encoder, fontAttributeDictionary.get());
+    encoder->encode(static_cast<bool>(fontAttributeDictionary));
+    if (fontAttributeDictionary)
+        CoreIPC::encode(encoder, fontAttributeDictionary.get());
 #endif
 }
 
 bool FontInfo::decode(CoreIPC::ArgumentDecoder* decoder, FontInfo& fontInfo)
 {    
 #if PLATFORM(MAC)
+    bool hasFontAttributeDictionary;
+    if (!decoder->decode(hasFontAttributeDictionary))
+        return false;
+
+    if (!hasFontAttributeDictionary)
+        return true;
+
     if (!CoreIPC::decode(decoder, fontInfo.fontAttributeDictionary))
         return false;
 #endif

Modified: branches/safari-534.51-branch/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm (92938 => 92939)


--- branches/safari-534.51-branch/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm	2011-08-12 06:08:50 UTC (rev 92938)
+++ branches/safari-534.51-branch/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm	2011-08-12 06:10:02 UTC (rev 92939)
@@ -37,6 +37,7 @@
 
 void WebPopupMenu::setUpPlatformData(const IntRect&, PlatformPopupMenuData& data)
 {
+    // FIXME: font will be nil here for custom fonts, we should fix that.
     NSFont *font = m_popupClient->menuStyle().font().primaryFont()->getNSFont();
     if (!font)
         return;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to