Bug 143583 - [iOS] Delete hardcoded font fallback tables
Summary: [iOS] Delete hardcoded font fallback tables
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-04-09 15:33 PDT by Myles C. Maxfield
Modified: 2015-04-16 10:33 PDT (History)
2 users (show)

See Also:


Attachments
Patch (5.33 KB, patch)
2015-04-09 15:35 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (5.28 KB, patch)
2015-04-14 18:21 PDT, Myles C. Maxfield
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2015-04-09 15:33:53 PDT
[iOS] Delete hardcoded font fallback tables
Comment 1 Myles C. Maxfield 2015-04-09 15:35:08 PDT
Created attachment 250473 [details]
Patch
Comment 2 Jon Lee 2015-04-09 16:11:01 PDT
rdar://problem/20050226
Comment 3 Myles C. Maxfield 2015-04-14 18:17:45 PDT
Perf says we're good to go with this.
Comment 4 Myles C. Maxfield 2015-04-14 18:21:36 PDT
Created attachment 250770 [details]
Patch
Comment 5 Darin Adler 2015-04-15 10:10:50 PDT
Comment on attachment 250770 [details]
Patch

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

What kind of testing did you do?

> Source/WebCore/platform/graphics/ios/FontCacheIOS.mm:450
> +    RetainPtr<CTFontDescriptorRef> fallbackFontDescriptor = adoptCF(CTFontCreatePhysicalFontDescriptorForCharactersWithLanguage(originalFontData->getCTFont(), characters, length, nullptr, nullptr));
> +    if (RetainPtr<CFStringRef> foundFontName = adoptCF(static_cast<CFStringRef>(CTFontDescriptorCopyAttribute(fallbackFontDescriptor.get(), kCTFontNameAttribute))))
> +        font = fontForFamily(description, foundFontName.get(), false);

I think these would read better with auto instead of writing out the types. Seems a little strange that we don’t pass a language in, since webpages do, in fact, sometimes have language information, but I guess this is very low-level code.
Comment 6 Myles C. Maxfield 2015-04-15 11:12:59 PDT
Comment on attachment 250770 [details]
Patch

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

>> Source/WebCore/platform/graphics/ios/FontCacheIOS.mm:450
>> +        font = fontForFamily(description, foundFontName.get(), false);
> 
> I think these would read better with auto instead of writing out the types. Seems a little strange that we don’t pass a language in, since webpages do, in fact, sometimes have language information, but I guess this is very low-level code.

I agree - it seems like something we should do. https://bugs.webkit.org/show_bug.cgi?id=143788
Comment 7 Myles C. Maxfield 2015-04-15 11:26:34 PDT
(In reply to comment #5)
> Comment on attachment 250770 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=250770&action=review
> 
> What kind of testing did you do?
> 
> > Source/WebCore/platform/graphics/ios/FontCacheIOS.mm:450
> > +    RetainPtr<CTFontDescriptorRef> fallbackFontDescriptor = adoptCF(CTFontCreatePhysicalFontDescriptorForCharactersWithLanguage(originalFontData->getCTFont(), characters, length, nullptr, nullptr));
> > +    if (RetainPtr<CFStringRef> foundFontName = adoptCF(static_cast<CFStringRef>(CTFontDescriptorCopyAttribute(fallbackFontDescriptor.get(), kCTFontNameAttribute))))
> > +        font = fontForFamily(description, foundFontName.get(), false);
> 
> I think these would read better with auto instead of writing out the types.
> Seems a little strange that we don’t pass a language in, since webpages do,
> in fact, sometimes have language information, but I guess this is very
> low-level code.

I ran PLT with and without this patch, and it didn't report any difference.

As for correctness, I have yet to run layout tests. Note that chosen fallback fonts will change with this patch, which is both expected and desirable. I am going to look at all the test output to make sure nothing is going awry, and if not, update expected results.
Comment 8 Myles C. Maxfield 2015-04-16 10:21:54 PDT
These are the tests which need to be rebaselined. I will do so when I commit this patch today.

editing/selection/vertical-rl-rtl-extend-line-backward-br.html
editing/selection/vertical-rl-rtl-extend-line-backward-p.html
editing/selection/vertical-rl-rtl-extend-line-forward-br.html
editing/selection/vertical-rl-rtl-extend-line-forward-p.html
fast/text/international/danda-space.html
fast/text/international/thai-baht-space.html
Comment 9 Myles C. Maxfield 2015-04-16 10:33:34 PDT
Committed r182894: <http://trac.webkit.org/changeset/182894>