Bug 83002

Summary: [Chromium] Out-of-process font loading garbles text
Product: WebKit Reporter: Kenichi Ishibashi <bashi>
Component: PlatformAssignee: Kenichi Ishibashi <bashi>
Status: RESOLVED FIXED    
Severity: Normal CC: cc-bugs, eric, jamesr, mitz, playmobil, tkent, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: http://crbug.com/108645
Attachments:
Description Flags
Patch
none
Patch
none
Fix comments in CrossProcessFontLoading.mm
none
Revised to ToT none

Description Kenichi Ishibashi 2012-04-02 23:36:01 PDT
Original reports:

http://crbug.com/108645
http://crbug.com/121351
http://crbug.com/120929

This is not a webfont-related issue. FontPlatformData::ctFont() doesn't point out the correct NSFont* if we load the font from the browser process.
Comment 1 Kenichi Ishibashi 2012-04-02 23:56:15 PDT
Created attachment 135283 [details]
Patch
Comment 2 Kenichi Ishibashi 2012-04-03 00:00:44 PDT
Jeremy, Kent-san, could you take a look?

Cc'ing mitz@ just in case because the patch modifies mac font-related files.
Comment 3 Jeremy Moskovich 2012-04-03 06:05:04 PDT
Comment on attachment 135283 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=135283&action=review

(disclaimer: As you know, I'm not a WebKit reviewer)
LGTM
Thanks for fixing! Did you test on 10.6 and 10.7 ?

> Source/WebCore/platform/graphics/chromium/CrossProcessFontLoading.mm:194
> +//   failed.

How about:
The font that was actually loaded or null if loading failed.

> Source/WebCore/platform/graphics/chromium/CrossProcessFontLoading.mm:217
> +            // If we still can't load the font, set the null value to|outNSFont| so that the FontPlatformData won't be used.

nit : space after "to".

How about:
If we still can't load the font, set |outNSFont| to null so that FontPlatformData won't be used.

> Source/WebCore/platform/graphics/mac/FontCacheMac.mm:234
> +    if (!platformData->font())

Can you add a comment that this this can be false for the case of Chrome OOP font loading?
Comment 4 Kenichi Ishibashi 2012-04-03 19:01:47 PDT
Created attachment 135484 [details]
Patch
Comment 5 Kenichi Ishibashi 2012-04-03 19:03:30 PDT
Comment on attachment 135283 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=135283&action=review

Thank you for review! I confirmed the fix on SnowLeopard and Lion.

>> Source/WebCore/platform/graphics/chromium/CrossProcessFontLoading.mm:194
>> +//   failed.
> 
> How about:
> The font that was actually loaded or null if loading failed.

Done.

>> Source/WebCore/platform/graphics/chromium/CrossProcessFontLoading.mm:217
>> +            // If we still can't load the font, set the null value to|outNSFont| so that the FontPlatformData won't be used.
> 
> nit : space after "to".
> 
> How about:
> If we still can't load the font, set |outNSFont| to null so that FontPlatformData won't be used.

Done.

>> Source/WebCore/platform/graphics/mac/FontCacheMac.mm:234
>> +    if (!platformData->font())
> 
> Can you add a comment that this this can be false for the case of Chrome OOP font loading?

Done.
Comment 6 Kenichi Ishibashi 2012-04-03 19:06:04 PDT
Created attachment 135485 [details]
Fix comments in CrossProcessFontLoading.mm
Comment 7 Kent Tamura 2012-04-03 19:13:12 PDT
EWSs are purple.
Comment 8 Kenichi Ishibashi 2012-04-03 19:40:03 PDT
Created attachment 135487 [details]
Revised to ToT
Comment 9 Kent Tamura 2012-04-03 20:04:11 PDT
Comment on attachment 135487 [details]
Revised to ToT

rubber-stamped
Comment 10 Kenichi Ishibashi 2012-04-03 20:09:11 PDT
Comment on attachment 135487 [details]
Revised to ToT

Thanks. I'll watch bots after the patch is landed.
Comment 11 WebKit Review Bot 2012-04-03 20:15:49 PDT
Comment on attachment 135487 [details]
Revised to ToT

Clearing flags on attachment: 135487

Committed r113132: <http://trac.webkit.org/changeset/113132>
Comment 12 WebKit Review Bot 2012-04-03 20:15:54 PDT
All reviewed patches have been landed.  Closing bug.
Comment 13 Eric Seidel (no email) 2012-05-01 17:06:11 PDT
I wonder if this could be related to this:
http://code.google.com/p/chromium/issues/detail?id=125860