Title: [234900] trunk/Source
Revision
234900
Author
[email protected]
Date
2018-08-15 13:59:57 -0700 (Wed, 15 Aug 2018)

Log Message

Crashes in Quip under _dictionaryPopupInfoForRange, in setObject:forKey:
https://bugs.webkit.org/show_bug.cgi?id=188569
<rdar://problem/34201095>

Reviewed by Megan Gardner.

Source/WebKit:

* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::dictionaryPopupInfoForRange):
Speculative fix; the crashes indicate font is null, but we just checked it,
so it must be getting made null by convertFont:toSize:. Check again!

Source/WebKitLegacy/mac:

* WebView/WebImmediateActionController.mm:
(+[WebImmediateActionController _dictionaryPopupInfoForRange:inFrame:withLookupOptions:indicatorOptions:transition:]):
Speculative fix; the crashes indicate font is null, but we just checked it,
so it must be getting made null by convertFont:toSize:. Check again!

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (234899 => 234900)


--- trunk/Source/WebKit/ChangeLog	2018-08-15 20:45:41 UTC (rev 234899)
+++ trunk/Source/WebKit/ChangeLog	2018-08-15 20:59:57 UTC (rev 234900)
@@ -1,3 +1,16 @@
+2018-08-15  Tim Horton  <[email protected]>
+
+        Crashes in Quip under _dictionaryPopupInfoForRange, in setObject:forKey:
+        https://bugs.webkit.org/show_bug.cgi?id=188569
+        <rdar://problem/34201095>
+
+        Reviewed by Megan Gardner.
+
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::dictionaryPopupInfoForRange):
+        Speculative fix; the crashes indicate font is null, but we just checked it,
+        so it must be getting made null by convertFont:toSize:. Check again!
+
 2018-08-15  Ryan Haddad  <[email protected]>
 
         Unreviewed, rolling out r234870.

Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm (234899 => 234900)


--- trunk/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm	2018-08-15 20:45:41 UTC (rev 234899)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm	2018-08-15 20:59:57 UTC (rev 234900)
@@ -462,10 +462,10 @@
         RetainPtr<NSMutableDictionary> scaledAttributes = adoptNS([attributes mutableCopy]);
 
         NSFont *font = [scaledAttributes objectForKey:NSFontAttributeName];
-        if (font) {
-            font = [fontManager convertFont:font toSize:[font pointSize] * pageScaleFactor()];
+        if (font)
+            font = [fontManager convertFont:font toSize:font.pointSize * pageScaleFactor()];
+        if (font)
             [scaledAttributes setObject:font forKey:NSFontAttributeName];
-        }
 
         [scaledNSAttributedString addAttributes:scaledAttributes.get() range:range];
     }];

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (234899 => 234900)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2018-08-15 20:45:41 UTC (rev 234899)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2018-08-15 20:59:57 UTC (rev 234900)
@@ -1,3 +1,16 @@
+2018-08-15  Tim Horton  <[email protected]>
+
+        Crashes in Quip under _dictionaryPopupInfoForRange, in setObject:forKey:
+        https://bugs.webkit.org/show_bug.cgi?id=188569
+        <rdar://problem/34201095>
+
+        Reviewed by Megan Gardner.
+
+        * WebView/WebImmediateActionController.mm:
+        (+[WebImmediateActionController _dictionaryPopupInfoForRange:inFrame:withLookupOptions:indicatorOptions:transition:]):
+        Speculative fix; the crashes indicate font is null, but we just checked it,
+        so it must be getting made null by convertFont:toSize:. Check again!
+
 2018-08-13  Alex Christensen  <[email protected]>
 
         Use a 1-byte enum class for TextDirection

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm (234899 => 234900)


--- trunk/Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm	2018-08-15 20:45:41 UTC (rev 234899)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm	2018-08-15 20:59:57 UTC (rev 234900)
@@ -528,10 +528,10 @@
         RetainPtr<NSMutableDictionary> scaledAttributes = adoptNS([attributes mutableCopy]);
 
         NSFont *font = [scaledAttributes objectForKey:NSFontAttributeName];
-        if (font) {
-            font = [fontManager convertFont:font toSize:[font pointSize] * frame->page()->pageScaleFactor()];
+        if (font)
+            font = [fontManager convertFont:font toSize:font.pointSize * frame->page()->pageScaleFactor()];
+        if (font)
             [scaledAttributes setObject:font forKey:NSFontAttributeName];
-        }
 
         [scaledNSAttributedString addAttributes:scaledAttributes.get() range:attributeRange];
     }];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to