Bug 230799

Summary: Stop parsing font palette things that we can't implement
Product: WebKit Reporter: Myles C. Maxfield <mmaxfield>
Component: TextAssignee: Myles C. Maxfield <mmaxfield>
Status: RESOLVED FIXED    
Severity: Normal CC: clopez, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, heycam, macpherson, menard, mmaxfield, simon.fraser, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=230926
Bug Depends on:    
Bug Blocks: 230446    
Attachments:
Description Flags
WIP
none
WIP
none
WIP
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch simon.fraser: review+

Myles C. Maxfield
Reported 2021-09-25 17:16:58 PDT
It's better to not parse it in the first place, so @supports works, rather than parse it but silently drop it on the floor.
Attachments
WIP (9.40 KB, patch)
2021-10-04 23:40 PDT, Myles C. Maxfield
no flags
WIP (10.86 KB, patch)
2021-10-04 23:57 PDT, Myles C. Maxfield
no flags
WIP (18.36 KB, patch)
2021-10-05 00:14 PDT, Myles C. Maxfield
no flags
Patch (22.09 KB, patch)
2021-10-05 00:30 PDT, Myles C. Maxfield
no flags
Patch (22.10 KB, patch)
2021-10-05 00:32 PDT, Myles C. Maxfield
no flags
Patch (22.10 KB, patch)
2021-10-05 00:33 PDT, Myles C. Maxfield
no flags
Patch (22.09 KB, patch)
2021-10-05 00:38 PDT, Myles C. Maxfield
no flags
Patch (22.18 KB, patch)
2021-10-06 23:24 PDT, Myles C. Maxfield
simon.fraser: review+
Radar WebKit Bug Importer
Comment 1 2021-09-25 17:17:19 PDT
Myles C. Maxfield
Comment 2 2021-09-28 23:19:11 PDT
This might actually be tricky because different ports will be able to implement different things. We might want to actually hold off on this until the spec is modified. (https://bugs.webkit.org/show_bug.cgi?id=230926)
Myles C. Maxfield
Comment 3 2021-10-04 23:22:24 PDT
Reopening.
Myles C. Maxfield
Comment 4 2021-10-04 23:40:16 PDT
Myles C. Maxfield
Comment 5 2021-10-04 23:40:39 PDT
It's probably okay for a missing base-palette to serialize out to base-palette:0.
Myles C. Maxfield
Comment 6 2021-10-04 23:57:23 PDT
Myles C. Maxfield
Comment 7 2021-10-05 00:14:06 PDT
Myles C. Maxfield
Comment 8 2021-10-05 00:30:08 PDT
Myles C. Maxfield
Comment 9 2021-10-05 00:32:07 PDT
Myles C. Maxfield
Comment 10 2021-10-05 00:33:55 PDT
Myles C. Maxfield
Comment 11 2021-10-05 00:38:21 PDT
EWS Watchlist
Comment 12 2021-10-05 00:39:50 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
Cameron McCormack (:heycam)
Comment 13 2021-10-06 17:51:45 PDT
Comment on attachment 440178 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=440178&action=review Non-reviewer r=me. > Source/WebCore/css/parser/CSSParserImpl.cpp:703 > + unsigned key = 0; > const auto& pair = downcast<CSSFontPaletteValuesOverrideColorsValue>(item.get()); > - if (pair.key().isString()) > - key = pair.key().stringValue(); > - else if (pair.key().isNumber()) > + if (pair.key().isNumber()) > key = pair.key().value<unsigned>(); > else > continue; Nit: Might look nicer as: const auto& pair = ...; if (!pair.key().isNumber()) continue; auto key = pair.key().value<unsigned>(); ``` > Source/WebCore/platform/graphics/FontPaletteValues.h:77 > enum class Type : uint8_t { > Light, > Dark, > - Integer, > - String > - } type { Type::String }; > + Integer > + } type { Type::Integer }; (Side note: I find declaring and using types in the one declaration like this unidiomatic.)
Myles C. Maxfield
Comment 14 2021-10-06 23:24:15 PDT
Simon Fraser (smfr)
Comment 15 2021-10-07 15:06:43 PDT
Comment on attachment 440471 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=440471&action=review > Source/WebCore/css/StyleRule.cpp:333 > +StyleRuleFontPaletteValues::StyleRuleFontPaletteValues(const AtomString& name, const AtomString& fontFamily, std::optional<FontPaletteIndex>&& basePalette, Vector<FontPaletteValues::OverriddenColor>&& overrideColors) I never know if r-value references are better for small types. > Source/WebCore/css/StyleRule.h:184 > + const std::optional<FontPaletteIndex>& basePalette() const Probably still fine to return by value. > Source/WebCore/css/parser/CSSParserImpl.cpp:702 > + key = pair.key().value<unsigned>(); Just declare key on this line. > Source/WebCore/css/parser/CSSPropertyParser.cpp:4860 > + RefPtr<CSSPrimitiveValue> key = consumeInteger(range, 0); auto
Myles C. Maxfield
Comment 16 2021-10-07 16:06:11 PDT
Note You need to log in before you can comment on or make changes to this bug.