Title: [98187] trunk/Source/WebKit2
- Revision
- 98187
- Author
- [email protected]
- Date
- 2011-10-21 20:56:01 -0700 (Fri, 21 Oct 2011)
Log Message
Lookup does not work on text using web fonts in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=70669
<rdar://problem/10147441>
Reviewed by Anders Carlsson.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performDictionaryLookupForRange):
If the font for the range is web font (and therefore no NSFont is
available), use the system font of the same size. While not great,
it approximates what WebKit1 does.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (98186 => 98187)
--- trunk/Source/WebKit2/ChangeLog 2011-10-22 03:25:07 UTC (rev 98186)
+++ trunk/Source/WebKit2/ChangeLog 2011-10-22 03:56:01 UTC (rev 98187)
@@ -1,5 +1,19 @@
2011-10-21 Sam Weinig <[email protected]>
+ Lookup does not work on text using web fonts in WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=70669
+ <rdar://problem/10147441>
+
+ Reviewed by Anders Carlsson.
+
+ * WebProcess/WebPage/mac/WebPageMac.mm:
+ (WebKit::WebPage::performDictionaryLookupForRange):
+ If the font for the range is web font (and therefore no NSFont is
+ available), use the system font of the same size. While not great,
+ it approximates what WebKit1 does.
+
+2011-10-21 Sam Weinig <[email protected]>
+
Fix crash below CoreIPC::MessageSender<WebKit::WebPage>::send<Messages::WebPageProxy::DidPerformDictionaryLookup>
https://bugs.webkit.org/show_bug.cgi?id=70667
<rdar://problem/9622186>
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (98186 => 98187)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm 2011-10-22 03:25:07 UTC (rev 98186)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm 2011-10-22 03:56:01 UTC (rev 98187)
@@ -520,9 +520,12 @@
RenderObject* renderer = range->startContainer()->renderer();
RenderStyle* style = renderer->style();
NSFont *font = style->font().primaryFont()->getNSFont();
+
+ // We won't be able to get an NSFont in the case that a Web Font is being used, so use
+ // the default system font at the same size instead.
if (!font)
- return;
-
+ font = [NSFont systemFontOfSize:style->font().primaryFont()->platformData().size()];
+
CFDictionaryRef fontDescriptorAttributes = (CFDictionaryRef)[[font fontDescriptor] fontAttributes];
if (!fontDescriptorAttributes)
return;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes