Collection fragment identifiers don't use PostScript names
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 May 2018 20:34:07 +0000 (20:34 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 May 2018 20:34:07 +0000 (20:34 +0000)
commit3dd1a90d63b4aa0bed090a92872ae91ba7297725
treecb2b83714b995517fe3fb1c53a219c73f7a1d06f
parent7162f96779ebde473e6a7dc6ef97d7f1ffe059ae
Collection fragment identifiers don't use PostScript names
https://bugs.webkit.org/show_bug.cgi?id=184624
Source/WebCore:

<rdar://problem/39432089>

Reviewed by Simon Fraser.

In a previous version of the CSS Fonts spec, there was text saying that items in font collections
should be 1-indexed (so the first item would be MyFonts.ttc#1). However, this is unfortunate because
inserting an item into the middle of a collection would throw off all content that uses the file.
Instead, the spec has since changed to use PostScript names (so the content instead would say
MyFonts.ttc#MyFont-Regular).

Test: fast/text/font-collection.html

* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::load):
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::calculateItemInCollection const):
(WebCore::CachedFont::ensureCustomFontData):
(WebCore::CachedFont::createCustomFontData):
(WebCore::CachedFont::calculateIndex const): Deleted.
* loader/cache/CachedFont.h:
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::createFontCustomPlatformData):
* platform/graphics/mac/FontCustomPlatformData.h:

LayoutTests:

Reviewed by Simon Fraser.

* fast/text/font-collection-expected.html:
* fast/text/font-collection.html:
* fast/text/resources/collection.ttc: I generated this font collection by hand. The "Ahemerator" font inside it is missing the
"A" glyph.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231259 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/text/font-collection-expected.html [new file with mode: 0644]
LayoutTests/fast/text/font-collection.html [new file with mode: 0644]
LayoutTests/fast/text/resources/collection.ttc [new file with mode: 0644]
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/css/CSSFontFaceSource.cpp
Source/WebCore/loader/cache/CachedFont.cpp
Source/WebCore/loader/cache/CachedFont.h
Source/WebCore/platform/graphics/cairo/FontCustomPlatformData.h
Source/WebCore/platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp
Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp
Source/WebCore/platform/graphics/mac/FontCustomPlatformData.h
Source/WebCore/platform/graphics/win/FontCustomPlatformData.cpp
Source/WebCore/platform/graphics/win/FontCustomPlatformData.h
Source/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.cpp