Bug 230788

Summary: Negative integers in @font-palette-values are invalid
Product: WebKit Reporter: Myles C. Maxfield <mmaxfield>
Component: New BugsAssignee: Myles C. Maxfield <mmaxfield>
Status: RESOLVED FIXED    
Severity: Normal CC: clopez, darin, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, macpherson, menard, simon.fraser, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 230446    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch simon.fraser: review+

Description Myles C. Maxfield 2021-09-25 01:46:49 PDT
Negative integers in @font-palette-values are invalid
Comment 1 Myles C. Maxfield 2021-09-25 01:48:05 PDT
Created attachment 439246 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2021-09-25 01:48:41 PDT
<rdar://problem/83528806>
Comment 3 EWS Watchlist 2021-09-25 01:49:27 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
Comment 4 Myles C. Maxfield 2021-09-25 02:34:24 PDT
Created attachment 439252 [details]
Patch
Comment 5 Myles C. Maxfield 2021-09-25 13:40:37 PDT
Comment on attachment 439252 [details]
Patch

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

> Source/WebCore/css/parser/CSSPropertyParser.cpp:4853
> +    return consumeInteger(range, 0);

I should change the parsed types to be unsigned, too.
Comment 6 Myles C. Maxfield 2021-09-25 17:33:44 PDT
Created attachment 439277 [details]
Patch
Comment 7 Myles C. Maxfield 2021-09-27 11:26:11 PDT
Comment on attachment 439277 [details]
Patch

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

> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:468
> +            auto number = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt64Type, &index));

Nope
Comment 8 Myles C. Maxfield 2021-09-27 14:50:58 PDT
Created attachment 439397 [details]
Patch
Comment 9 Myles C. Maxfield 2021-09-27 16:33:07 PDT
Created attachment 439414 [details]
Patch
Comment 10 Myles C. Maxfield 2021-09-28 00:52:39 PDT
Created attachment 439438 [details]
Patch
Comment 11 Myles C. Maxfield 2021-09-28 12:53:48 PDT
Committed r283188 (242236@main): <https://commits.webkit.org/242236@main>
Comment 12 Darin Adler 2021-09-28 13:07:24 PDT
Comment on attachment 439438 [details]
Patch

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

> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:456
>          auto light = kCTFontPaletteLight;
> -        auto number = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt64Type, &light));
> +        auto number = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberCFIndexType, &light));

I am perhaps the biggest fan of "auto" in the entire WebKit project, but here is a place where it’s just not appropriate. Needs to be:

    CFIndex light = kCTFontPaletteLight;
Comment 13 Myles C. Maxfield 2021-09-28 15:03:55 PDT
Committed r283197 (242244@main): <https://commits.webkit.org/242244@main>
Comment 14 Myles C. Maxfield 2021-10-05 00:08:27 PDT
Committed r283540 (242505@main): <https://commits.webkit.org/242505@main>