RESOLVED FIXED 230792
base-palette can accept "light" or "dark"
https://bugs.webkit.org/show_bug.cgi?id=230792
Summary base-palette can accept "light" or "dark"
Myles C. Maxfield
Reported 2021-09-25 03:42:11 PDT
-
Attachments
Patch to make FontCreationContext optional (36.94 KB, patch)
2021-09-25 15:05 PDT, Myles C. Maxfield
no flags
Patch to implement light/dark (15.48 KB, patch)
2021-09-25 15:05 PDT, Myles C. Maxfield
no flags
Patch (18.63 KB, patch)
2021-09-25 18:25 PDT, Myles C. Maxfield
no flags
Patch (19.45 KB, patch)
2021-09-28 22:32 PDT, Myles C. Maxfield
no flags
Test font (5.56 KB, application/zip)
2021-09-29 11:52 PDT, Myles C. Maxfield
no flags
Patch (111.49 KB, patch)
2021-09-30 11:55 PDT, Myles C. Maxfield
no flags
Patch (111.56 KB, patch)
2021-09-30 17:39 PDT, Myles C. Maxfield
simon.fraser: review+
Radar WebKit Bug Importer
Comment 1 2021-09-25 03:43:08 PDT
Myles C. Maxfield
Comment 3 2021-09-25 15:05:05 PDT
Created attachment 439273 [details] Patch to make FontCreationContext optional
Myles C. Maxfield
Comment 4 2021-09-25 15:05:32 PDT
Created attachment 439274 [details] Patch to implement light/dark
Myles C. Maxfield
Comment 5 2021-09-25 18:07:27 PDT
Comment on attachment 439273 [details] Patch to make FontCreationContext optional The FontCreationContext work is moved to https://bugs.webkit.org/show_bug.cgi?id=230800
Myles C. Maxfield
Comment 6 2021-09-25 18:25:42 PDT
Created attachment 439279 [details] Patch EWS will be red because this patch depends on https://bugs.webkit.org/show_bug.cgi?id=230800.
Myles C. Maxfield
Comment 7 2021-09-25 18:31:36 PDT
This patch needs tests.
Myles C. Maxfield
Comment 8 2021-09-28 22:32:12 PDT
Myles C. Maxfield
Comment 9 2021-09-29 11:52:53 PDT
Created attachment 439636 [details] Test font
Myles C. Maxfield
Comment 10 2021-09-30 11:55:04 PDT
EWS Watchlist
Comment 11 2021-09-30 11:56:33 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Myles C. Maxfield
Comment 12 2021-09-30 17:27:15 PDT
Comment on attachment 439763 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=439763&action=review > LayoutTests/imported/w3c/ChangeLog:9 > + I will open a WPT PR for these posthaste. https://github.com/web-platform-tests/wpt/pull/31044
Myles C. Maxfield
Comment 13 2021-09-30 17:39:58 PDT
Simon Fraser (smfr)
Comment 14 2021-10-01 12:59:56 PDT
Comment on attachment 439805 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=439805&action=review > Source/WebCore/ChangeLog:26 > + int64_t integer; Does the spec require these be 64-bit? > Source/WebCore/platform/graphics/FontPaletteValues.h:40 > + FontPaletteIndex() = default > Source/WebCore/platform/graphics/FontPaletteValues.h:83 > + enum class Type { : uint8_t ? > Source/WebCore/platform/graphics/FontPaletteValues.h:88 > + } type { Type::String }; I like to use 'const' for members that can only ever be set in the constructor. > Source/WebCore/platform/graphics/FontPaletteValues.h:90 > + unsigned integer { 0 }; You had int64_t in the changelog > Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:472 > + int64_t rawIndex = basePalette.integer; // There is no kCFNumberUIntType. > + auto number = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt64Type, &rawIndex)); > + CFDictionaryAddValue(attributes, kCTFontPaletteAttribute, number.get()); Can author-supplied values conflict with kCTFontPaletteLight, kCTFontPaletteDark?
Myles C. Maxfield
Comment 15 2021-10-01 13:06:41 PDT
Comment on attachment 439805 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=439805&action=review >> Source/WebCore/ChangeLog:26 >> + int64_t integer; > > Does the spec require these be 64-bit? Nope. In fact, our parser clamps to 32-bit. I'll update the changelog to be "unsigned" to match the implementation. >> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:472 >> + CFDictionaryAddValue(attributes, kCTFontPaletteAttribute, number.get()); > > Can author-supplied values conflict with kCTFontPaletteLight, kCTFontPaletteDark? It depends if https://github.com/w3c/csswg-drafts/issues/6627 is accepted or not. If it's accepted (which I hope it is), there won't be a collision.
Myles C. Maxfield
Comment 16 2021-10-01 13:37:33 PDT
Comment on attachment 439805 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=439805&action=review >> Source/WebCore/platform/graphics/FontPaletteValues.h:88 >> + } type { Type::String }; > > I like to use 'const' for members that can only ever be set in the constructor. It looks like that, because this is used as a key in a hash map, and our hash map infrastructure uses operator= to overwrite the buckets in the table, all the fields have to be assignable. :(
Myles C. Maxfield
Comment 17 2021-10-01 14:01:00 PDT
Note You need to log in before you can comment on or make changes to this bug.